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,14 +64,18 @@ DashboardSetting.getSettingData = function (callback) { ...@@ -64,14 +64,18 @@ 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(
url,
param,
false,
function (json) {
let settings = {}; let settings = {};
//map id with key when save setting //map id with key when save setting
const mapKeys = { const mapKeys = {
1: 'newReport', 1: 'newReport',
2: 'continousWork', 2: 'continousWork',
3: 'warningReport', 3: 'warningReport',
4: 'dashboardHome' 4: 'dashboardHome',
}; };
if (json && json.dashboardSettingList) { if (json && json.dashboardSettingList) {
for (const item of json.dashboardSettingList) { for (const item of json.dashboardSettingList) {
...@@ -84,9 +88,11 @@ DashboardSetting.getSettingData = function (callback) { ...@@ -84,9 +88,11 @@ DashboardSetting.getSettingData = function (callback) {
if (callback) { if (callback) {
callback(settings); callback(settings);
} }
}, function() { },
function () {
console.log('DashboardSetting.getSettingData error'); console.log('DashboardSetting.getSettingData error');
}); },
);
}; };
/** /**
...@@ -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(
url,
param,
false,
function (json) {
DashboardSetting.closeModal(); DashboardSetting.closeModal();
if (DashboardSetting.changeSettingCallback && typeof DashboardSetting.changeSettingCallback === 'function') { if (DashboardSetting.changeSettingCallback && typeof DashboardSetting.changeSettingCallback === 'function') {
DashboardSetting.changeSettingCallback(); DashboardSetting.changeSettingCallback();
} }
}, function() { },
function () {
console.log('DashboardSetting.saveSetting error'); console.log('DashboardSetting.saveSetting error');
DashboardSetting.closeModal(); 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
*/ */
...@@ -21,16 +21,22 @@ NotificationSelect.getNotificationSelectData = function (callback) { ...@@ -21,16 +21,22 @@ NotificationSelect.getNotificationSelectData = function (callback) {
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(
url,
param,
false,
function (json) {
if (callback) { if (callback) {
callback(json); callback(json);
} }
}, function() { },
function () {
console.log('NotificationSelect.getNotificationSelectData error'); console.log('NotificationSelect.getNotificationSelectData error');
if (callback) { if (callback) {
callback(NotificationSelect.defaultNotificationSelectJson); 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);
...@@ -61,24 +67,29 @@ NotificationSelect.selectOperationClick = function () { ...@@ -61,24 +67,29 @@ 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>");
...@@ -88,28 +99,25 @@ NotificationSelect.selectOperationClick = function () { ...@@ -88,28 +99,25 @@ NotificationSelect.selectOperationClick = function () {
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();
}; };
/** /**
* 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
...@@ -23,16 +23,22 @@ OperationSelect.getOperationSelectData = function (callback) { ...@@ -23,16 +23,22 @@ OperationSelect.getOperationSelectData = function (callback) {
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(
url,
param,
false,
function (json) {
if (callback) { if (callback) {
callback(json); callback(json);
} }
}, function() { },
function () {
console.log('OperationSelect.getOperationSelectData error'); console.log('OperationSelect.getOperationSelectData error');
if (callback) { if (callback) {
callback(OperationSelect.defaultOperationSelectJson); callback(OperationSelect.defaultOperationSelectJson);
} }
}); },
);
}; };
/** /**
...@@ -63,48 +69,47 @@ OperationSelect.init = function (selectedCallback) { ...@@ -63,48 +69,47 @@ 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 = $("<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 ahrefRequiredFlg = $(
let divText = $("<div class='fs-12 text-truncate d-block'>"+ operationList[i].operationName + "</div>"); "<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>');
ahrefRequiredFlg.append(divText); ahrefRequiredFlg.append(divText);
messageli.append(ahrefRequiredFlg); messageli.append(ahrefRequiredFlg);
$("#operationSelectList").append(messageli); $('#operationSelectList').append(messageli);
} }
$("#operationSelectList :first-child").addClass("selected"); $('#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();
}; };
// 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