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 @@
*/
var DASHBOARD = {};
// pickup dashboard configuration
/** pickup dashboard configuration */
DASHBOARD.pickupItems = [
{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: '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 = [
{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' },
......@@ -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' },
];
// Default dashboard setting data
/** Default dashboard setting data */
DASHBOARD.defaultDashboard = {
newReport: 0,
continousWork: 0,
......@@ -30,7 +30,9 @@ DASHBOARD.defaultDashboard = {
DASHBOARD.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'topScreen/';
DASHBOARD.getDataApiUrl = DashboardSetting.baseApiUrl + 'getAllData';
// Call api get data
/**
* Call api get data
*/
DASHBOARD.getDashboardData = function (callback) {
let param = {
sid: COMMON.getSid(),
......@@ -47,8 +49,7 @@ DASHBOARD.getDashboardData = function (callback) {
});
};
//Initialization dashboard pickup items html
/** Initialization dashboard pickup items html */
DASHBOARD.initPickups = function() {
$("#pickupItems").empty();
DASHBOARD.pickupItems.forEach(function(item) {
......@@ -65,7 +66,7 @@ DASHBOARD.initPickups = function() {
}
}
//Initialization dashboard communication items html
/** Initialization dashboard communication items html */
DASHBOARD.initCommunications = function() {
$("#communicationItems").empty();
DASHBOARD.communicationItems.forEach(function(item) {
......@@ -76,7 +77,7 @@ DASHBOARD.initCommunications = function() {
});
}
// Initialization dashboard items html
/** Initialization dashboard items html */
DASHBOARD.initHtmlItem = function(item) {
let countText = '' + item.count;
if (item.count >= 100) {
......@@ -99,7 +100,7 @@ DASHBOARD.initHtmlItem = function(item) {
return html;
}
// Initialization dashboard screen
/** Initialization dashboard screen */
DASHBOARD.init = function() {
DASHBOARD.loadCommon();
DashboardSetting.getSettingData(function (settings) {
......@@ -112,7 +113,7 @@ DASHBOARD.init = function() {
});
});
}
// load common data
/** load common data */
DASHBOARD.loadCommon = function() {
$("#includedHeader").load("../common/header.html" , function() {
I18N.initi18n();
......@@ -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.pickupItems.forEach(function(item) {
const enabled = settings[item.id];
......@@ -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.communicationItems.forEach(function(item) {
if (item.id == 'messageList') {
......@@ -155,12 +156,12 @@ DASHBOARD.updateDataCommunications = function(dataDashboard) {
});
}
// Direct to pickup screen
/** Direct to pickup screen */
DASHBOARD.goPickup = function(pickupId) {
COMMON.goUrlWithCurrentParams('pickup.html', {pickupActive: pickupId});
}
// Direct to Message list screen
/** Direct to Message list screen */
DASHBOARD.goMessageList = function() {
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