Commit 2488c6d9 by NGO THI HONG

Merge branch 'feature/1.0_check_web_dev_50265' into feature/1.0_check_web_dev_50272

parents ca8b685f eb57ef10
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
*/ */
var DASHBOARD = {}; var DASHBOARD = {};
// pickup dashboard configuration /** pickup dashboard configuration */
DASHBOARD.pickupItems = [ DASHBOARD.pickupItems = [
{id: 'newReport', href: "javascript:DASHBOARD.goPickup('newReport');", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_new.svg'}, msg: 'newRegistrationTitle'}, {id: 'newReport', href: "javascript:DASHBOARD.goPickup('newReport');", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_new.svg'}, msg: 'newRegistrationTitle'},
{id: 'continousWork', href: "javascript:DASHBOARD.goPickup('continousWork');", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_proccess.svg'}, msg: 'continousWorkTitle'}, {id: 'continousWork', href: "javascript:DASHBOARD.goPickup('continousWork');", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_proccess.svg'}, msg: 'continousWorkTitle'},
{id: 'reportWarning', href: "javascript:DASHBOARD.goPickup('reportWarning');", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_alert.svg'}, msg: 'reportWarningTitle' }, {id: 'reportWarning', href: "javascript:DASHBOARD.goPickup('reportWarning');", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_alert.svg'}, msg: 'reportWarningTitle' },
]; ];
// comunication dashboard configuration /** comunication dashboard configuration */
DASHBOARD.communicationItems = [ DASHBOARD.communicationItems = [
{id: 'messageList', href: "javascript:DASHBOARD.goMessageList();", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_message_list.svg'}, msg: 'messageListTitle' }, {id: 'messageList', href: "javascript:DASHBOARD.goMessageList();", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_message_list.svg'}, msg: 'messageListTitle' },
{id: 'sendMessage', href: "javascript:DASHBOARD.goSendMessage();", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_send_message.svg'}, msg: 'sendMessageTitle' }, {id: 'sendMessage', href: "javascript:DASHBOARD.goSendMessage();", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_send_message.svg'}, msg: 'sendMessageTitle' },
...@@ -19,7 +19,7 @@ DASHBOARD.communicationItems = [ ...@@ -19,7 +19,7 @@ DASHBOARD.communicationItems = [
{id: 'chat', href: "javascript:DASHBOARD.goChat();", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_chat.svg'}, msg: 'chatTitle' }, {id: 'chat', href: "javascript:DASHBOARD.goChat();", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_chat.svg'}, msg: 'chatTitle' },
]; ];
// Default dashboard setting data /** Default dashboard setting data */
DASHBOARD.defaultDashboard = { DASHBOARD.defaultDashboard = {
newReport: 0, newReport: 0,
continousWork: 0, continousWork: 0,
...@@ -30,7 +30,9 @@ DASHBOARD.defaultDashboard = { ...@@ -30,7 +30,9 @@ DASHBOARD.defaultDashboard = {
DASHBOARD.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'topScreen/'; DASHBOARD.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'topScreen/';
DASHBOARD.getDataApiUrl = DashboardSetting.baseApiUrl + 'getAllData'; DASHBOARD.getDataApiUrl = DashboardSetting.baseApiUrl + 'getAllData';
// Call api get data /**
* Call api get data
*/
DASHBOARD.getDashboardData = function (callback) { DASHBOARD.getDashboardData = function (callback) {
let param = { let param = {
sid: COMMON.getSid(), sid: COMMON.getSid(),
...@@ -47,8 +49,7 @@ DASHBOARD.getDashboardData = function (callback) { ...@@ -47,8 +49,7 @@ DASHBOARD.getDashboardData = function (callback) {
}); });
}; };
/** Initialization dashboard pickup items html */
//Initialization dashboard pickup items html
DASHBOARD.initPickups = function() { DASHBOARD.initPickups = function() {
$("#pickupItems").empty(); $("#pickupItems").empty();
DASHBOARD.pickupItems.forEach(function(item) { DASHBOARD.pickupItems.forEach(function(item) {
...@@ -65,7 +66,7 @@ DASHBOARD.initPickups = function() { ...@@ -65,7 +66,7 @@ DASHBOARD.initPickups = function() {
} }
} }
//Initialization dashboard communication items html /** Initialization dashboard communication items html */
DASHBOARD.initCommunications = function() { DASHBOARD.initCommunications = function() {
$("#communicationItems").empty(); $("#communicationItems").empty();
DASHBOARD.communicationItems.forEach(function(item) { DASHBOARD.communicationItems.forEach(function(item) {
...@@ -76,7 +77,7 @@ DASHBOARD.initCommunications = function() { ...@@ -76,7 +77,7 @@ DASHBOARD.initCommunications = function() {
}); });
} }
// Initialization dashboard items html /** Initialization dashboard items html */
DASHBOARD.initHtmlItem = function(item) { DASHBOARD.initHtmlItem = function(item) {
let countText = '' + item.count; let countText = '' + item.count;
if (item.count >= 100) { if (item.count >= 100) {
...@@ -99,7 +100,7 @@ DASHBOARD.initHtmlItem = function(item) { ...@@ -99,7 +100,7 @@ DASHBOARD.initHtmlItem = function(item) {
return html; return html;
} }
// Initialization dashboard screen /** Initialization dashboard screen */
DASHBOARD.init = function() { DASHBOARD.init = function() {
DASHBOARD.loadCommon(); DASHBOARD.loadCommon();
DashboardSetting.getSettingData(function (settings) { DashboardSetting.getSettingData(function (settings) {
...@@ -112,7 +113,7 @@ DASHBOARD.init = function() { ...@@ -112,7 +113,7 @@ DASHBOARD.init = function() {
}); });
}); });
} }
// load common data /** load common data */
DASHBOARD.loadCommon = function() { DASHBOARD.loadCommon = function() {
$("#includedHeader").load("../common/header.html" , function() { $("#includedHeader").load("../common/header.html" , function() {
I18N.initi18n(); I18N.initi18n();
...@@ -126,7 +127,7 @@ DASHBOARD.loadCommon = function() { ...@@ -126,7 +127,7 @@ DASHBOARD.loadCommon = function() {
}); });
} }
// Update pickup config from setting dashboard data /** Update pickup config from setting dashboard data */
DASHBOARD.updateDataPickups = function(settings, dataDashboard) { DASHBOARD.updateDataPickups = function(settings, dataDashboard) {
DASHBOARD.pickupItems.forEach(function(item) { DASHBOARD.pickupItems.forEach(function(item) {
const enabled = settings[item.id]; const enabled = settings[item.id];
...@@ -140,7 +141,7 @@ DASHBOARD.updateDataPickups = function(settings, dataDashboard) { ...@@ -140,7 +141,7 @@ DASHBOARD.updateDataPickups = function(settings, dataDashboard) {
}); });
} }
//Update communication setting from dashboard data /** Update communication setting from dashboard data */
DASHBOARD.updateDataCommunications = function(dataDashboard) { DASHBOARD.updateDataCommunications = function(dataDashboard) {
DASHBOARD.communicationItems.forEach(function(item) { DASHBOARD.communicationItems.forEach(function(item) {
if (item.id == 'messageList') { if (item.id == 'messageList') {
...@@ -155,12 +156,12 @@ DASHBOARD.updateDataCommunications = function(dataDashboard) { ...@@ -155,12 +156,12 @@ DASHBOARD.updateDataCommunications = function(dataDashboard) {
}); });
} }
// Direct to pickup screen /** Direct to pickup screen */
DASHBOARD.goPickup = function(pickupId) { DASHBOARD.goPickup = function(pickupId) {
COMMON.goUrlWithCurrentParams('pickup.html', {pickupActive: pickupId}); COMMON.goUrlWithCurrentParams('pickup.html', {pickupActive: pickupId});
} }
// Direct to Message list screen /** Direct to Message list screen */
DASHBOARD.goMessageList = function() { DASHBOARD.goMessageList = function() {
COMMON.goUrlWithCurrentParams('message-list.html', {}); COMMON.goUrlWithCurrentParams('message-list.html', {});
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment