Commit 0457bca1 by Takumi Imai

ファイルコメント追加

parent f4b02a86
/** /**
* Dashboard Setting js in dashboard.html * Dashboard Setting js in dashboard.html
* *
* @since 1.0 check web * @since cms:1.4.3.2&1.4.3.3 web:1.0
*/ */
var DashboardSetting = {}; var DashboardSetting = {};
DashboardSetting.changeSettingCallback = function() {}; DashboardSetting.changeSettingCallback = function () {};
/** /**
* Html element array, map with json key from setting data API * Html element array, map with json key from setting data API
...@@ -27,33 +27,33 @@ DashboardSetting.defaultSetting = { ...@@ -27,33 +27,33 @@ DashboardSetting.defaultSetting = {
continousWork: 1, continousWork: 1,
warningReport: 1, warningReport: 1,
dashboardHome: 0, dashboardHome: 0,
} };
/** dummy setting json reponse */ /** dummy setting json reponse */
DashboardSetting.dummySettingJson = { DashboardSetting.dummySettingJson = {
dashboardSettingList: [ dashboardSettingList: [
{ {
"id": 1, id: 1,
"settingName": "New Report", settingName: 'New Report',
"settingValue": 1 settingValue: 1,
}, },
{ {
"id": 2, id: 2,
"settingName": "Continous Work", settingName: 'Continous Work',
"settingValue": 1 settingValue: 1,
}, },
{ {
"id": 3, id: 3,
"settingName": "Warning Report", settingName: 'Warning Report',
"settingValue": 1 settingValue: 1,
}, },
{ {
"id": 4, id: 4,
"settingName": "Dashboard Home", settingName: 'Dashboard Home',
"settingValue": 0 settingValue: 0,
} },
], ],
} };
/** /**
* get setting data from cms * get setting data from cms
...@@ -64,34 +64,40 @@ DashboardSetting.getSettingData = function (callback) { ...@@ -64,34 +64,40 @@ DashboardSetting.getSettingData = function (callback) {
sid: COMMON.getSid(), sid: COMMON.getSid(),
}; };
const url = DashboardSetting.baseApiUrl; const url = DashboardSetting.baseApiUrl;
COMMON.cmsAjax(url, param, false, function (json) { COMMON.cmsAjax(
let settings = {}; url,
//map id with key when save setting param,
const mapKeys = { false,
1: 'newReport', function (json) {
2: 'continousWork', let settings = {};
3: 'warningReport', //map id with key when save setting
4: 'dashboardHome' const mapKeys = {
}; 1: 'newReport',
if (json && json.dashboardSettingList) { 2: 'continousWork',
for (const item of json.dashboardSettingList) { 3: 'warningReport',
if (mapKeys.hasOwnProperty(item.id)) { 4: 'dashboardHome',
const settingKey = mapKeys[item.id]; };
settings[settingKey] = item.settingValue; if (json && json.dashboardSettingList) {
for (const item of json.dashboardSettingList) {
if (mapKeys.hasOwnProperty(item.id)) {
const settingKey = mapKeys[item.id];
settings[settingKey] = item.settingValue;
}
} }
} }
} if (callback) {
if (callback) { callback(settings);
callback(settings); }
} },
}, function() { function () {
console.log('DashboardSetting.getSettingData error'); console.log('DashboardSetting.getSettingData error');
}); },
);
}; };
/** /**
* apply settings to screen * apply settings to screen
* @param {JSON} settings * @param {JSON} settings
*/ */
DashboardSetting.applySettings = function (settings) { DashboardSetting.applySettings = function (settings) {
for (const key in settings) { for (const key in settings) {
...@@ -123,15 +129,21 @@ DashboardSetting.saveSetting = function () { ...@@ -123,15 +129,21 @@ DashboardSetting.saveSetting = function () {
param[key] = element.enabled ? 1 : 0; param[key] = element.enabled ? 1 : 0;
} }
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.SAVE_DASHBOARD_SETTING; const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.SAVE_DASHBOARD_SETTING;
COMMON.cmsAjax(url, param, false, function (json) { COMMON.cmsAjax(
DashboardSetting.closeModal(); url,
if (DashboardSetting.changeSettingCallback && typeof DashboardSetting.changeSettingCallback === 'function') { param,
DashboardSetting.changeSettingCallback(); false,
} function (json) {
}, function() { DashboardSetting.closeModal();
console.log('DashboardSetting.saveSetting error'); if (DashboardSetting.changeSettingCallback && typeof DashboardSetting.changeSettingCallback === 'function') {
DashboardSetting.closeModal(); DashboardSetting.changeSettingCallback();
}); }
},
function () {
console.log('DashboardSetting.saveSetting error');
DashboardSetting.closeModal();
},
);
}; };
/** /**
......
/** /**
* Operation Select js in operationSelect.html * Operation Select js in operationSelect.html
* *
* @since 1.0 check web * @since cms:1.4.3.2&1.4.3.3 web:1.0
*/ */
var NotificationSelect = {}; var NotificationSelect = {};
NotificationSelect.nameSelected=""; NotificationSelect.nameSelected = '';
NotificationSelect.valueSelected=""; NotificationSelect.valueSelected = '';
/** /**
* default operation select data JSON * default operation select data JSON
*/ */
...@@ -14,23 +14,29 @@ NotificationSelect.defaultNotificationSelectJson = []; ...@@ -14,23 +14,29 @@ NotificationSelect.defaultNotificationSelectJson = [];
/** /**
* get operation select data from cms * get operation select data from cms
* @param {function} callback * @param {function} callback
*/ */
NotificationSelect.getNotificationSelectData = function (callback) { NotificationSelect.getNotificationSelectData = function (callback) {
let param = { let param = {
sid: COMMON.getSid(), sid: COMMON.getSid(),
}; };
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PUSH_MESSAGE_TEMPLATE; const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PUSH_MESSAGE_TEMPLATE;
COMMON.cmsAjax(url, param, false, function (json) { COMMON.cmsAjax(
if (callback) { url,
callback(json); param,
} false,
}, function() { function (json) {
console.log('NotificationSelect.getNotificationSelectData error'); if (callback) {
if (callback) { callback(json);
callback(NotificationSelect.defaultNotificationSelectJson); }
} },
}); function () {
console.log('NotificationSelect.getNotificationSelectData error');
if (callback) {
callback(NotificationSelect.defaultNotificationSelectJson);
}
},
);
}; };
/** /**
...@@ -48,7 +54,7 @@ NotificationSelect.selectOperationClick = function () { ...@@ -48,7 +54,7 @@ NotificationSelect.selectOperationClick = function () {
/** /**
* init data, action when screen onload * init data, action when screen onload
*/ */
NotificationSelect.init = function (selectedCallback) { NotificationSelect.init = function (selectedCallback) {
NotificationSelect.getNotificationSelectData(function (data) { NotificationSelect.getNotificationSelectData(function (data) {
if (typeof data === 'undefined' || data == null) return; if (typeof data === 'undefined' || data == null) return;
NotificationSelect.createNotificationSelectList(data.pushMessageTemplate); NotificationSelect.createNotificationSelectList(data.pushMessageTemplate);
...@@ -59,57 +65,59 @@ NotificationSelect.selectOperationClick = function () { ...@@ -59,57 +65,59 @@ NotificationSelect.selectOperationClick = function () {
/** /**
* Implement notification select html * Implement notification select html
* @returns * @returns
*/ */
NotificationSelect.createNotificationSelectList = function(pushMessageTemplate) { NotificationSelect.createNotificationSelectList = function (pushMessageTemplate) {
$("#notificationSelectList").empty(); $('#notificationSelectList').empty();
if (typeof pushMessageTemplate === 'undefined' || pushMessageTemplate.length < 1) return; if (typeof pushMessageTemplate === 'undefined' || pushMessageTemplate.length < 1) return;
let classSelected = "selected"; let classSelected = 'selected';
for (let i = 0; i < pushMessageTemplate.length; i++) { for (let i = 0; i < pushMessageTemplate.length; i++) {
let divName = $("<div class='pl-5 py-3 h-100 w-100 align-self-center select-label'>" + pushMessageTemplate[i].name + '</div>');
let divName = $("<div class='pl-5 py-3 h-100 w-100 align-self-center select-label'>" + pushMessageTemplate[i].name + "</div>"); let divIcon = $(
let divIcon = $("<div class='flex-shrink-1 mx-3 align-self-center'>" "<div class='flex-shrink-1 mx-3 align-self-center'>" +
+ "<button class='btn btn-link border collapsed' type='button' data-toggle='collapse' data-target='#collapse" + i + "' aria-expanded='true' aria-controls='collapse" + i + "'>" "<button class='btn btn-link border collapsed' type='button' data-toggle='collapse' data-target='#collapse" +
+ "<div class='arrow-icon'></div>" i +
+ "</button></div>"); "' aria-expanded='true' aria-controls='collapse" +
i +
"'>" +
"<div class='arrow-icon'></div>" +
'</button></div>',
);
let ahrefName = $("<a href='#' class='d-flex text-decoration-none'></a>"); let ahrefName = $("<a href='#' class='d-flex text-decoration-none'></a>");
let divParentName = $("<div class='card mb-2 " + classSelected + "' id='heading" + i + "'></div>"); let divParentName = $("<div class='card mb-2 " + classSelected + "' id='heading" + i + "'></div>");
classSelected = ""; classSelected = '';
let divValue = $("<div id='collapse" + i + "' class='collapse' aria-labelledby='heading" + i + "' data-parent='#accordion" + i + "'></div>"); let divValue = $("<div id='collapse" + i + "' class='collapse' aria-labelledby='heading" + i + "' data-parent='#accordion" + i + "'></div>");
let divBodyValue = $("<div class='card-body'>" + pushMessageTemplate[i].value + "</div>"); let divBodyValue = $("<div class='card-body'>" + pushMessageTemplate[i].value + '</div>');
let messageli = $("<li class='accordion' id='accordion" + i + "'></li>"); let messageli = $("<li class='accordion' id='accordion" + i + "'></li>");
ahrefName.append(divName); ahrefName.append(divName);
ahrefName.append(divIcon); ahrefName.append(divIcon);
divParentName.append(ahrefName); divParentName.append(ahrefName);
divValue.append(divBodyValue); divValue.append(divBodyValue);
messageli.append(divParentName); messageli.append(divParentName);
messageli.append(divValue); messageli.append(divValue);
if(i == 0) if (i == 0) {
{
NotificationSelect.nameSelected = pushMessageTemplate[i].name; NotificationSelect.nameSelected = pushMessageTemplate[i].name;
NotificationSelect.valueSelected = pushMessageTemplate[i].value; NotificationSelect.valueSelected = pushMessageTemplate[i].value;
} }
$("#notificationSelectList").append(messageli); $('#notificationSelectList').append(messageli);
} }
} };
/** /**
* handle click event of select button * handle click event of select button
*/ */
NotificationSelect.onClickTempalte = function () { NotificationSelect.onClickTempalte = function () {
NotificationSelect.chooseTemplate(); NotificationSelect.chooseTemplate();
}; };
/** /**
* Get operation select and call back function in main page * Get operation select and call back function in main page
*/ */
NotificationSelect.chooseTemplate = function () { NotificationSelect.chooseTemplate = function () {
let param = {}; let param = {};
param.nameSelected = NotificationSelect.nameSelected; param.nameSelected = NotificationSelect.nameSelected;
param.valueSelected = NotificationSelect.valueSelected; param.valueSelected = NotificationSelect.valueSelected;
...@@ -122,6 +130,6 @@ NotificationSelect.selectOperationClick = function () { ...@@ -122,6 +130,6 @@ NotificationSelect.selectOperationClick = function () {
/** /**
* close setting dialog * close setting dialog
*/ */
NotificationSelect.closeModal = function () { NotificationSelect.closeModal = function () {
$('#select-template-modal .close').click(); $('#select-template-modal .close').click();
}; };
\ No newline at end of file
/** /**
* Operation Select js in operationSelect.html * Operation Select js in operationSelect.html
* *
* @since 1.0 check web * @since cms:1.4.3.2&1.4.3.3 web:1.0
*/ */
var OperationSelect = {}; var OperationSelect = {};
OperationSelect.changeSelectCallback = function() {}; OperationSelect.changeSelectCallback = function () {};
OperationSelect.operationIdSelected=""; OperationSelect.operationIdSelected = '';
OperationSelect.operationNameSelected=""; OperationSelect.operationNameSelected = '';
/** /**
* default operation select data JSON * default operation select data JSON
...@@ -16,23 +16,29 @@ OperationSelect.defaultOperationSelectJson = []; ...@@ -16,23 +16,29 @@ OperationSelect.defaultOperationSelectJson = [];
/** /**
* get operation select data from cms * get operation select data from cms
* @param {function} callback * @param {function} callback
*/ */
OperationSelect.getOperationSelectData = function (callback) { OperationSelect.getOperationSelectData = function (callback) {
let param = { let param = {
sid: COMMON.getSid(), sid: COMMON.getSid(),
}; };
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.OPERATION_SELECT; const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.OPERATION_SELECT;
COMMON.cmsAjax(url, param, false, function (json) { COMMON.cmsAjax(
if (callback) { url,
callback(json); param,
} false,
}, function() { function (json) {
console.log('OperationSelect.getOperationSelectData error'); if (callback) {
if (callback) { callback(json);
callback(OperationSelect.defaultOperationSelectJson); }
} },
}); function () {
console.log('OperationSelect.getOperationSelectData error');
if (callback) {
callback(OperationSelect.defaultOperationSelectJson);
}
},
);
}; };
/** /**
...@@ -61,50 +67,49 @@ OperationSelect.init = function (selectedCallback) { ...@@ -61,50 +67,49 @@ OperationSelect.init = function (selectedCallback) {
/** /**
* Implement operation select html * Implement operation select html
* @returns * @returns
*/ */
OperationSelect.createOperationSelectList = function(operationList) { OperationSelect.createOperationSelectList = function (operationList) {
$("#operationSelectList").empty(); $('#operationSelectList').empty();
if (typeof operationList === 'undefined' || operationList.length < 1) return; if (typeof operationList === 'undefined' || operationList.length < 1) return;
for (let i = 0; i < operationList.length; i++) { for (let i = 0; i < operationList.length; i++) {
let messageli = $("<li class='card mb-2' name = 'operationId_" + operationList[i].operationId + "' ></li>");
let messageli = $("<li class='card mb-2' name = 'operationId_" + operationList[i].operationId + "' ></li>"); let ahrefRequiredFlg = $(
let ahrefRequiredFlg = $("<a href='#' class='d-block px-5 py-3 text-decoration-none select-label' data-key='" + operationList[i].operationId + "' data-name='" + operationList[i].operationName + "' ></a>"); "<a href='#' class='d-block px-5 py-3 text-decoration-none select-label' data-key='" + operationList[i].operationId + "' data-name='" + operationList[i].operationName + "' ></a>",
let divText = $("<div class='fs-12 text-truncate d-block'>"+ operationList[i].operationName + "</div>"); );
let divText = $("<div class='fs-12 text-truncate d-block'>" + operationList[i].operationName + '</div>');
ahrefRequiredFlg.append(divText);
messageli.append(ahrefRequiredFlg);
$("#operationSelectList").append(messageli); ahrefRequiredFlg.append(divText);
} messageli.append(ahrefRequiredFlg);
$("#operationSelectList :first-child").addClass("selected");
}
$('#operationSelectList').append(messageli);
}
$('#operationSelectList :first-child').addClass('selected');
};
/** /**
* handle click event of select button * handle click event of select button
*/ */
OperationSelect.onClickSelect = function () { OperationSelect.onClickSelect = function () {
OperationSelect.chooseOperationSelect(); OperationSelect.chooseOperationSelect();
}; };
/** /**
* Get operation select and call back function in main page * Get operation select and call back function in main page
*/ */
OperationSelect.chooseOperationSelect = function () { OperationSelect.chooseOperationSelect = function () {
let param = {}; let param = {};
param.operationIdSelected = OperationSelect.operationIdSelected; param.operationIdSelected = OperationSelect.operationIdSelected;
param.operationNameSelected = OperationSelect.operationNameSelected; param.operationNameSelected = OperationSelect.operationNameSelected;
OperationSelect.closeModal(); OperationSelect.closeModal();
if (OperationSelect.changeSelectCallback && typeof OperationSelect.changeSelectCallback === 'function') { if (OperationSelect.changeSelectCallback && typeof OperationSelect.changeSelectCallback === 'function') {
OperationSelect.changeSelectCallback(param.operationIdSelected,param.operationNameSelected ); OperationSelect.changeSelectCallback(param.operationIdSelected, param.operationNameSelected);
} }
}; };
/** /**
* close setting dialog * close setting dialog
*/ */
OperationSelect.closeModal = function () { OperationSelect.closeModal = function () {
$('#task-list-modal .close').click(); $('#task-list-modal .close').click();
}; };
\ No newline at end of file
// PDF PRINT function js /**
* PDF PRINT function js
*
* @since cms:1.4.3.2&1.4.3.3 web:1.0
**/
var PP = {}; var PP = {};
......
/**
* js for pushing detailed messages
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var PushMessageDetail = {}; var PushMessageDetail = {};
PushMessageDetail.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PUSH_MESSAGE_DETAIL; PushMessageDetail.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PUSH_MESSAGE_DETAIL;
......
// ReportForm function js /**
* ReportForm function js
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var RF = {}; var RF = {};
......
// ReportList function js /**
* ReportList function js
*
* @since cms:1.4.3.2&1.4.3.3 web:1.0
**/
var RL = {}; var RL = {};
......
/** /**
* Send Message js in sendMessage.html * Send Message js in sendMessage.html
* *
* @since 1.0 check web * @since cms:1.4.3.2&1.4.3.3 web:1.0
*/ */
var SendMessage = {}; var SendMessage = {};
......
/// Account Settings function js /**
* Account Settings function js
* @since cms:1.4.3.2&1.4.3.3 web:1.0
**/
var SETTINGS = {}; var SETTINGS = {};
......
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