Commit a0d68ece by NGUYEN HOANG SON

implement server option 'isChat'

parent 31c31a10
......@@ -9,7 +9,7 @@ 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: "javascript:CHK_L.sendAppCommand('goSendMessage');", count: 0, enabled: true, img: {src: 'img/icon_send_message.svg'}, msg: 'sendMessageTitle'},
{id: 'distanceSupport', href: "javascript:CHK_L.sendAppCommand('goDistanceSupport');", count: 0, enabled: true, img: {src: 'img/icon_remote.svg'}, msg: 'distanceSupportTitle'},
{id: 'chat', href: "javascript:CHK_L.sendAppCommand('goChat');", count: 0, enabled: true, img: {src: 'img/icon_chat.svg'}, msg: 'chatTitle'},
{id: 'chat', href: "javascript:CHK_L.sendAppCommand('goChat');", count: 0, enabled: false, img: {src: 'img/icon_chat.svg'}, msg: 'chatTitle'},
];
CHK_Dashboard.settingKey = {
......@@ -62,6 +62,7 @@ CHK_Dashboard.initHtmlItem = function(item) {
CHK_Dashboard.init = function() {
CHK_Dashboard.updateDataPickups();
CHK_Dashboard.initPickups();
CHK_Dashboard.updateDataCommunications();
CHK_Dashboard.initCommunications();
}
......@@ -73,4 +74,17 @@ CHK_Dashboard.updateDataPickups = function() {
}
item.count = 0;
});
}
CHK_Dashboard.updateDataCommunications = function() {
CHK_Dashboard.communicationItems.forEach(function(item) {
if (item.id == 'messageList') {
item.count = 0;
if (typeof CHK.pushMessageList !== 'undefined') {
item.count = CHK.pushMessageList.length;
}
} else if (item.id == 'chat') {
item.enabled = CHK.isChat;
}
});
}
\ No newline at end of file
......@@ -30,7 +30,7 @@ CHK_MessageList.clickMessage = function(pushMessageId) {
CHK_MessageList.createMessageList = function(messageList) {
$('#messageTable').empty();
if (typeof messageList !== 'object') {
if (typeof messageList === 'undefined' || messageList.length < 1) {
$('#messageList .not-found').removeClass('d-none');
return;
}
......
......@@ -45,6 +45,7 @@ CHK.pushMessageList;
CHK.scanResultCode; //スキャンしたRFID,バーコード
CHK.scanType; //スキャン種別(0:バーコード、1:RFID)
CHK.isChat;
var pageLang; // ページ設定言語
var CATEGORY_HEIGHT; //カテゴリー描画用固定値(高さ)
......@@ -322,7 +323,7 @@ CHK.hasAddTaskAuthority = function() {
CHK.sessionKeys = [
'reportType', 'isCms', 'isWeb', 'isWindows', 'isAndroid', 'isIOS', 'isRFIDBarcodeScan', 'isOperationGroupMaster',
'lang', 'debug', 'isMobile',
'lang', 'debug', 'isMobile', 'isChat',
];
CHK.loadSessionData = function() {
......@@ -384,6 +385,7 @@ CHK.initCommon = function() {
CHK.lang = urlParam.lang;
CHK.debug = urlParam.debug;
CHK.isMobile = urlParam.mobile_flg && urlParam.mobile_flg == "1";
CHK.isChat = urlParam.isChat && urlParam.isChat == "1";
CHK.loadInitSession();
if (typeof location.pathname === 'string' && location.pathname.includes('index.html') == true) {
......@@ -536,8 +538,17 @@ CHK.initReportApp = function (callback) {
});
// コミュニケーションデータJSONデータ
CHK.initPushMessageList();
}
CHK.initPushMessageList = function() {
CHK.loadJson(CHK.jsonPath.pushMessageList, function (json) {
CHK.pushMessageList = json;
CHK.pushMessageList = json.pushMessageList;
if (typeof CHK_Dashboard !== 'undefined') {
//update batch message list at dashboard screen
CHK_Dashboard.updateDataCommunications();
CHK_Dashboard.initCommunications();
}
});
}
......
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