Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
design
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abookCheck
design
Commits
a4ff6c0d
Commit
a4ff6c0d
authored
Aug 19, 2022
by
NGUYEN HOANG SON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#49152 implement dashboard setting
parent
d30f5e01
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
59 deletions
+79
-59
app/index.html
+2
-59
app/script/check-dashboard.js
+77
-0
No files found.
app/index.html
View file @
a4ff6c0d
...
...
@@ -18,6 +18,8 @@
<script
src=
"script/check-list.js?__UPDATEID__"
></script>
<script
src=
"script/check-foriOS.js"
></script>
<script
src=
"script/constant.js?__UPDATEID__"
></script>
<script
src=
"script/check-dashboard-setting.js"
></script>
<script
src=
"script/check-dashboard.js"
></script>
</head>
<body
onload=
"CHK_L.init();"
style=
"position: relative; margin-top: 53px;"
>
...
...
@@ -236,65 +238,6 @@
<script>
var
CHK_Dashboard
=
{};
CHK_Dashboard
.
pickupItems
=
[
{
id
:
'newReport'
,
href
:
'pickup.html'
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_message_lsit.svg'
},
msg
:
'newRegistrationTitle'
},
{
id
:
'continousWork'
,
href
:
'pickup.html'
,
count
:
88
,
enabled
:
true
,
img
:
{
src
:
'img/icon_proccess.svg'
},
msg
:
'continousWorkTitle'
},
{
id
:
'reportWarning'
,
href
:
'pickup.html'
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_alert.svg'
},
msg
:
'reportWarningTitle'
},
];
CHK_Dashboard
.
communicationItems
=
[
{
id
:
'messageList'
,
href
:
'message-list.html'
,
count
:
77
,
enabled
:
true
,
img
:
{
src
:
'img/icon_new.svg'
},
msg
:
'messageListTitle'
},
{
id
:
'sendMessage'
,
href
:
''
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_send_message.svg'
},
msg
:
'sendMessageTitle'
},
{
id
:
'distanceSupport'
,
href
:
''
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_remote.svg'
},
msg
:
'distanceSupportTitle'
},
{
id
:
'chat'
,
href
:
''
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_chat.svg'
},
msg
:
'chatTitle'
},
];
CHK_Dashboard
.
initPickups
=
function
()
{
$
(
"#pickupItems"
).
empty
();
CHK_Dashboard
.
pickupItems
.
forEach
(
function
(
item
)
{
if
(
item
.
enabled
==
true
)
{
var
html
=
CHK_Dashboard
.
initHtmlItem
(
item
);
$
(
"#pickupItems"
).
append
(
html
);
}
});
}
CHK_Dashboard
.
initCommunications
=
function
()
{
$
(
"#communicationItems"
).
empty
();
CHK_Dashboard
.
communicationItems
.
forEach
(
function
(
item
)
{
if
(
item
.
enabled
==
true
)
{
var
html
=
CHK_Dashboard
.
initHtmlItem
(
item
);
$
(
"#communicationItems"
).
append
(
html
);
}
});
}
CHK_Dashboard
.
initHtmlItem
=
function
(
item
)
{
var
countText
=
''
+
item
.
count
;
if
(
item
.
count
>=
100
)
{
countText
=
'99+'
;
}
var
countDClass
=
''
;
if
(
typeof
item
.
count
==
'undefined'
||
item
.
count
<
1
)
{
countDClass
=
' d-none'
;
}
var
countSpan
=
'<span class="count fs-7'
+
countDClass
+
'">'
+
countText
+
'</span>'
;
var
html
=
$
(
'<div class="item" id="'
+
item
.
id
+
'">'
+
'<a href="'
+
item
.
href
+
'" class="d-block text-dark text-decoration-none mb-1 p-3">'
+
'<img src="'
+
item
.
img
.
src
+
'">'
+
'<div class="fs-8 multi-lang" data-msg="'
+
item
.
msg
+
'">'
+
getMsg
(
item
.
msg
)
+
'</div>'
+
countSpan
+
'</a>'
+
'</div>'
);
return
html
;
}
CHK_Dashboard
.
init
=
function
()
{
console
.
log
(
"CHK_Dashboard.init"
);
CHK_Dashboard
.
initPickups
();
CHK_Dashboard
.
initCommunications
();
}
CHK_Dashboard
.
clickBottomNav
=
function
(
pageId
,
elm
)
{
var
i
,
pages
,
navs
;
pages
=
document
.
getElementsByClassName
(
"page-content"
);
...
...
app/script/check-dashboard.js
0 → 100644
View file @
a4ff6c0d
var
CHK_Dashboard
=
{};
CHK_Dashboard
.
pickupItems
=
[
{
id
:
'newReport'
,
href
:
'pickup.html'
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_new.svg'
},
msg
:
'newRegistrationTitle'
},
{
id
:
'continousWork'
,
href
:
'pickup.html'
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_proccess.svg'
},
msg
:
'continousWorkTitle'
},
{
id
:
'reportWarning'
,
href
:
'pickup.html'
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_alert.svg'
},
msg
:
'reportWarningTitle'
},
];
CHK_Dashboard
.
communicationItems
=
[
{
id
:
'messageList'
,
href
:
'message-list.html'
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_message_lsit.svg'
},
msg
:
'messageListTitle'
},
{
id
:
'sendMessage'
,
href
:
''
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_send_message.svg'
},
msg
:
'sendMessageTitle'
},
{
id
:
'distanceSupport'
,
href
:
''
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_remote.svg'
},
msg
:
'distanceSupportTitle'
},
{
id
:
'chat'
,
href
:
''
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_chat.svg'
},
msg
:
'chatTitle'
},
];
CHK_Dashboard
.
pickupSettingMap
=
{
newReport
:
"dashboardSettingNewReport"
,
continousWork
:
"dashboardSettingContinousWork"
,
reportWarning
:
"dashboardSettingReportWarning"
,
dashboardHome
:
"dashboardSettingDashboardHome"
,
}
CHK_Dashboard
.
initPickups
=
function
()
{
$
(
"#pickupItems"
).
empty
();
CHK_Dashboard
.
pickupItems
.
forEach
(
function
(
item
)
{
if
(
item
.
enabled
==
true
)
{
var
html
=
CHK_Dashboard
.
initHtmlItem
(
item
);
$
(
"#pickupItems"
).
append
(
html
);
}
});
}
CHK_Dashboard
.
initCommunications
=
function
()
{
$
(
"#communicationItems"
).
empty
();
CHK_Dashboard
.
communicationItems
.
forEach
(
function
(
item
)
{
if
(
item
.
enabled
==
true
)
{
var
html
=
CHK_Dashboard
.
initHtmlItem
(
item
);
$
(
"#communicationItems"
).
append
(
html
);
}
});
}
CHK_Dashboard
.
initHtmlItem
=
function
(
item
)
{
var
countText
=
''
+
item
.
count
;
if
(
item
.
count
>=
100
)
{
countText
=
'99+'
;
}
var
countDClass
=
''
;
if
(
typeof
item
.
count
==
'undefined'
||
item
.
count
<
1
)
{
countDClass
=
' d-none'
;
}
var
countSpan
=
'<span class="count fs-7'
+
countDClass
+
'">'
+
countText
+
'</span>'
;
var
html
=
$
(
'<div class="item" id="'
+
item
.
id
+
'">'
+
'<a href="'
+
item
.
href
+
'" class="d-block text-dark text-decoration-none mb-1 p-3">'
+
'<img src="'
+
item
.
img
.
src
+
'">'
+
'<div class="fs-8 multi-lang" data-msg="'
+
item
.
msg
+
'">'
+
getMsg
(
item
.
msg
)
+
'</div>'
+
countSpan
+
'</a>'
+
'</div>'
);
return
html
;
}
CHK_Dashboard
.
init
=
function
()
{
CHK_Dashboard
.
updateDataPickups
();
CHK_Dashboard
.
initPickups
();
CHK_Dashboard
.
initCommunications
();
}
CHK_Dashboard
.
updateDataPickups
=
function
()
{
CHK_Dashboard
.
pickupItems
.
forEach
(
function
(
item
)
{
let
enabled
=
CHK_DashboardSetting
.
isSettingEnabled
(
CHK_Dashboard
.
pickupSettingMap
[
item
.
id
]);
if
(
enabled
==
true
||
enabled
==
false
)
{
item
.
enabled
=
enabled
;
}
item
.
count
=
0
;
});
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment