Commit ee4a6bb7 by Takumi Imai

#49471 インデント修正

parent 49973db6
{
"arrowParens": "avoid",
"bracketSpacing": true,
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 200,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"tabs": true,
"trailingComma": "all",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
* 4.url
* 5.cms communication
* 6.check if user is logged in
*
*
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var CHK_Common = {};
......@@ -19,321 +19,279 @@ CHK_Common.lang;
* web gets lang form local storage
* but app gets lnag from session storage
*/
CHK_Common.setLangCodeWeb = function() {
CHK_Common.setLangCodeWeb = function () {
let lang = CHK_Common.getLangWeb();
if (lang.split("-")[0] == CHK_CONSTANT.LANG.English) {
if (lang.split('-')[0] == CHK_CONSTANT.LANG.English) {
lang = CHK_CONSTANT.LANG.ENGLISH;
} else if (lang.split("-")[0] == CHK_CONSTANT.LANG.KOREA) {
} else if (lang.split('-')[0] == CHK_CONSTANT.LANG.KOREA) {
lang = CHK_CONSTANT.LANG.KOREA;
} else {
lang =CHK_CONSTANT.LANG.JAPAN;
lang = CHK_CONSTANT.LANG.JAPAN;
}
CHK_Common.lang = lang;
}
CHK_Common.lang = lang;
};
/**
* get lang in local storage
*
*
* @returns String pageLang
*/
CHK_Common.getLangWeb = function() {
if (!CHK_Common.lang) {
let pageLang;
CHK_Common.getLangWeb = function () {
if (!CHK_Common.lang) {
let pageLang;
if (localStorage[CHK_CONSTANT.LANG.SAVE_NAME]) {
pageLang = localStorage[CHK_CONSTANT.LANG.SAVE_NAME];
}
else {
pageLang = (window.navigator.languages && window.navigator.languages[0]) ||
window.navigator.language ||
window.navigator.userLanguage ||
window.navigator.browserLanguage;
localStorage[CHK_CONSTANT.LANG.SAVE_NAME] = pageLang;
}
return pageLang;
} else {
return CHK_Common.lang;
}
return pageLang;
}
} else {
pageLang = (window.navigator.languages && window.navigator.languages[0]) || window.navigator.language || window.navigator.userLanguage || window.navigator.browserLanguage;
localStorage[CHK_CONSTANT.LANG.SAVE_NAME] = pageLang;
}
return pageLang;
} else {
return CHK_Common.lang;
}
return pageLang;
};
/**
* change lang of html
* change lang of html
*/
CHK_Common.updateLang = function() {
$(".multi-lang").each(function () {
const key = $(this).attr("data-msg");
if (key) {
if ($(this).prop("tagName").toLowerCase() == "input" && ($(this).attr("type") == "text" || $(this).attr("type") == "search")) {
CHK_Common.updateLang = function () {
$('.multi-lang').each(function () {
const key = $(this).attr('data-msg');
if (key) {
if ($(this).prop('tagName').toLowerCase() == 'input' && ($(this).attr('type') == 'text' || $(this).attr('type') == 'search')) {
const attr = $(this).attr('placeholder');
if (typeof attr !== 'undefined' && attr !== false) {
$(this).attr("placeholder", CHK_Common.getMsg(key));
} else {
if (typeof attr !== 'undefined' && attr !== false) {
$(this).attr('placeholder', CHK_Common.getMsg(key));
} else {
$(this).val(CHK_Common.getMsg(key));
}
} else {
}
} else {
$(this).html(CHK_Common.getMsg(key));
}
}
});
}
}
}
});
};
/**
* get any lang msg from CHK_Common.msgMap
*
* @param String key
*
* @param String key
* @returns String msg
*/
CHK_Common.getMsg = function (key) {
const msg = CHK_CONSTANT.MSG_MAP[key];
if (!msg) {
return "";
return '';
}
return msg[CHK_Common.lang];
}
};
/**
* show loading dialog
* show msg by key
*
* @param {String} key
*
* @param {String} key
*/
CHK_Common.showLoading = function() {
$("#check_loading").dialog({
dialogClass: 'noTitleDialog ui-dialog-titlebar dialogNoBorder',
autoOpen: false,
resizable: false,
modal: true,
width: "100%",
title: ' ',
open: function(e) {
$('.loadingAnime .loadingBall').css('animation-play-state','');
$(e.target).parent().css('background-color', 'rgba(128,128,128)');
$(e.target).parent().css('position', 'absolute');
$(e.target).parent().css('left', '50%');
$(e.target).parent().css('top', '25vh');
$(e.target).parent().css('transform', 'translateX(-50%)');
$(e.target).parent().css('-webkit- transform', 'translateY(-50%) translateX(-50%)');
$(e.target).parent().children(".ui-dialog-buttonpane").css('background-color', 'rgba(128,128,128)').css('border', 'none');
},
close: function() {}
});
CHK_Common.showLoading = function () {
$('#check_loading').dialog({
dialogClass: 'noTitleDialog ui-dialog-titlebar dialogNoBorder', //cssを追加する必要がある
autoOpen: false,
resizable: false,
modal: true,
width: '100%',
title: ' ',
open: function (e) {
$(e.target).parent().css('background-color', 'rgba(128,128,128)');
$(e.target).parent().css('position', 'absolute');
$(e.target).parent().css('left', '50%');
$(e.target).parent().css('top', '25vh');
$(e.target).parent().css('transform', 'translateX(-50%)');
$(e.target).parent().css('-webkit- transform', 'translateY(-50%) translateX(-50%)');
$(e.target).parent().children('.ui-dialog-buttonpane').css('background-color', 'rgba(128,128,128)').css('border', 'none');
},
close: function () {},
});
$("#check_loading").dialog('open');
}
$('#check_loading').dialog('open');
};
/**
* close loading
* close loading
*/
CHK_Common.closeLoading = function() {
if ($("#check_loading").hasClass("ui-dialog-content")) {
$("#check_loading").dialog('close');
$('.loadingAnime .loadingBall').css('animation-play-state','paused');
}
}
CHK_Common.closeLoading = function () {
if ($('#check_loading').hasClass('ui-dialog-content')) {
$('#check_loading').dialog('close');
}
};
/**
* show alert
*
* @param {String} msgCode
*/
CHK_Common.displayAlert = function(msgCode) {
$("#alertMsg").html(CHK_Common.getMsg(msgCode));
$(".alert-overlay").removeClass("d-none");
$(".alert-area").removeClass("d-none");
const positionY = $(document).scrollTop() + screen.height/8;
const height = screen.height/4;
$(".alert-overlay").css("height", screen.height);
$(".alert-area").css("top", positionY);
$(".alert-area").css("min-height", height);
$("body").css("overflow", "hidden");
}
/**
* close alert
*
* @param {String} msgCode
*/
CHK_Common.alertClose = function() {
$(".alert-overlay").addClass("d-none");
$(".alert-area").addClass("d-none");
$("body").css("overflow", "visible");
}
CHK_Common.displayAlert = function (msgCode, title) {
$('#alertMsg').html(CHK_Common.getMsg(msgCode));
$('.alert-overlay').removeClass('d-none');
$('.alert-area').removeClass('d-none');
/**
* send ABookCheck
*
* @param {json} param
* @param {boolean} async
* @param {Object} callback
* @param {Object} errorCallback
*/
CHK_Common.sendABookCheckApi = function(param, async = true, callback, errorCallback) {
const url = CHK_Common.getUrlWeb(param.cmd);
CHK_Common.cmsAjax(url, param, async, callback, errorCallback);
}
const positionY = $(document).scrollTop() + screen.height / 8;
const height = screen.height / 4;
$('.alert-overlay').css('height', screen.height);
$('.alert-area').css('top', positionY);
$('.alert-area').css('min-height', height);
$('body').css('overflow', 'hidden');
};
/**
* get URL for CMS action
* @param {String} method
* close alert
*/
CHK_Common.getUrlWeb = function(method) {
for (let i in CHK_CONSTANT.CMS_WEB) {
if (CHK_CONSTANT.CMS_WEB[i].includes(method)) {
return "https://" + location.host + "/checkapi/web/" + CHK_CONSTANT.CMS_WEB[i] + "/" + method;
}
}
return null;
}
CHK_Common.alertClose = function () {
$('.alert-overlay').addClass('d-none');
$('.alert-area').addClass('d-none');
$('body').css('overflow', 'visible');
};
/**
* go Url page With Current Params
*
*
* ios will remove all web types data when reopen webview
* need add common parameters: app, lang, debug, mobile_flg, isChat, ...
*
*
* @param {String} url
* @param {Object} params
*/
CHK_Common.goUrlWithCurrentParams = function(url, params) {
const webUrl = 'abvw/html/';
if (!params) {
location.href = webUrl + url;
}
CHK_Common.goUrlWithCurrentParams = function (url, params) {
if (!params) {
location.href = CHK_CONSTANT.URL.BASE_WEB + url;
}
const mixParams = Object.assign(CHK_Common.getUrlParameter(), params);
if (url.includes("?")) {
location.href = url + '&' + new URLSearchParams(mixParams);
} else {
location.href = url + '?' + new URLSearchParams(mixParams);
}
}
const mixParams = Object.assign(CHK_Common.getUrlParameter(), params);
if (url.includes('?')) {
location.href = url + '&' + new URLSearchParams(mixParams);
} else {
location.href = url + '?' + new URLSearchParams(mixParams);
}
};
/**
* get url parameter
*
*/
CHK_Common.getUrlParameter = function() {
var ret = {};
if (location.search) {
var param = {};
location.search.substring(1).split('&').forEach(function(val) {
var kv = val.split('=');
param[kv[0]] = kv[1];
});
ret = param;
}
console.log({ret: ret});
return ret;
}
CHK_Common.getUrlParameter = function () {
var ret = {};
if (location.search) {
var param = {};
location.search
.substring(1)
.split('&')
.forEach(function (val) {
var kv = val.split('=');
param[kv[0]] = kv[1];
});
ret = param;
}
console.log({ ret: ret });
return ret;
};
/**
* get sid in local Storage
*
*
* @returns sid
*/
CHK_Common.getSid = function() {
return "sid";
}
CHK_Common.getSid = function () {
return 'sid';
};
/**
* cms communication
*
* @param {String} url
* @param {Json} param
* @param {boolean} async
*
* @param {String} url
* @param {Json} param
* @param {boolean} async
* @param {Object} callback
* @param {Object} errorCallback
*/
CHK_Common.cmsAjax = function(url, param, async = true, callback, errorCallback) {
if (url) {
$.ajax({
type: "POST",
url: url,
data: param,
dataType:"json",
cache: false,
async: async,
success: function(result) {
if (result.status == "200") {
if(callback) callback(result);
} else if (result.status == "401") {
CHK_Common.goUrlWithCurrentParams(CHK_CONSTANT.PAGE_NAME.LOGIN);
} else if(errorCallback) {
errorCallback();
} else {
CHK_Common.closeLoading();
CHK_Common.displayAlert(result.message);
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
//if(errorCallback) {
//errorCallback();
//} else {
CHK_Common.closeLoading();
CHK_Common.displayAlert("errorCommunicationFailed");
//}
}
});
} else {
if(errorCallback) {
errorCallback();
} else {
CHK_Common.closeLoading();
CHK_Common.displayAlert("errorOccurred");
}
}
}
CHK_Common.cmsAjax = function (url, param, async = true, callback, errorCallback) {
if (url) {
$.ajax({
type: 'POST',
url: url,
data: param,
dataType: 'json',
cache: false,
async: async,
success: function (result) {
if (result.status == '200') {
if (callback) callback(result);
} else if (result.status == '401') {
CHK_Common.goUrlWithCurrentParams(CHK_CONSTANT.PAGE_NAME.LOGIN);
} else if (errorCallback) {
errorCallback();
} else {
CHK_Common.closeLoading();
CHK_Common.displayAlert(result.message);
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
if (errorCallback) {
errorCallback();
} else {
CHK_Common.closeLoading();
CHK_Common.displayAlert('errorCommunicationFailed');
}
},
});
} else {
if (errorCallback) {
errorCallback();
} else {
CHK_Common.closeLoading();
CHK_Common.displayAlert('errorOccurred');
}
}
};
/**
* Communicate with cms and post
*
* @param {String} url
* @param {Object} params
* @param {String} method
*
* @param {String} url
* @param {Object} params
* @param {String} method
*/
CHK_Common.postCommunication = function(url, params, method='post') {
const form = document.createElement('form');
form.method = method;
form.action = url;
CHK_Common.postCommunication = function (url, params, method = 'post') {
const form = document.createElement('form');
form.method = method;
form.action = url;
for (const key in params) {
if (params.hasOwnProperty(key)) {
const hiddenField = document.createElement('input');
hiddenField.type = 'hidden';
hiddenField.name = key;
hiddenField.value = params[key];
form.appendChild(hiddenField);
}
}
for (const key in params) {
if (params.hasOwnProperty(key)) {
const hiddenField = document.createElement('input');
hiddenField.type = 'hidden';
hiddenField.name = key;
hiddenField.value = params[key];
form.appendChild(hiddenField);
}
}
document.body.appendChild(form);
form.submit();
document.body.appendChild(form);
form.submit();
};
/**
* Check if user is logged in
*
* @param {boolean} async
*
* @param {boolean} async
*/
CHK_Common.checkAuth = function(async = true) {
let params ={};
CHK_Common.checkAuth = function (async = true) {
let params = {};
params.sid = CHK_Common.getSid;
params.cmd = CHK_CONSTANT.ACT_CMD.checkSession;
CHK_Common.sendABookCheckApi(params, async, null, function() {
CHK_Common.goUrlWithCurrentParams(CHK_CONSTANT.PAGE_NAME.LOGIN);
});
}
\ No newline at end of file
CHK_Common.sendABookCheckApi(params, async, null, function () {
CHK_Common.goUrlWithCurrentParams(CHK_CONSTANT.PAGE_NAME.LOGIN);
});
};
/**
* constant js
*
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*
* @since 1.4.3.2 & 1.4.3.3
*/
const CHK_CONSTANT = {};
CHK_CONSTANT.SORT_TYPE = {
NAME: 0,
START_DATE_DESC: 1,
START_DATE_ASC: 2,
TYPE: 3,
LAST_EDIT_DATE: 4,
NAME: 0,
START_DATE_DESC: 1,
START_DATE_ASC: 2,
TYPE: 3,
LAST_EDIT_DATE: 4,
};
CHK_CONSTANT.PAGE_NAME = {
DASHBOARD: "dashboard",
OPERATION_LIST: "operationList",
FOOTER: "main-footer.html",
DEFAULT: "index.html",
LOGIN: "login.html"
}
DASHBOARD: 'dashboard',
OPERATION_LIST: 'operationList',
FOOTER: 'main-footer.html',
DEFAULT: 'index.html',
LOGIN: 'login.html',
};
CHK_CONSTANT.PAGE_TAB = {
DASHBOARD: "dashboard",
OPERATION_LIST: "operationList"
}
DASHBOARD: 'dashboard',
OPERATION_LIST: 'operationList',
};
CHK_CONSTANT.OPERATION_TYPE = {
LIST: "0",
DRAWING: "1",
VTOUR: "2",
PDF: "3"
LIST: '0',
DRAWING: '1',
VTOUR: '2',
PDF: '3',
};
CHK_CONSTANT.REPORT_TYPE = {
REPORTONLY: "0",
INSPECT: "1",
WITHREPLY: "2",
WORKFLOW: "3"
}
REPORTONLY: '0',
INSPECT: '1',
WITHREPLY: '2',
WORKFLOW: '3',
};
CHK_CONSTANT.ADD_REPORT_FLG = {
UNABLE: "0",
ABLE: "1"
}
//Command for sending CMS.
//must match the value (method name).
CHK_CONSTANT.ACT_CMD = {
getOperationList: "getOperationList",
goOperation: "redirectOperationPage",
checkSession: "checkAuthUser",
saveOperationLog: "saveOperationLog"
UNABLE: '0',
ABLE: '1',
};
//method name corresponding to the command.
//Disallow duplicate method names.
CHK_CONSTANT.CMS_WEB = {
OperationListWeb: ["getOperationList"],
BranchOperation: ["redirectOperationPage"],
GetSession: ["checkAuthUser"],
OperationLogWeb:["saveOperationLog"]
CHK_CONSTANT.URL = {
BASE_CMS: 'https://' + location.host + '/checkapi/web/',
BASE_WEB: 'abvw/html/',
ALL_OPERATION_LIST: 'operationLIstWeb/getOperationList',
};
CHK_CONSTANT.LANG = {
SAVE_NAME: "lang",
JAPAN: "ja",
KOREA: "ko",
ENGLISH: "en"
}
SAVE_NAME: 'lang',
JAPAN: 'ja',
KOREA: 'ko',
ENGLISH: 'en',
};
CHK_CONSTANT.MSG_MAP = {
all:{ja:"全て", ko:"전체", en:"All"},
dateError: { ja: "開始日は終了日の前に設定してください。", ko: "잘못된 검색일입니다.", en: "Please enter correct search date." },
operationListTitle:{ ja: "トップページ|A Book Check", ko: "톱 페이지|A Book Check", en: "Top Page|A Book Check" },
buttonCategory: { ja: "カテゴリー", ko: "카테고리", en: "Category" },
buttonRefresh: { ja: "更新", ko: "갱신", en: "Refresh" },
buttonBack: { ja: "戻る", ko: "Back", en: "Back" },
placeholderOperationName: { ja: "作業名", ko: "작업명", en: "Working Name" },
labelPeriod: { ja: "期間", ko: "기간", en: "Period" },
labelStartDate: { ja: "開始日", ko: "시작일", en: "Start date" },
labelEndDate: { ja: "終了日", ko: "종료일", en: "End date" },
placeholderSelect: { ja: "選択", ko: "선택", en: "Choice" },
labelSort: { ja: "並び替え", ko: "정렬", en: "Sort" },
labelSortName: { ja: "作業名順", ko: "작업명순", en: "By working name" },
labelSortNew: { ja: "作業期間が新しい順", ko: "작업기간이 최신순", en: "By newest period" },
labelSortOld: { ja: "作業期間が古い順", ko: "작업기간이 오래된순", en: "By oldest period" },
labelSortOpen: { ja: "閲覧日が新しい順", ko: "열람순", en: "By newest viewing date" },
labelReset: { ja: "クリア", ko: "클리어", en: "Clear" },
headerItemName: { ja: "作業名", ko: "작업명", en: "Working Name" },
headerStartDate: { ja: "開始日", ko: "시작일", en: "Start date" },
headerEndDate: { ja: "終了日", ko: "종료일", en: "End date" },
buttonHome: { ja: "ホーム", ko: "홈", en: "Home" },
buttonSetting: { ja: "設定", ko: "설정", en: "Setting" },
buttonOperationList: { ja: "作業一覧", ko: "작업일람", en: "Operations List" },
operationListHeaderTitle: { ja: "作業一覧", ko: "작업일람", en: "Operations List" },
buttonDashboard: { ja: "ダッシュボード", ko: "대시보드", en: "Dashboard" },
buttonDashboardSetting: { ja: "設定", ko: "설정", en: "Setting" },
Processing_w_dot: { ja: "処理中...", ko: "처리중", en: "Processing..." },
errorCommunicationFailed: { ja: "通信エラーが発生しました", ko: "통신 오류가 발생했습니다", en: "A communication error has occurred" },
errorOccurred: { ja: "エラーが発生しました", ko: "오류가 발생했습니다", en: "Error Occurred" }
};
\ No newline at end of file
all: { ja: '全て', ko: '전체', en: 'All' },
dateError: { ja: '開始日は終了日の前に設定してください。', ko: '잘못된 검색일입니다.', en: 'Please enter correct search date.' },
operationListTitle: { ja: 'トップページ|A Book Check', ko: '톱 페이지|A Book Check', en: 'Top Page|A Book Check' },
buttonCategory: { ja: 'カテゴリー', ko: '카테고리', en: 'Category' },
buttonRefresh: { ja: '更新', ko: '갱신', en: 'Refresh' },
buttonBack: { ja: '戻る', ko: 'Back', en: 'Back' },
placeholderOperationName: { ja: '作業名', ko: '작업명', en: 'Working Name' },
labelPeriod: { ja: '期間', ko: '기간', en: 'Period' },
labelStartDate: { ja: '開始日', ko: '시작일', en: 'Start date' },
labelEndDate: { ja: '終了日', ko: '종료일', en: 'End date' },
placeholderSelect: { ja: '選択', ko: '선택', en: 'Choice' },
labelSort: { ja: '並び替え', ko: '정렬', en: 'Sort' },
labelSortName: { ja: '作業名順', ko: '작업명순', en: 'By working name' },
labelSortNew: { ja: '作業期間が新しい順', ko: '작업기간이 최신순', en: 'By newest period' },
labelSortOld: { ja: '作業期間が古い順', ko: '작업기간이 오래된순', en: 'By oldest period' },
labelSortOpen: { ja: '閲覧日が新しい順', ko: '열람순', en: 'By newest viewing date' },
labelReset: { ja: 'クリア', ko: '클리어', en: 'Clear' },
headerItemName: { ja: '作業名', ko: '작업명', en: 'Working Name' },
headerStartDate: { ja: '開始日', ko: '시작일', en: 'Start date' },
headerEndDate: { ja: '終了日', ko: '종료일', en: 'End date' },
buttonHome: { ja: 'ホーム', ko: '홈', en: 'Home' },
buttonSetting: { ja: '設定', ko: '설정', en: 'Setting' },
buttonOperationList: { ja: '作業一覧', ko: '작업일람', en: 'Operations List' },
operationListHeaderTitle: { ja: '作業一覧', ko: '작업일람', en: 'Operations List' },
buttonDashboard: { ja: 'ダッシュボード', ko: '대시보드', en: 'Dashboard' },
buttonDashboardSetting: { ja: '設定', ko: '설정', en: 'Setting' },
Processing_w_dot: { ja: '処理中...', ko: '처리중', en: 'Processing...' },
errorCommunicationFailed: { ja: '通信エラーが発生しました', ko: '통신 오류가 발생했습니다', en: 'A communication error has occurred' },
errorOccurred: { ja: 'エラーが発生しました', ko: '오류가 발생했습니다', en: 'Error Occurred' },
};
......@@ -48,9 +48,9 @@
<section class="category-menu">
<div id="overlayDiv" class="overlay"></div>
<nav id="category-menu" class="drawer-menu">
<div class="d-flex justify-content-between border-bottom">
<h2 class="text-nowrap font-weight-bold fs-13 p-3 mb-0 multi-lang" data-msg="buttonCategory"></h2>
<a class="category-btn p-3" onclick="CHK_OL.openCategory();" href="#"><i class="fa fa-times"></i></a>
<div class="d-flex justifyfont-weight-bold fs-13 p-3 mb-0 multi-lang" data-msg="buttonCategory"></h2>
<a class="category-content-between border-bottom">
<h2 class="text-nowrap -btn p-3" onclick="CHK_OL.openCategory();" href="#"><i class="fa fa-times"></i></a>
</div>
</nav>
</section>
......
/**
* It is one of the js in index.html.
* It is one of the js in index.html.
* index.html is made of operations List , dashboard and topPage.
*
*
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var CHK_OL = {};
CHK_OL.operationList; //Operation json data
CHK_OL.operationGroupMaster; //category(operationGroupMaster) json data
CHK_OL.isOperationGroupMaster = 0;//0: category(operationGroupMaster) not exist 1: category(operationGroupMaster) exist
CHK_OL.operationList; //Operation json data
CHK_OL.operationGroupMaster; //category(operationGroupMaster) json data
CHK_OL.isOperationGroupMaster = 0; //0: category(operationGroupMaster) not exist 1: category(operationGroupMaster) exist
CHK_OL.operationSearchCriteria;
CHK_OL.sortIndex;
......@@ -21,413 +21,437 @@ CHK_OL.operationGroupMasterId;
* 2.show operationList.
* 3.show category(operationGroupMaster).
*/
CHK_OL.init = function() {
console.log("OperationList start");
//get all data of operation list scene
CHK_OL.getAllDataWeb();
//show operation list
CHK_OL.createOperationList(CHK_OL.operationList);
//show category(operationGroupMaster)
CHK_OL.createCategory();
}
CHK_OL.init = function () {
console.log('OperationList start');
//get all data of operation list scene
CHK_OL.getAllDataWeb();
//show operation list
CHK_OL.createOperationList(CHK_OL.operationList);
//show category(operationGroupMaster)
CHK_OL.createCategory();
};
/**
* get operation list all data
* 1.operation list
* 2.category(operationGroupMaster) list
*
*
* @param {String} searchKeyword
* @param {Number} sortIndex
* @param {String} searchStartDate
* @param {String} searchEndDate
* @param {Number} operationGroupMasterId
*/
CHK_OL.getAllDataWeb = function(searchKeyword, sortIndex, searchStartDate, searchEndDate, operationGroupMasterId) {
let param = {};
param.cmd = CHK_CONSTANT.ACT_CMD.getOperationList;
param.sid = CHK_Common.getSid();
param.operationGroupMasterId = searchKeyword;
param.sort = sortIndex;
param.startDate = searchStartDate;
param.endDate = searchEndDate;
param.operationGroupMasterId = operationGroupMasterId;
CHK_Common.sendABookCheckApi(param, false, function(json) {
CHK_OL.operationList = json.operationList;
CHK_OL.operationGroupMaster = json.operationGroupMasterList;
CHK_OL.isOperationGroupMaster = json.isOperationGroupMaster;
CHK_OL.operationSearchCriteria = json.operationSearchCriteria;
CHK_OL.setSearchInfoWeb();
console.log("json.operationList", JSON.stringify(json.operationList));
});
}
CHK_OL.getAllDataWeb = function (searchKeyword, sortIndex, searchStartDate, searchEndDate, operationGroupMasterId) {
let param = {};
param.cmd = CHK_CONSTANT.ACT_CMD.getOperationList;
param.sid = CHK_Common.getSid();
param.operationGroupMasterId = searchKeyword;
param.sort = sortIndex;
param.startDate = searchStartDate;
param.endDate = searchEndDate;
param.operationGroupMasterId = operationGroupMasterId;
const url = CHK_CONSTANT.URL.BASE_CMS + ALL_OPERATION_LIST;
CHK_Common.cmsAjax(url, param, false, function (json) {
CHK_OL.operationList = json.operationList;
CHK_OL.operationGroupMaster = json.operationGroupMasterList;
CHK_OL.isOperationGroupMaster = json.isOperationGroupMaster;
CHK_OL.operationSearchCriteria = json.operationSearchCriteria;
CHK_OL.setSearchInfoWeb();
console.log('json.operationList', JSON.stringify(json.operationList));
});
};
/**
* set search criteria when Initial display.
*/
CHK_OL.setSearchInfoWeb = function() {
CHK_OL.sortIndex = CHK_OL.operationSearchCriteria.sort;
$("#searchTaskName").val(CHK_OL.operationSearchCriteria.operationName);
$("#searchStartDate").val(CHK_OL.operationSearchCriteria.startDate);
$("#searchEndDate").val(CHK_OL.operationSearchCriteria.endDate);
CHK_OL.setSearchInfoWeb = function () {
CHK_OL.sortIndex = CHK_OL.operationSearchCriteria.sort;
$('#searchTaskName').val(CHK_OL.operationSearchCriteria.operationName);
$('#searchStartDate').val(CHK_OL.operationSearchCriteria.startDate);
$('#searchEndDate').val(CHK_OL.operationSearchCriteria.endDate);
CHK_OL.operationGroupMasterId = CHK_OL.operationSearchCriteria.operationGroupMasterId;
}
};
/**
* create operation list
*/
CHK_OL.createOperationList = function(operationList) {
//Initialization
CHK_OL.initActiveSortIndex();
CHK_OL.createOperationList = function (operationList) {
//Initialization
CHK_OL.initActiveSortIndex();
$('#operationTable').empty();
if (!operationList) {
return;
}
if (!operationList) {
return;
}
//create & show
//create & show
for (let i = 0; i < operationList.length; i++) {
let operationTR = $("<tr/>");
const operationNameTd = $("<td class='operationId_" + operationList[i].operationId
+ "'><a href=\"javascript:CHK_OL.sendOperation('goOperation', '"
+ operationList[i].operationId + "', '" + operationList[i].operationType+ "', '" + operationList[i].reportType + "');\" class='d-block text-black text-decoration-none mb-1'>" + operationList[i].operationName
+ "</a><div class='fa-sm mobile_operation_date'><i class='far fa-clock fa-blue' style='color:blue;margin-right:10px'></i>"
+ CHK_OL.setOperationDate(operationList[i].operationStartDate) + " ~ "
+ CHK_OL.setOperationDate(operationList[i].operationEndDate) +"</div></td>");
const operationStartDateTd = $("<td/>", {class: "operationStartDate"}).text(CHK_OL.setOperationDate(operationList[i].operationStartDate));
const operationEndDateTd = $("<td/>", {class: "operationEndDate"}).text(CHK_OL.setOperationDate(operationList[i].operationEndDate));
operationTR.append(operationNameTd);
let operationTR = $('<tr/>');
const operationNameTd = $(
"<td class='operationId_" +
operationList[i].operationId +
"'><a href=\"javascript:CHK_OL.sendOperation('goOperation', '" +
operationList[i].operationId +
"', '" +
operationList[i].operationType +
"', '" +
operationList[i].reportType +
"');\" class='d-block text-black text-decoration-none mb-1'>" +
operationList[i].operationName +
"</a><div class='fa-sm mobile_operation_date'><i class='far fa-clock fa-blue' style='color:blue;margin-right:10px'></i>" +
CHK_OL.setOperationDate(operationList[i].operationStartDate) +
' ~ ' +
CHK_OL.setOperationDate(operationList[i].operationEndDate) +
'</div></td>',
);
const operationStartDateTd = $('<td/>', { class: 'operationStartDate' }).text(CHK_OL.setOperationDate(operationList[i].operationStartDate));
const operationEndDateTd = $('<td/>', { class: 'operationEndDate' }).text(CHK_OL.setOperationDate(operationList[i].operationEndDate));
operationTR.append(operationNameTd);
operationTR.append(operationStartDateTd);
operationTR.append(operationEndDateTd);
$(".table tbody").append(operationTR);
}
$('.table tbody').append(operationTR);
}
};
/**
* add color to any sorting type when sortIndex exsist
*
* @param {Number} sortIndex
*
* @param {Number} sortIndex
*/
CHK_OL.initActiveSortIndex = function(sortIndex) {
if (!sortIndex && !CHK_OL.sortIndex) {
CHK_OL.initActiveSortIndex = function (sortIndex) {
if (!sortIndex && !CHK_OL.sortIndex) {
CHK_OL.sortIndex = CHK_CONSTANT.SORT_TYPE.START_DATE_DESC;
}
$(".sort-type").each(function() {
const sortType = $(this).data("sort");
if (sortType == CHK_OL.sortIndex) {
$(".sort-type").removeClass("active");
$(this).addClass("active");
}
});
}
}
$('.sort-type').each(function () {
const sortType = $(this).data('sort');
if (sortType == CHK_OL.sortIndex) {
$('.sort-type').removeClass('active');
$(this).addClass('active');
}
});
};
/**
* set date for OperationList
*
* @param {String} date
*
* @param {String} date
* @returns operationDate
*/
CHK_OL.setOperationDate = function(date) {
const operationDate = date.replace(/-/g, "/").substring(0,10);
return operationDate;
CHK_OL.setOperationDate = function (date) {
const operationDate = date.replace(/-/g, '/').substring(0, 10);
return operationDate;
};
/**
* create category(operationGroupMaster).
*/
CHK_OL.createCategory = function() {
if (!CHK_OL.isOperationGroupMaster) {
return;
}
CHK_OL.initCategory();
CHK_OL.createBreadcrumbList();
CHK_OL.createCategoryList();
CHK_OL.acdMenu();
CHK_OL.createCategory = function () {
if (!CHK_OL.isOperationGroupMaster) {
return;
}
CHK_OL.initCategory();
CHK_OL.createBreadcrumbList();
CHK_OL.createCategoryList();
CHK_OL.acdMenu();
};
/**
* Initial processing of category(operationGroupMaster).
*/
CHK_OL.initCategory = function() {
if (!CHK_OL.isOperationGroupMaster) {
return;
}
CHK_OL.initCategory = function () {
if (!CHK_OL.isOperationGroupMaster) {
return;
}
$("#operationGroupMasterButton").removeClass("d-none");
$(window).resize(function() {
CHK_OL.setCategoryHeight();
});
}
$('#operationGroupMasterButton').removeClass('d-none');
$(window).resize(function () {
CHK_OL.setCategoryHeight();
});
};
/**
* change height category(operationGroupMaster)
*/
CHK_OL.setCategoryHeight = function() {
const CATEGORY_HEIGHT = $('footer').offset().top - $('#category-menu').offset().top;
console.log(CATEGORY_HEIGHT);
$("#category-menu").css("overflow", "scroll");
$('#category-menu').height(CATEGORY_HEIGHT);
$('#overlayDiv').height(CATEGORY_HEIGHT);
}
CHK_OL.setCategoryHeight = function () {
const CATEGORY_HEIGHT = $('footer').offset().top - $('#category-menu').offset().top;
console.log(CATEGORY_HEIGHT);
$('#category-menu').css('overflow', 'scroll');
$('#category-menu').height(CATEGORY_HEIGHT);
$('#overlayDiv').height(CATEGORY_HEIGHT);
};
/**
* create Breadcrumb List
*/
CHK_OL.createBreadcrumbList = function() {
CHK_OL.createBreadcrumbList = function () {
if (!CHK_OL.isOperationGroupMaster) {
return;
}
if (!CHK_OL.isOperationGroupMaster) {
return;
}
$("#groupMasterPath").empty();
$('#groupMasterPath').empty();
if (typeof CHK_OL.operationGroupMasterId == 'undefined' || CHK_OL.operationGroupMasterId == 0) {
$("#groupMasterPath").append('<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">' + CHK_Common.getMsg("all") + '</a></li>');
$('#groupMasterPath').append('<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">' + CHK_Common.getMsg('all') + '</a></li>');
} else {
const groupMaster = CHK_OL.operationGroupMaster.filter(it => it.operationGroupMasterId == CHK_OL.operationGroupMasterId)[0];
const groupMasterPathIdlist = groupMaster.treePath.split('/');
groupMasterPathIdlist.forEach( function (parentId){
const pathOperationGroupMaster = CHK_OL.operationGroupMaster.filter(it => it.operationGroupMasterId == parentId)[0];
$("#groupMasterPath").append('<li class="breadcrumb-item"><a onclick="CHK_OL.changeOperationGroupMaster('
+ pathOperationGroupMaster.operationGroupMasterId + ');" class="text-decoration-none text-dark">'
+ pathOperationGroupMaster.operationGroupMasterName + '</a></li>');
groupMasterPathIdlist.forEach(function (parentId) {
const pathOperationGroupMaster = CHK_OL.operationGroupMaster.filter(it => it.operationGroupMasterId == parentId)[0];
$('#groupMasterPath').append(
'<li class="breadcrumb-item"><a onclick="CHK_OL.changeOperationGroupMaster(' +
pathOperationGroupMaster.operationGroupMasterId +
');" class="text-decoration-none text-dark">' +
pathOperationGroupMaster.operationGroupMasterName +
'</a></li>',
);
});
}
}
};
/**
* create category(operationGroupMaster) structure
*/
CHK_OL.createCategoryList = function() {
if (!CHK_OL.isOperationGroupMaster) {
return;
}
//Create a side menu category structure
$('.group-category-list').remove();
CHK_OL.operationGroupMaster.sort(function(a, b) {
if (a.operationGroupMasterLevel < b.operationGroupMasterLevel) return -1;
if (a.operationGroupMasterLevel > b.operationGroupMasterLevel) return 1;
return 1;
});
//common
const noCategory = $("<dl id='groupMasterId_0' class='group-category-list'><dt><a onclick='CHK_OL.changeOperationGroupMaster(0);'>"+ CHK_Common.getMsg(CHK_CONSTANT.MSG_MAP.all) + "</a></dt></dl>");
$('#category-menu').append(noCategory);
//create category(operationGroupMaster) structure
for (let i = 0; i < CHK_OL.operationGroupMaster.length; i++) {
if (CHK_OL.operationGroupMaster[i].operationGroupMasterLevel == 0 ){
const categoryParent = $("<dl id=groupMasterId_" + CHK_OL.operationGroupMaster[i].operationGroupMasterId
+ " class='group-category-list' style='overflow-x:auto;'><dt class='menu-ttl'><a onclick='CHK_OL.changeOperationGroupMaster("
+ CHK_OL.operationGroupMaster[i].operationGroupMasterId + ");'>" + CHK_OL.operationGroupMaster[i].operationGroupMasterName
+ "</a></dt></dl>");
CHK_OL.createCategoryList = function () {
if (!CHK_OL.isOperationGroupMaster) {
return;
}
//Create a side menu category structure
$('.group-category-list').remove();
CHK_OL.operationGroupMaster.sort(function (a, b) {
if (a.operationGroupMasterLevel < b.operationGroupMasterLevel) return -1;
if (a.operationGroupMasterLevel > b.operationGroupMasterLevel) return 1;
return 1;
});
//common
const noCategory = $(
"<dl id='groupMasterId_0' class='group-category-list'><dt><a onclick='CHK_OL.changeOperationGroupMaster(0);'>" + CHK_Common.getMsg(CHK_CONSTANT.MSG_MAP.all) + '</a></dt></dl>',
);
$('#category-menu').append(noCategory);
//create category(operationGroupMaster) structure
for (let i = 0; i < CHK_OL.operationGroupMaster.length; i++) {
if (CHK_OL.operationGroupMaster[i].operationGroupMasterLevel == 0) {
const categoryParent = $(
'<dl id=groupMasterId_' +
CHK_OL.operationGroupMaster[i].operationGroupMasterId +
" class='group-category-list' style='overflow-x:auto;'><dt class='menu-ttl'><a onclick='CHK_OL.changeOperationGroupMaster(" +
CHK_OL.operationGroupMaster[i].operationGroupMasterId +
");'>" +
CHK_OL.operationGroupMaster[i].operationGroupMasterName +
'</a></dt></dl>',
);
$('#category-menu').append(categoryParent);
} else {
if ($('#groupMasterId_'+ CHK_OL.operationGroupMaster[i].parentOperationGroupMasterId + '>ul').length > 0){
const categoryChild = $("<li id='groupMasterId_" + CHK_OL.operationGroupMaster[i].operationGroupMasterId
+ "' class=''><p class='category-li group-level-" + CHK_OL.operationGroupMaster[i].operationGroupMasterLevel
+ "'><a class='category-a' onclick='CHK_OL.changeOperationGroupMaster("
+ CHK_OL.operationGroupMaster[i].operationGroupMasterId + ");'>" + CHK_OL.operationGroupMaster[i].operationGroupMasterName
+ "</a></p></li>");
$('#groupMasterId_' + CHK_OL.operationGroupMaster[i].parentOperationGroupMasterId + ' >ul').append(categoryChild);
} else {
const groupParents = '#groupMasterId_' + CHK_OL.operationGroupMaster[i].parentOperationGroupMasterId;
$(groupParents + " > p").addClass("sub-menu-ttl");
const categoryChild = $("<ul style='display:none;' class=''><li class='' id='groupMasterId_" + CHK_OL.operationGroupMaster[i].operationGroupMasterId
+ "' class=''><p class='category-li group-level-"
+ CHK_OL.operationGroupMaster[i].operationGroupMasterLevel
+ "'><a class='category-a' onclick='CHK_OL.changeOperationGroupMaster(" + CHK_OL.operationGroupMaster[i].operationGroupMasterId
+ ");'>" + CHK_OL.operationGroupMaster[i].operationGroupMasterName + "</a></p></li></ul>");
$('#groupMasterId_' + CHK_OL.operationGroupMaster[i].parentOperationGroupMasterId).append(categoryChild);
} else {
if ($('#groupMasterId_' + CHK_OL.operationGroupMaster[i].parentOperationGroupMasterId + '>ul').length > 0) {
const categoryChild = $(
"<li id='groupMasterId_" +
CHK_OL.operationGroupMaster[i].operationGroupMasterId +
"' class=''><p class='category-li group-level-" +
CHK_OL.operationGroupMaster[i].operationGroupMasterLevel +
"'><a class='category-a' onclick='CHK_OL.changeOperationGroupMaster(" +
CHK_OL.operationGroupMaster[i].operationGroupMasterId +
");'>" +
CHK_OL.operationGroupMaster[i].operationGroupMasterName +
'</a></p></li>',
);
$('#groupMasterId_' + CHK_OL.operationGroupMaster[i].parentOperationGroupMasterId + ' >ul').append(categoryChild);
} else {
const groupParents = '#groupMasterId_' + CHK_OL.operationGroupMaster[i].parentOperationGroupMasterId;
$(groupParents + ' > p').addClass('sub-menu-ttl');
const categoryChild = $(
"<ul style='display:none;' class=''><li class='' id='groupMasterId_" +
CHK_OL.operationGroupMaster[i].operationGroupMasterId +
"' class=''><p class='category-li group-level-" +
CHK_OL.operationGroupMaster[i].operationGroupMasterLevel +
"'><a class='category-a' onclick='CHK_OL.changeOperationGroupMaster(" +
CHK_OL.operationGroupMaster[i].operationGroupMasterId +
");'>" +
CHK_OL.operationGroupMaster[i].operationGroupMasterName +
'</a></p></li></ul>',
);
$('#groupMasterId_' + CHK_OL.operationGroupMaster[i].parentOperationGroupMasterId).append(categoryChild);
}
}
}
}
}
}
};
/**
* Open/close category(operationGroupMaster) drawer menu
*/
CHK_OL.acdMenu = function() {
//Hide accordion contents by default
$(".drawer-menu dd").css("display", "none");
$(".drawer-menu2 ul").css("display", "none");
CHK_OL.acdMenu = function () {
//Hide accordion contents by default
$('.drawer-menu dd').css('display', 'none');
$('.drawer-menu2 ul').css('display', 'none');
//second accordion
$(".drawer-menu dt").on('click', function() {
$(".sub-menu-ttl").removeClass("openAcd").next().slideUp("fast");
$(".drawer-menu dt").not(this).removeClass("open").next().slideUp("fast");
$(this).toggleClass("open").next().slideToggle("fast");
$('.drawer-menu dt').on('click', function () {
$('.sub-menu-ttl').removeClass('openAcd').next().slideUp('fast');
$('.drawer-menu dt').not(this).removeClass('open').next().slideUp('fast');
$(this).toggleClass('open').next().slideToggle('fast');
});
//third accordion
$(".sub-menu-ttl").on('click', function() {
$(".sub-menu-ttl").not($(this)).not($(this).parents().siblings("p")).removeClass("openAcd").next().slideUp("fast");
$(this).toggleClass("openAcd").next().slideToggle("fast");
$('.sub-menu-ttl').on('click', function () {
$('.sub-menu-ttl').not($(this)).not($(this).parents().siblings('p')).removeClass('openAcd').next().slideUp('fast');
$(this).toggleClass('openAcd').next().slideToggle('fast');
});
}
};
/**
* Sort the operationList by screen operation
*
* @param {Object} sortType
*
* @param {Object} sortType
*/
CHK_OL.changeSortType = function(sortType) {
$(".sort-type").removeClass("active");
$(sortType).addClass("active");
CHK_OL.sortIndex = $(sortType).attr("data-sort");
CHK_OL.sortOperationList(sortType);
CHK_OL.createOperationList(CHK_OL.operationList);
}
CHK_OL.changeSortType = function (sortType) {
$('.sort-type').removeClass('active');
$(sortType).addClass('active');
CHK_OL.sortIndex = $(sortType).attr('data-sort');
CHK_OL.sortOperationList(sortType);
CHK_OL.createOperationList(CHK_OL.operationList);
};
/**
* sort the operationList
*
* @param {Number} sortType
*
* @param {Number} sortType
*/
CHK_OL.sortOperationList = function(sortType) {
switch(sortType) {
case CHK_CONSTANT.SORT_TYPE.NAME:
CHK_OL.operationList.sort(function(a,b) {
if (a.operationName > b.operationName) return 1;
if (a.operationName < b.operationName) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_DESC:
CHK_OL.operationList.sort(function(a,b) {
if (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) return 1;
if (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_ASC:
CHK_OL.operationList.sort(function(a,b) {
if (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) return 1;
if (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.TYPE:
CHK_OL.operationList.sort(function(a,b) {
if (a.operationType < b.operationType) return 1;
if (a.operationType > b.operationType) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.LAST_EDIT_DATE:
const defaultDate = "1900-01-01 09:00:00";
CHK_OL.operationList.sort(function(a,b) {
if (!a.operationOpenDate) {
a.operationOpenDate = defaultDate;
}
if (!b.operationOpenDate) {
b.operationOpenDate = defaultDate;
}
if (a.operationOpenDate < b.operationOpenDate) return 1;
if (a.operationOpenDate > b.operationOpenDate) return -1;
return 0;
});
break;
}
}
CHK_OL.sortOperationList = function (sortType) {
switch (sortType) {
case CHK_CONSTANT.SORT_TYPE.NAME:
CHK_OL.operationList.sort(function (a, b) {
if (a.operationName > b.operationName) return 1;
if (a.operationName < b.operationName) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_DESC:
CHK_OL.operationList.sort(function (a, b) {
if (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) return 1;
if (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_ASC:
CHK_OL.operationList.sort(function (a, b) {
if (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) return 1;
if (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.TYPE:
CHK_OL.operationList.sort(function (a, b) {
if (a.operationType < b.operationType) return 1;
if (a.operationType > b.operationType) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.LAST_EDIT_DATE:
const defaultDate = '1900-01-01 09:00:00';
CHK_OL.operationList.sort(function (a, b) {
if (!a.operationOpenDate) {
a.operationOpenDate = defaultDate;
}
if (!b.operationOpenDate) {
b.operationOpenDate = defaultDate;
}
if (a.operationOpenDate < b.operationOpenDate) return 1;
if (a.operationOpenDate > b.operationOpenDate) return -1;
return 0;
});
break;
}
};
/**
* search operarionList
*/
CHK_OL.search = function() {
CHK_Common.showLoading();
const searchKeyword = $("#searchTaskName").val();
const searchStartDate = $("#searchStartDate").val();
const searchEndDate = $("#searchEndDate").val();
if((searchStartDate && searchEndDate) && (searchStartDate > searchEndDate)){
CHK_Common.closeLoading();
CHK_Common.displayAlert("dateError");
return;
}
CHK_OL.getAllDataWeb(searchKeyword, CHK_OL.sortIndex, searchStartDate, searchEndDate, CHK_OL.operationGroupMasterId);
CHK_OL.search = function () {
CHK_Common.showLoading();
const searchKeyword = $('#searchTaskName').val();
const searchStartDate = $('#searchStartDate').val();
const searchEndDate = $('#searchEndDate').val();
if (searchStartDate && searchEndDate && searchStartDate > searchEndDate) {
CHK_Common.closeLoading();
CHK_Common.displayAlert('dateError');
return;
}
CHK_OL.getAllDataWeb(searchKeyword, CHK_OL.sortIndex, searchStartDate, searchEndDate, CHK_OL.operationGroupMasterId);
CHK_OL.createOperationList(CHK_OL.operationList);
CHK_Common.closeLoading();
CHK_Common.closeLoading();
};
/**
* change the operationList by select the category(OperationGroupMaster)
* @param {Number} operationGroupMasterId
* @param {Number} operationGroupMasterId
*/
CHK_OL.changeOperationGroupMaster = function(operationGroupMasterId) {
if ($("#category-menu").hasClass("open")) {
$('#category-toggle-button').click();
$("body").css("overflow", "visible");
}
CHK_OL.operationGroupMasterId = operationGroupMasterId;
CHK_OL.search();
}
CHK_OL.changeOperationGroupMaster = function (operationGroupMasterId) {
if ($('#category-menu').hasClass('open')) {
$('#category-toggle-button').click();
$('body').css('overflow', 'visible');
}
CHK_OL.operationGroupMasterId = operationGroupMasterId;
CHK_OL.search();
};
/**
* open the category(OperationGroupMaster)
*/
CHK_OL.openCategory = function() {
window.scrollTo(0,0);
if ($("#category-menu").hasClass("open")) {
$("body").css("overflow", "visible");
}else{
$("body").css("overflow", "hidden");
}
}
CHK_OL.openCategory = function () {
window.scrollTo(0, 0);
if ($('#category-menu').hasClass('open')) {
$('body').css('overflow', 'visible');
} else {
$('body').css('overflow', 'hidden');
}
};
/**
* reset search
*/
CHK_OL.resetSearch = function() {
$('#searchTaskName').val('');
CHK_OL.resetSearch = function () {
$('#searchTaskName').val('');
$('#searchStartDate').val('');
$('#searchEndDate').val('');
CHK_OL.changeSortType($('#defaultSort'));
}
};
/**
* Transition to the report form or operation list screen
*
*
* @param {String} operationId
*/
CHK_OL.sendOperation = function(operationId, operationType, reportType) {
//save operation logs. needed for sorting
let saveParams = {};
saveParams.sid = CHK_Common.getSid();
saveParams.cmd = CHK_CONSTANT.ACT_CMD.saveOperationLog;
saveParams.deviceType = 4;
saveParams.operationType = operationType;
saveParams.reportType = reportType;
const date = new Date();
saveParams.viewingStartDate = date.toLocaleString();
CHK_Common.sendABookCheckApi(saveParam, false)
//Transition to the report form or operation list screen
let postParams = {};
postParams.sid = CHK_Common.getSid();
postParams.cmd = CHK_CONSTANT.ACT_CMD.goOperation;
postParams.operationId = operationId;
const url = CHK_Common.getUrlWeb(postParams.cmd);
postCommunication(url, postParams);
};
\ No newline at end of file
CHK_OL.sendOperation = function (operationId, operationType, reportType) {
//save operation logs. needed for sorting
let saveParams = {};
saveParams.sid = CHK_Common.getSid();
saveParams.cmd = CHK_CONSTANT.ACT_CMD.saveOperationLog;
saveParams.deviceType = 4;
saveParams.operationType = operationType;
saveParams.reportType = reportType;
const date = new Date();
saveParams.viewingStartDate = date.toLocaleString();
CHK_Common.sendABookCheckApi(saveParam, false);
//Transition to the report form or operation list screen
let postParams = {};
postParams.sid = CHK_Common.getSid();
postParams.cmd = CHK_CONSTANT.ACT_CMD.goOperation;
postParams.operationId = operationId;
const url = CHK_Common.getUrlWeb(postParams.cmd);
postCommunication(url, postParams);
};
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