Commit ac475e82 by Kang Donghun

Merge branch 'feature/1.0_check_web_dev_imai' into 'feature/1.0_check_web_dev'

Feature/1.0 check web dev imai

See merge request !42
parents deb21e90 179667e2
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
"templateSelection":"Template selection", "templateSelection":"Template selection",
"logo":"logo", "logo":"logo",
"listDisplay":"List display", "listDisplay":"List display",
"gridDisplay":"Grid display" "gridDisplay":"Grid display",
"reportForm": "Report",
"periodicInspectionPeriod": "Periodic Inspection Period"
} }
\ No newline at end of file
...@@ -95,5 +95,7 @@ ...@@ -95,5 +95,7 @@
"templateSelection":"テンプレート選択", "templateSelection":"テンプレート選択",
"logo":"ロゴ", "logo":"ロゴ",
"listDisplay":"リスト表示", "listDisplay":"リスト表示",
"gridDisplay":"グリッド表示" "gridDisplay":"グリッド表示",
"reportForm": "報告",
"periodicInspectionPeriod": "定期点検期間"
} }
\ No newline at end of file
...@@ -94,5 +94,7 @@ ...@@ -94,5 +94,7 @@
"templateSelection":"Template selection", "templateSelection":"Template selection",
"logo":"logo", "logo":"logo",
"listDisplay":"list display", "listDisplay":"list display",
"gridDisplay":"Grid display" "gridDisplay":"Grid display",
"reportForm": "보고서",
"periodicInspectionPeriod": "정기점검기간"
} }
\ No newline at end of file
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
<script src="../common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"></script> <script src="../common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"></script>
<script src="../common/js/jquery/jquery-ui.min.js?__UPDATEID__"></script> <script src="../common/js/jquery/jquery-ui.min.js?__UPDATEID__"></script>
<!-- <script src="../common/js/web/common.js?__UPDATEID__"></script>
<script src="../common/js/web/avweb.js?__UPDATEID__"></script> -->
<script src="../common/js/constant.js?__UPDATEID__"></script> <script src="../common/js/constant.js?__UPDATEID__"></script>
<script src="../common/js/common.js?__UPDATEID__"></script> <script src="../common/js/common.js?__UPDATEID__"></script>
<script src="../js/operationList/operationList.js?__UPDATEID__"></script> <script src="../js/operationList/operationList.js?__UPDATEID__"></script>
...@@ -26,6 +24,7 @@ ...@@ -26,6 +24,7 @@
<script src="../common/js/header.js?__UPDATEID__"></script> <script src="../common/js/header.js?__UPDATEID__"></script>
<script src="../js/topPage/topPage.js?__UPDATEID__"></script> <script src="../js/topPage/topPage.js?__UPDATEID__"></script>
<script src="../common/js/app.js?__UPDATEID__" defer></script> <script src="../common/js/app.js?__UPDATEID__" defer></script>
<script src="../js/reportForm/reportForm.js?__UPDATEID__" defer></script>
<script src="https://cdn.jsdelivr.net/npm/gasparesganga-jquery-loading-overlay@2.1.7/dist/loadingoverlay.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/gasparesganga-jquery-loading-overlay@2.1.7/dist/loadingoverlay.min.js"></script>
......
<!DOCTYPE html>
<html lang="ja-JP">
<head>
<meta charset="utf-8">
<title class="lang" lang="reportForm"></title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- favicons -->
<link href="../common/img/favicon.ico" rel="icon">
<link href="../common/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- main css -->
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/app.css">
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/header.css">
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/style.css">
<!-- vender css -->
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/fontawesome_relative_path.css">
<script type="text/javascript" src="../common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/jquery/jquery-ui.min.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/web/i18n.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/constant.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/header/header.js?__UPDATEID__"></script>
<script src="https://cdn.jsdelivr.net/npm/gasparesganga-jquery-loading-overlay@2.1.7/dist/loadingoverlay.min.js"></script>
</head>
<body onload="RF.init();">
<!-- header -->
<div id="includedHeader"></div>
<!-- report list -->
<main>
<div class="container-wrap">
<!-- breadcrumb -->
<nav aria-label="breadcrumb">
<ol class="breadcrumb px-0 mb-0">
<li class="breadcrumb-item"><a href="task-list.html" class="text-decoration-none text-underline">作業一覧</a></li>
<li class="breadcrumb-item active" aria-current="page"><span>報告一覧</span></li>
<li class="breadcrumb-item active" aria-current="page"><span>報告</span></li>
</ol>
</nav>
<!-- title -->
<div class="d-flex align-items-center">
<h1 class="fs-14 font-weight-bold pt-sm-4 pt-2 pb-3 mb-0 mr-auto" lang="reportForm"></h1>
<div style="display: none;">
<div><span style="font-size:18px;" lang="periodicInspectionPeriod"></span></div>
<div><span id="inspectDate"></span></div>
</div>
<div class="quickReportBtn" id="quickReportBtn" onclick="submitForm();">
<img src="../common/img/icon_pdf.svg" alt="pdf出力" class="p-1 w-40px" data-toggle="tooltip" data-placement="bottom" title="pdfPrint">
</div>
</div>
</div>
</main>
<div class="mb-5" id="report-form"></div>
<!-- confirm -->
<div id="includedConfirmModal"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript" src="../common/js/newdash/app.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/newdash/common.js?__UPDATEID__"></script>
</body>
</html>
\ No newline at end of file
...@@ -121,6 +121,9 @@ DASHBOARD.initHtmlItem = function (item) { ...@@ -121,6 +121,9 @@ DASHBOARD.initHtmlItem = function (item) {
/** Initialization dashboard screen */ /** Initialization dashboard screen */
DASHBOARD.init = function () { DASHBOARD.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.DASHBOARD; sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.DASHBOARD;
DASHBOARD.loadCommon(); DASHBOARD.loadCommon();
DashboardSetting.getSettingData(function (settings) { DashboardSetting.getSettingData(function (settings) {
......
/** /**
* 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();
},
);
}; };
/** /**
......
// prepared to use Global object(LOGIN) /**
* prepared to use Global object(LOGIN)
* @since cms:1.4.3.2&1.4.3.3 web:1.0
**/
var LOGIN = {}; var LOGIN = {};
// var requirePasswordChange; // var requirePasswordChange;
...@@ -9,579 +13,581 @@ LOGIN.optionList = []; ...@@ -9,579 +13,581 @@ LOGIN.optionList = [];
LOGIN.force_pw_change_on_login; LOGIN.force_pw_change_on_login;
LOGIN.force_pw_change_periodically; LOGIN.force_pw_change_periodically;
LOGIN.login_error_flag = false; LOGIN.login_error_flag = false;
LOGIN.login_errorMessage = ""; LOGIN.login_errorMessage = '';
LOGIN.timeWaitSplashScreen = 2000;// wait splash screen 2 second LOGIN.timeWaitSplashScreen = 2000; // wait splash screen 2 second
// Load login Info // Load login Info
LOGIN.loadLoginInfo = function() { LOGIN.loadLoginInfo = function () {
$('#chkRemember').attr('checked', 'checked'); $('#chkRemember').attr('checked', 'checked');
if (ClientData.userInfo_accountPath() != null) { if (ClientData.userInfo_accountPath() != null) {
$('#txtAccPath').val(ClientData.userInfo_accountPath()); $('#txtAccPath').val(ClientData.userInfo_accountPath());
} }
if (ClientData.userInfo_loginId() != null) { if (ClientData.userInfo_loginId() != null) {
$('#txtAccId').val(ClientData.userInfo_loginId()); $('#txtAccId').val(ClientData.userInfo_loginId());
} }
}; };
// Initial Screen // Initial Screen
LOGIN.initialScreen = function() { LOGIN.initialScreen = function () {
if (ClientData.userInfo_rememberLogin()) { if (ClientData.userInfo_rememberLogin()) {
LOGIN.loadLoginInfo(); LOGIN.loadLoginInfo();
} else { } else {
$('#txtAccPath').val(""); $('#txtAccPath').val('');
$('#txtAccId').val(""); $('#txtAccId').val('');
} }
}; };
// check Save Login Info // check Save Login Info
LOGIN.saveLoginInfo = function() { LOGIN.saveLoginInfo = function () {
var lang = I18N.getCurrentLanguage();
var lang = I18N.getCurrentLanguage(); // load language
// load language I18N.changeLanguage(lang);
I18N.changeLanguage(lang);
var accountPath, loginId, password;
var accountPath, loginId, password; var chkRemember = $('#chkRemember').attr('checked');
var chkRemember = $('#chkRemember').attr('checked'); accountPath = $('#txtAccPath').val();
accountPath = $('#txtAccPath').val(); loginId = $('#txtAccId').val();
loginId = $('#txtAccId').val(); password = $('#txtPassword').val();
password = $('#txtPassword').val();
// save user data to local storage
// save user data to local storage var date = new Date();
var date = new Date(); ClientData.userInfo_accountPath(accountPath);
ClientData.userInfo_accountPath(accountPath); ClientData.userInfo_loginId(loginId);
ClientData.userInfo_loginId(loginId); ClientData.userInfo_accountPath_session(accountPath);
ClientData.userInfo_accountPath_session(accountPath); ClientData.userInfo_loginId_session(loginId);
ClientData.userInfo_loginId_session(loginId); ClientData.userInfo_userName(LOGIN.userInfo_userName);
ClientData.userInfo_userName(LOGIN.userInfo_userName); if (chkRemember == 'checked') {
if (chkRemember == 'checked') { ClientData.userInfo_rememberLogin(true);
ClientData.userInfo_rememberLogin(true); } else {
} else { ClientData.userInfo_rememberLogin(false);
ClientData.userInfo_rememberLogin(false); }
}
ClientData.userInfo_lastLoginTime(date.jpDateTimeString());
ClientData.userInfo_lastLoginTime(date.jpDateTimeString()); ClientData.userInfo_sid_local(LOGIN.userinfo_sid);
ClientData.userInfo_sid_local(LOGIN.userinfo_sid); // save sid for backup
// save sid for backup ClientData.userInfo_sid_local_bak(LOGIN.userinfo_sid);
ClientData.userInfo_sid_local_bak(LOGIN.userinfo_sid);
LOGIN.saveServiceUserOption();
LOGIN.saveServiceUserOption(); // reset to paging function
// reset to paging function ClientData.JumpQueue([]);
ClientData.JumpQueue([]); ClientData.IsJumpBack(false);
ClientData.IsJumpBack(false);
}; };
// Check validation // Check validation
LOGIN.checkValidation = function() { LOGIN.checkValidation = function () {
var accountPath = $('#txtAccPath').val();
var accountPath = $('#txtAccPath').val(); var loginId = $('#txtAccId').val();
var loginId = $('#txtAccId').val(); var password = $('#txtPassword').val();
var password = $('#txtPassword').val(); var msgError = $('#main-error-message');
var msgError = $('#main-error-message'); if (!ValidationUtil.CheckRequiredForText(accountPath)) {
if (!ValidationUtil.CheckRequiredForText(accountPath)) { LOGIN.login_errorMessage = '';
LOGIN.login_errorMessage = ""; msgError.html(I18N.i18nText('msgLoginEmpty'));
msgError.html(I18N.i18nText('msgLoginEmpty')); msgError.attr('lang', 'msgLoginEmpty');
msgError.attr('lang', 'msgLoginEmpty'); msgError.show();
msgError.show(); return false;
return false; } else if (!ValidationUtil.CheckRequiredForText(loginId)) {
} else if (!ValidationUtil.CheckRequiredForText(loginId)) { LOGIN.login_errorMessage = '';
LOGIN.login_errorMessage = ""; msgError.html(I18N.i18nText('msgLoginEmpty'));
msgError.html(I18N.i18nText('msgLoginEmpty')); msgError.attr('lang', 'msgLoginEmpty');
msgError.attr('lang', 'msgLoginEmpty'); msgError.show();
msgError.show(); return false;
return false; } else if (!ValidationUtil.CheckRequiredForText(password)) {
} else if (!ValidationUtil.CheckRequiredForText(password)) { LOGIN.login_errorMessage = '';
LOGIN.login_errorMessage = ""; msgError.html(I18N.i18nText('msgLoginEmpty'));
msgError.html(I18N.i18nText('msgLoginEmpty')); msgError.attr('lang', 'msgLoginEmpty');
msgError.attr('lang', 'msgLoginEmpty'); msgError.show();
msgError.show(); return false;
return false; } else {
} else { return true;
return true; }
}
}; };
// Check Dialog validation // Check Dialog validation
LOGIN.checkDialogValidation = function() { LOGIN.checkDialogValidation = function () {
var currentPass = $('#txtCurrentPass').val(); var currentPass = $('#txtCurrentPass').val();
var newPass = $('#txtNewPass').val(); var newPass = $('#txtNewPass').val();
var confirmPass = $('#txtConfirmNew').val(); var confirmPass = $('#txtConfirmNew').val();
var msgError = $('#dialog-error-message'); var msgError = $('#dialog-error-message');
if (!ValidationUtil.CheckRequiredForText(currentPass)) { if (!ValidationUtil.CheckRequiredForText(currentPass)) {
LOGIN.login_errorMessage = ""; LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgPwdEmpty')); msgError.html(I18N.i18nText('msgPwdEmpty'));
msgError.attr('lang', 'msgPwdEmpty'); msgError.attr('lang', 'msgPwdEmpty');
msgError.show(); msgError.show();
return false; return false;
} else if (!ValidationUtil.CheckRequiredForText(newPass)) { } else if (!ValidationUtil.CheckRequiredForText(newPass)) {
LOGIN.login_errorMessage = ""; LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgPwdEmpty')); msgError.html(I18N.i18nText('msgPwdEmpty'));
msgError.attr('lang', 'msgPwdEmpty'); msgError.attr('lang', 'msgPwdEmpty');
msgError.show(); msgError.show();
return false; return false;
} else { } else {
if (newPass != confirmPass) { if (newPass != confirmPass) {
LOGIN.login_errorMessage = ""; LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgPwdNotMatch')); msgError.html(I18N.i18nText('msgPwdNotMatch'));
msgError.attr('lang', 'msgPwdNotMatch'); msgError.attr('lang', 'msgPwdNotMatch');
msgError.show(); msgError.show();
return false; return false;
} else if (!ValidationUtil.CheckMinLengthForByte(newPass, 6)) { } else if (!ValidationUtil.CheckMinLengthForByte(newPass, 6)) {
LOGIN.login_errorMessage = ""; LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgInvaildLength')); msgError.html(I18N.i18nText('msgInvaildLength'));
msgError.attr('lang', 'msgInvaildLength'); msgError.attr('lang', 'msgInvaildLength');
msgError.show(); msgError.show();
return false; return false;
} else if (!ValidationUtil.CheckMaxLengthForByte(newPass, 16)) { } else if (!ValidationUtil.CheckMaxLengthForByte(newPass, 16)) {
LOGIN.login_errorMessage = ""; LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgInvaildLength')); msgError.html(I18N.i18nText('msgInvaildLength'));
msgError.attr('lang', 'msgInvaildLength'); msgError.attr('lang', 'msgInvaildLength');
msgError.show(); msgError.show();
return false; return false;
} else if (ValidationUtil.HasSeqChar(newPass, 3)) { } else if (ValidationUtil.HasSeqChar(newPass, 3)) {
LOGIN.login_errorMessage = ""; LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgHasSeqChar')); msgError.html(I18N.i18nText('msgHasSeqChar'));
msgError.attr('lang', 'msgHasSeqChar'); msgError.attr('lang', 'msgHasSeqChar');
msgError.show(); msgError.show();
return false; return false;
} else if (ValidationUtil.ContainSameSeqChar(newPass, currentPass, 4)) { } else if (ValidationUtil.ContainSameSeqChar(newPass, currentPass, 4)) {
LOGIN.login_errorMessage = ""; LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgContainSameSeqChar')); msgError.html(I18N.i18nText('msgContainSameSeqChar'));
msgError.attr('lang', 'msgContainSameSeqChar'); msgError.attr('lang', 'msgContainSameSeqChar');
msgError.show(); msgError.show();
return false; return false;
} else { } else {
return true; return true;
} }
} }
}; };
// Login Process // Login Process
LOGIN.processLogin = function() { LOGIN.processLogin = function () {
var accountPath = ""; var accountPath = '';
var loginId = ""; var loginId = '';
var password = ""; var password = '';
loginId = $('#txtAccId').val(); loginId = $('#txtAccId').val();
password = $('#txtPassword').val(); password = $('#txtPassword').val();
accountPath = $('#txtAccPath').val(); accountPath = $('#txtAccPath').val();
var requireChangePassword = 0; var requireChangePassword = 0;
var skipPwdDate; var skipPwdDate;
var params = { var params = {
previousSid : '', previousSid: '',
loginId : loginId, loginId: loginId,
password : password, password: password,
urlpath : accountPath urlpath: accountPath,
}; };
// Set sid for login, this will be checked authoring 2 sessions // Set sid for login, this will be checked authoring 2 sessions
if (ClientData.userInfo_sid_local()) { if (ClientData.userInfo_sid_local()) {
params.previousSid = ClientData.userInfo_sid_local(); params.previousSid = ClientData.userInfo_sid_local();
} }
// Get url to login // Get url to login
url = COMMON.format(ClientData.conf_checkApiUrl(), accountPath) + CONSTANT.URL.CMS.API.LOGIN; url = COMMON.format(ClientData.conf_checkApiUrl(), accountPath) + CONSTANT.URL.CMS.API.LOGIN;
COMMON.cmsAjax(url, params, true, function(data) { COMMON.cmsAjax(
LOGIN.userinfo_sid = data.sid; url,
LOGIN.userInfo_userName = data.userName; params,
LOGIN.optionList = data.serviceOptionList; true,
function (data) {
LOGIN.getServiceOptionList(); LOGIN.userinfo_sid = data.sid;
LOGIN.userInfo_userName = data.userName;
if (data.result == 'success') { LOGIN.optionList = data.serviceOptionList;
// Save retrieved info
LOGIN.saveLoginInfo(); LOGIN.getServiceOptionList();
// set number new push message to 0
ClientData.pushInfo_newMsgNumber(0); if (data.result == 'success') {
// Save retrieved info
$('#main-error-message').css('display', 'none'); LOGIN.saveLoginInfo();
// set number new push message to 0
console.log("data.requirePasswordChange:" + data.requirePasswordChange); ClientData.pushInfo_newMsgNumber(0);
COMMON.closeLoading();
$('#main-error-message').css('display', 'none');
if (data.requirePasswordChange == 0) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local()); console.log('data.requirePasswordChange:' + data.requirePasswordChange);
COMMON.closeLoading();
// move to home.html page
COMMON.avwScreenMove("index.html"); if (data.requirePasswordChange == 0) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
} else if (data.requirePasswordChange == 1) {
// move to home.html page
if (LOGIN.force_pw_change_on_login == 2) { // force to change COMMON.avwScreenMove('index.html');
// password } else if (data.requirePasswordChange == 1) {
LOGIN.OpenChangePasswordDialog(); if (LOGIN.force_pw_change_on_login == 2) {
$(".ui-dialog-titlebar").hide(); // force to change
$('#btnSkip').hide(); // password
$("#txtPwdRemind").css('visibility', 'hidden'); LOGIN.OpenChangePasswordDialog();
} else if (LOGIN.force_pw_change_on_login == 1) { // recommend $('.ui-dialog-titlebar').hide();
// to change $('#btnSkip').hide();
// password $('#txtPwdRemind').css('visibility', 'hidden');
} else if (LOGIN.force_pw_change_on_login == 1) {
// Check 30 days // recommend
skipPwdDate = ClientData.userInfo_pwdSkipDt(); // to change
// password
if (skipPwdDate == null || skipPwdDate == 'undefined') {
LOGIN.OpenChangePasswordDialog(); // Check 30 days
$('#btnSkip').show(); skipPwdDate = ClientData.userInfo_pwdSkipDt();
$(".ui-dialog-titlebar").hide();
} else { if (skipPwdDate == null || skipPwdDate == 'undefined') {
var date = new Date(); LOGIN.OpenChangePasswordDialog();
var skpPwdDt = new Date(skipPwdDate); $('#btnSkip').show();
var numDay = date.subtractByDays(skpPwdDt); $('.ui-dialog-titlebar').hide();
if (numDay <= 30) { } else {
var date = new Date();
ClientData.userInfo_sid(ClientData.userInfo_sid_local()); var skpPwdDt = new Date(skipPwdDate);
// move to home.html page var numDay = date.subtractByDays(skpPwdDt);
COMMON.avwScreenMove("index.html"); if (numDay <= 30) {
} else if (numDay > 30) { ClientData.userInfo_sid(ClientData.userInfo_sid_local());
LOGIN.OpenChangePasswordDialog(); // move to home.html page
$('#btnSkip').show(); COMMON.avwScreenMove('index.html');
$(".ui-dialog-titlebar").hide(); } else if (numDay > 30) {
} LOGIN.OpenChangePasswordDialog();
} $('#btnSkip').show();
} else { // no need to change password $('.ui-dialog-titlebar').hide();
ClientData.userInfo_sid(ClientData.userInfo_sid_local()); }
}
// move to home.html page } else {
COMMON.avwScreenMove("index.html"); // no need to change password
} ClientData.userInfo_sid(ClientData.userInfo_sid_local());
} else if (data.requirePasswordChange == 2) {
// move to home.html page
if (LOGIN.force_pw_change_periodically == 1) { // recommend to COMMON.avwScreenMove('index.html');
// change }
// password } else if (data.requirePasswordChange == 2) {
$('#btnSkip').show(); if (LOGIN.force_pw_change_periodically == 1) {
skipPwdDate = ClientData.userInfo_pwdSkipDt(); // recommend to
// change
if (skipPwdDate == null || skipPwdDate == 'undefined') { // password
LOGIN.OpenChangePasswordDialog(); $('#btnSkip').show();
$(".ui-dialog-titlebar").hide(); skipPwdDate = ClientData.userInfo_pwdSkipDt();
} else {
if (skipPwdDate == null || skipPwdDate == 'undefined') {
var date = new Date(); LOGIN.OpenChangePasswordDialog();
var skpPwdDt = new Date(skipPwdDate); $('.ui-dialog-titlebar').hide();
var numDay = date.subtractByDays(skpPwdDt); } else {
var date = new Date();
if (numDay <= 30) { var skpPwdDt = new Date(skipPwdDate);
ClientData.userInfo_sid(ClientData.userInfo_sid_local()); var numDay = date.subtractByDays(skpPwdDt);
// move to home.html page if (numDay <= 30) {
COMMON.avwScreenMove("index.html"); ClientData.userInfo_sid(ClientData.userInfo_sid_local());
} else if (numDay > 30) { // move to home.html page
LOGIN.OpenChangePasswordDialog(); COMMON.avwScreenMove('index.html');
$(".ui-dialog-titlebar").hide(); } else if (numDay > 30) {
} LOGIN.OpenChangePasswordDialog();
} $('.ui-dialog-titlebar').hide();
} else if (LOGIN.force_pw_change_periodically == 2) { // Force }
// to }
// change } else if (LOGIN.force_pw_change_periodically == 2) {
// password // Force
LOGIN.OpenChangePasswordDialog(); // to
$('#btnSkip').hide(); // change
$(".ui-dialog-titlebar").hide(); // password
$("#txtPwdRemind").css('visibility', 'hidden'); LOGIN.OpenChangePasswordDialog();
} else { // No need to change password $('#btnSkip').hide();
ClientData.userInfo_sid(ClientData.userInfo_sid_local()); $('.ui-dialog-titlebar').hide();
// move to home.html page $('#txtPwdRemind').css('visibility', 'hidden');
COMMON.avwScreenMove("index.html"); } else {
} // No need to change password
} ClientData.userInfo_sid(ClientData.userInfo_sid_local());
} else { // move to home.html page
COMMON.closeLoading(); COMMON.avwScreenMove('index.html');
LOGIN.login_errorMessage = data.errorMessage; }
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), data.errorMessage).toString()); }
$('#main-error-message').show(); } else {
COMMON.closeLoading();
} LOGIN.login_errorMessage = data.errorMessage;
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), data.errorMessage).toString());
}, function(result) { $('#main-error-message').show();
LOGIN.login_error_flag = true; }
COMMON.closeLoading(); },
if (result.errorMessage) { function (result) {
LOGIN.login_errorMessage = result.errorMessage; LOGIN.login_error_flag = true;
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), result.errorMessage).toString()); COMMON.closeLoading();
} else { if (result.errorMessage) {
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), 'E001')); LOGIN.login_errorMessage = result.errorMessage;
} $('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), result.errorMessage).toString());
$('#main-error-message').show(); } else {
}); $('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
}
$('#main-error-message').show();
},
);
}; };
// Change Password Process // Change Password Process
LOGIN.changePasswordProcess = function() { LOGIN.changePasswordProcess = function () {
var sid = ClientData.userInfo_sid_local(); var sid = ClientData.userInfo_sid_local();
var loginId = $('#txtAccId').val(); var loginId = $('#txtAccId').val();
var password = $('#txtCurrentPass').val(); var password = $('#txtCurrentPass').val();
var confirmPass = $('#txtConfirmNew').val(); var confirmPass = $('#txtConfirmNew').val();
var params = { var params = {
sid : sid, sid: sid,
loginId : loginId, loginId: loginId,
password : password, password: password,
newPassword : confirmPass, newPassword: confirmPass,
appId : 4 appId: 4,
}; };
if (I18N.getCurrentLanguage()) { if (I18N.getCurrentLanguage()) {
params.language = I18N.getCurrentLanguage(); params.language = I18N.getCurrentLanguage();
} }
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PASSWORD_CHANGE; const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PASSWORD_CHANGE;
COMMON.cmsAjax(url, params, false, function(result) { COMMON.cmsAjax(
if (result.httpStatus == '200') { url,
LOGIN.CloseChangePasswordDialog(); params,
$('#dialog-error-message').css('display', 'none'); false,
ClientData.userInfo_sid(ClientData.userInfo_sid_local()); function (result) {
if (result.httpStatus == '200') {
if (ClientData.serviceOpt_abook_check() == 'Y') { LOGIN.CloseChangePasswordDialog();
// move to home.html page $('#dialog-error-message').css('display', 'none');
COMMON.avwScreenMove("index.html"); ClientData.userInfo_sid(ClientData.userInfo_sid_local());
} else {
$('#dialog-error-message').html(I18N.i18nText('msgPwdChangeNG')); if (ClientData.serviceOpt_abook_check() == 'Y') {
$('#dialog-error-message').show(); // move to home.html page
COMMON.avwScreenMove('index.html');
} } else {
} else if (result.httpStatus == '401') { $('#dialog-error-message').html(I18N.i18nText('msgPwdChangeNG'));
COMMON.goUrlWithCurrentParams(CONSTANT.PAGE_NAME.LOGIN); $('#dialog-error-message').show();
} else if (result.httpStatus == '403') { }
$('#dialog-error-message').html(data.message); } else if (result.httpStatus == '401') {
$('#dialog-error-message').show(); COMMON.goUrlWithCurrentParams(CONSTANT.PAGE_NAME.LOGIN);
} } else if (result.httpStatus == '403') {
}, function(result) { $('#dialog-error-message').html(data.message);
COMMON.closeLoading(); $('#dialog-error-message').show();
if (result.errorMessage) { }
$('#dialog-error-message').html(result.errorMessage); },
} else { function (result) {
$('#dialog-error-message').html(I18N.i18nText('msgPwdChangeNG')); COMMON.closeLoading();
} if (result.errorMessage) {
$('#dialog-error-message').show(); $('#dialog-error-message').html(result.errorMessage);
} else {
}); $('#dialog-error-message').html(I18N.i18nText('msgPwdChangeNG'));
}
$('#dialog-error-message').show();
},
);
}; };
// Change Language English // Change Language English
LOGIN.changeLanguage = function(lang) { LOGIN.changeLanguage = function (lang) {
I18N.changeLanguage(lang); I18N.changeLanguage(lang);
document.title = I18N.i18nText('dspLogin') + ' | ' + I18N.i18nText('sysAppTitle'); document.title = I18N.i18nText('dspLogin') + ' | ' + I18N.i18nText('sysAppTitle');
if (LOGIN.login_errorMessage != "") { if (LOGIN.login_errorMessage != '') {
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), LOGIN.login_errorMessage).toString()); $('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), LOGIN.login_errorMessage).toString());
} }
}; };
// Login click function // Login click function
LOGIN.loginFunction = function() { LOGIN.loginFunction = function () {
COMMON.showLoading(); COMMON.showLoading();
if (LOGIN.checkValidation()) { if (LOGIN.checkValidation()) {
LOGIN.processLogin(); LOGIN.processLogin();
} else { } else {
COMMON.closeLoading(); COMMON.closeLoading();
} }
}; };
// Change Password function // Change Password function
LOGIN.changePassFunction = function() { LOGIN.changePassFunction = function () {
if (LOGIN.checkDialogValidation()) { if (LOGIN.checkDialogValidation()) {
LOGIN.changePasswordProcess(); LOGIN.changePasswordProcess();
} }
}; };
// Skip Password function // Skip Password function
LOGIN.skipPassFunction = function() { LOGIN.skipPassFunction = function () {
var date = new Date(); var date = new Date();
ClientData.userInfo_pwdSkipDt(date); ClientData.userInfo_pwdSkipDt(date);
ClientData.userInfo_sid(ClientData.userInfo_sid_local()); ClientData.userInfo_sid(ClientData.userInfo_sid_local());
if (ClientData.serviceOpt_abook_check() == 'Y') { if (ClientData.serviceOpt_abook_check() == 'Y') {
// move to home.html page // move to home.html page
COMMON.avwScreenMove("index.html"); COMMON.avwScreenMove('index.html');
} else { } else {
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), 'E001')); $('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
$('#main-error-message').show(); $('#main-error-message').show();
} }
}; };
// Open Change Password Dialog // Open Change Password Dialog
LOGIN.OpenChangePasswordDialog = function() { LOGIN.OpenChangePasswordDialog = function () {
$("#password-reset-modal").show(); $('#password-reset-modal').show();
COMMON.showLoading(); COMMON.showLoading();
console.log("password open"); console.log('password open');
}; };
// Close Chnage Password Dialog // Close Chnage Password Dialog
LOGIN.CloseChangePasswordDialog = function() { LOGIN.CloseChangePasswordDialog = function () {
$("#main-password-change").hide(); $('#main-password-change').hide();
COMMON.closeLoading(); COMMON.closeLoading();
}; };
// Save Service Option // Save Service Option
LOGIN.saveServiceUserOption = function() { LOGIN.saveServiceUserOption = function () {
$.each(LOGIN.optionList, function (i, option) {
$.each(LOGIN.optionList, function(i, option) { if (option.serviceOptionId == 22) {
ClientData.serviceOpt_force_pw_change_periodically(option.value);
if (option.serviceOptionId == 22) { } else if (option.serviceOptionId == 21) {
ClientData.serviceOpt_force_pw_change_periodically(option.value); ClientData.serviceOpt_force_pw_change_on_login(option.value);
} else if (option.serviceOptionId == 21) { } else if (option.serviceOptionId == 49) {
ClientData.serviceOpt_force_pw_change_on_login(option.value); ClientData.serviceOpt_usable_push_message(option.value);
} else if (option.serviceOptionId == 49) { } else if (option.serviceOptionId == 161) {
ClientData.serviceOpt_usable_push_message(option.value); ClientData.serviceOpt_abook_check(option.value);
} else if (option.serviceOptionId == 161) { } else if (option.serviceOptionId == 183) {
ClientData.serviceOpt_abook_check(option.value); ClientData.serviceOpt_chat_function(option.value);
} else if (option.serviceOptionId == 183) { }
ClientData.serviceOpt_chat_function(option.value); });
}
});
}; };
// Get Service Option // Get Service Option
LOGIN.getServiceOptionList = function() { LOGIN.getServiceOptionList = function () {
$.each(LOGIN.optionList, function (i, option) {
$.each(LOGIN.optionList, function(i, option) { if (option.serviceOptionId == 22) {
LOGIN.force_pw_change_periodically = option.value;
if (option.serviceOptionId == 22) { } else if (option.serviceOptionId == 21) {
LOGIN.force_pw_change_periodically = option.value; LOGIN.force_pw_change_on_login = option.value;
} else if (option.serviceOptionId == 21) { }
LOGIN.force_pw_change_on_login = option.value; });
}
});
}; };
LOGIN.loginWhenClickEnter = function(e) { LOGIN.loginWhenClickEnter = function (e) {
var code = (e.keyCode ? e.keyCode : e.which); var code = e.keyCode ? e.keyCode : e.which;
if (code == 13) { // Enter keycode if (code == 13) {
$('#btnLogin').click(); // Enter keycode
} $('#btnLogin').click();
}
}; };
// init login for normal user // init login for normal user
LOGIN.initLoginNormalUser = function() { LOGIN.initLoginNormalUser = function () {
document.title = I18N.i18nText('dspLogin') + ' | ' + I18N.i18nText('sysAppTitle');
document.title = I18N.i18nText('dspLogin') + ' | ' + I18N.i18nText('sysAppTitle');
// Initial Screen
// Initial Screen LOGIN.initialScreen();
LOGIN.initialScreen(); // Change language
// Change language let selector = document.getElementById('languageSelect');
let selector = document.getElementById("languageSelect"); var lang = I18N.getCurrentLanguage();
var lang = I18N.getCurrentLanguage(); if (lang) {
if (lang) { selector.value = lang;
selector.value = lang; }
} selector.addEventListener('change', function () {
selector.addEventListener("change", function() { LOGIN.changeLanguage(this.value);
LOGIN.changeLanguage(this.value); });
})
// Button login click event
// Button login click event $('#btnLogin').click(LOGIN.loginFunction);
$('#btnLogin').click(LOGIN.loginFunction); // Button Change click event
// Button Change click event $('#btnChange').click(LOGIN.changePassFunction);
$('#btnChange').click(LOGIN.changePassFunction); // Button Skip click event
// Button Skip click event $('#btnSkip').click(LOGIN.skipPassFunction);
$('#btnSkip').click(LOGIN.skipPassFunction);
$('#txtPassword').keydown(LOGIN.loginWhenClickEnter);
$('#txtPassword').keydown(LOGIN.loginWhenClickEnter);
}; };
/* display alert screen */ /* display alert screen */
LOGIN.showAlertScreen = function(errMes, scrMove) { LOGIN.showAlertScreen = function (errMes, scrMove) {
// アラートメッセージの表示
// アラートメッセージの表示 if (errMes == undefined || errMes == '') {
if (errMes == undefined || errMes == "") { errMes = 'message.'; // I18N.i18nText('msgPageImgErr');
errMes = "message."; // I18N.i18nText('msgPageImgErr'); }
}
COMMON.lockLayout();
COMMON.lockLayout(); /* show error messages */
/* show error messages */ $().toastmessage({
$().toastmessage({ position: 'middle-center',
position : 'middle-center' });
}); $().toastmessage('showToast', {
$().toastmessage('showToast', { type: 'error',
type : 'error', sticky: true,
sticky : true, text: errMes,
text : errMes, close: function () {},
close : function() { });
} $('.toast-type-error').css('height', '100px');
}); $('.toast-type-error > p').css('padding-top', '35px');
$('.toast-type-error').css('height', '100px'); $('.toast-item-close').live('click', function () {
$('.toast-type-error > p').css('padding-top', '35px'); COMMON.unlockLayout();
$('.toast-item-close').live('click', function() { if (scrMove) {
COMMON.unlockLayout(); COMMON.avwScreenMove(scrMove);
if (scrMove) { }
COMMON.avwScreenMove(scrMove); });
}
});
}; };
// $(document).ready(function (e) { // $(document).ready(function (e) {
LOGIN.ready = function() { LOGIN.ready = function () {
// Session Storage clear
// Session Storage clear SessionStorageUtils.clear();
SessionStorageUtils.clear(); COMMON.userSessionObj = null;
COMMON.userSessionObj = null; // create new session
// create new session COMMON.createUserSession();
COMMON.createUserSession(); I18N.initi18n();
I18N.initi18n();
var sysSettings = COMMON.sysSetting(); // get info in conf.json
var sysSettings = COMMON.sysSetting(); // get info in conf.json // check an getits setting
// check an getits setting if (sysSettings.apiUrl == '') {
if (sysSettings.apiUrl == "") { // acquire parameters
var siteUrl = COMMON.getUrlParam('siteUrl', '');
// acquire parameters var urlPath = COMMON.getUrlParam('urlPath', '');
var siteUrl = COMMON.getUrlParam('siteUrl', ''); var storeUrl = COMMON.getUrlParam('storeUrl', '');
var urlPath = COMMON.getUrlParam('urlPath', ''); if (siteUrl != '' && urlPath != '') {
var storeUrl = COMMON.getUrlParam('storeUrl', ''); // ClientData.siteUrl(siteUrl);
if (siteUrl != "" && urlPath != "") { // set api connection
ClientData.conf_apiUrl(siteUrl + '{0}/abvapi');
// ClientData.siteUrl(siteUrl); ClientData.conf_apiLoginUrl(siteUrl + 'nuabvapi');
// set api connection ClientData.conf_checkApiUrl(siteUrl + 'checkapi/web');
ClientData.conf_apiUrl(siteUrl + "{0}/abvapi"); ClientData.conf_apiResourceDlUrl(siteUrl + '{0}/dl');
ClientData.conf_apiLoginUrl(siteUrl + "nuabvapi"); // set account setting value
ClientData.conf_checkApiUrl(siteUrl + "checkapi/web"); ClientData.userInfo_accountPath(urlPath);
ClientData.conf_apiResourceDlUrl(siteUrl + "{0}/dl"); ClientData.userInfo_accountPath_session(urlPath);
// set account setting value ClientData.userInfo_loginId('');
ClientData.userInfo_accountPath(urlPath); ClientData.userInfo_loginId_session('');
ClientData.userInfo_accountPath_session(urlPath); }
ClientData.userInfo_loginId(""); } else {
ClientData.userInfo_loginId_session(""); // conf parameter set
ClientData.conf_apiUrl(sysSettings.apiUrl);
} ClientData.conf_checkApiUrl(sysSettings.checkApiUrl);
ClientData.conf_apiLoginUrl(sysSettings.apiLoginUrl);
} else { ClientData.conf_apiResourceDlUrl(sysSettings.apiResourceDlUrl);
// conf parameter set }
ClientData.conf_apiUrl(sysSettings.apiUrl);
ClientData.conf_checkApiUrl(sysSettings.checkApiUrl); // Set when you receive the account path with the argument
ClientData.conf_apiLoginUrl(sysSettings.apiLoginUrl);
ClientData.conf_apiResourceDlUrl(sysSettings.apiResourceDlUrl); $('#normalUser').show();
} $('#formlogin').hide();
$('#logologin').animate(
// Set when you receive the account path with the argument {
'margin-top': 0,
$('#normalUser').show(); },
$('#formlogin').hide(); LOGIN.timeWaitSplashScreen,
$('#logologin').animate({ function () {
"margin-top" : 0 $('#formlogin').show();
}, LOGIN.timeWaitSplashScreen, function() { $('#menu-language').animate(
$('#formlogin').show(); {
$('#menu-language').animate({ opacity: 1,
opacity : 1 },
}, LOGIN.timeWaitSplashScreen); LOGIN.timeWaitSplashScreen,
$('#formlogin').animate({ );
opacity : 1 $('#formlogin').animate(
}, LOGIN.timeWaitSplashScreen); {
$('.cnt_footer').animate({ opacity: 1,
opacity : 1 },
}, LOGIN.timeWaitSplashScreen); LOGIN.timeWaitSplashScreen,
}); );
LOGIN.initLoginNormalUser(); $('.cnt_footer').animate(
{
opacity: 1,
},
LOGIN.timeWaitSplashScreen,
);
},
);
LOGIN.initLoginNormalUser();
}; };
/** /**
* 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
...@@ -507,8 +507,13 @@ OL.sendOperation = function (operationId, operationType, reportType, enableAddRe ...@@ -507,8 +507,13 @@ OL.sendOperation = function (operationId, operationType, reportType, enableAddRe
//save operation logs. needed for sorting //save operation logs. needed for sorting
OL.saveOperationReadingLog(operationId, operationType, reportType); OL.saveOperationReadingLog(operationId, operationType, reportType);
//Transition to the report form or operation list screen //Transition to the report form or operation list screen
sessionStorage.OL_operationId = operationId; if (enableAddReport == '1' || reportType == CONSTANT.REPORT_TYPE.ROUTINE) {
COMMON.avwScreenMove("reportList.html"); sessionStorage.OL_operationId = operationId;
COMMON.avwScreenMove('reportList.html');
} else {
const url = 'reportForm.html?operationId=' + operationId;
COMMON.avwScreenMove(url);
}
}; };
/** /**
...@@ -542,6 +547,6 @@ OL.createUrlOfOperation = function (enableAddReport, reportType) { ...@@ -542,6 +547,6 @@ OL.createUrlOfOperation = function (enableAddReport, reportType) {
if (reportType == CONSTANT.REPORT_TYPE.ROUTINE || enableAddReport == '1') { if (reportType == CONSTANT.REPORT_TYPE.ROUTINE || enableAddReport == '1') {
return baseUrl + CONSTANT.URL.CMS.HTML.TASK_REPORT_LIST; return baseUrl + CONSTANT.URL.CMS.HTML.TASK_REPORT_LIST;
} else { } else {
return baseUrl + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM + '/' + CONSTANT.REPLY_NO.REPORT; return baseUrl + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM;
} }
}; };
/** /**
* 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 = {};
PP.init = function() { PP.init = function () {
console.log("PP.init"); //Check if user is logged in
COMMON.checkAuth(false);
console.log('PP.init');
PP.loadCommon(); PP.loadCommon();
PP.initPdfList(); PP.initPdfList();
}; };
PP.loadCommon = function() { PP.loadCommon = function () {
$("#includedHeader").load("../html/common/header.html" , function() { $('#includedHeader').load('../html/common/header.html', function () {
I18N.initi18n(); I18N.initi18n();
HEADER.init(); HEADER.init();
}); });
$("#includedConfirmModal").load("../html/common/confirmModal.html", function() { $('#includedConfirmModal').load('../html/common/confirmModal.html', function () {
I18N.initi18n(); I18N.initi18n();
}); });
} };
PP.initPdfList = function() { PP.initPdfList = function () {
if (sessionStorage.OL_operationId) { if (sessionStorage.OL_operationId) {
let params = {}; let params = {};
params.sid = COMMON.getSid(); params.sid = COMMON.getSid();
params.operationId = sessionStorage.OL_operationId; params.operationId = sessionStorage.OL_operationId;
params.returnUrl = CONSTANT.URL.WEB.BASE + CONSTANT.URL.WEB.OPERATION_LIST; params.returnUrl = CONSTANT.URL.WEB.BASE + CONSTANT.URL.WEB.OPERATION_LIST;
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.QUICK_REPORT_PRINT; let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.QUICK_REPORT_PRINT;
$("#pdfPrint").load(url, params); $('#pdfPrint').load(url, params);
} else { } else {
COMMON.displayAlert("error"); COMMON.displayAlert('error');
COMMON.avwScreenMove("reportList.html"); COMMON.avwScreenMove('reportList.html');
} }
} };
\ No newline at end of file
...@@ -7,45 +7,45 @@ var PICKUP = {}; ...@@ -7,45 +7,45 @@ var PICKUP = {};
PICKUP.newReportList; PICKUP.newReportList;
PICKUP.continousWorkReport; PICKUP.continousWorkReport;
PICKUP.reportWithWarning; PICKUP.reportWithWarning;
PICKUP.pickupDefault = "newReport"; PICKUP.pickupDefault = 'newReport';
PICKUP.pickupActive = "newReport"; PICKUP.pickupActive = 'newReport';
PICKUP.countNewReportList = 0; PICKUP.countNewReportList = 0;
PICKUP.countContinousWorkReport = 0; PICKUP.countContinousWorkReport = 0;
PICKUP.countReportWithWarning= 0; PICKUP.countReportWithWarning = 0;
/** /**
* Report type * Report type
*/ */
PICKUP.REPORT_TYPE = { PICKUP.REPORT_TYPE = {
REPORTONLY: 0, //report only REPORTONLY: 0, //report only
INSPECT: 1, //rountine INSPECT: 1, //rountine
WITHREPLY: 2, // report answer WITHREPLY: 2, // report answer
WORKFLOW: 3 // continuous WORKFLOW: 3, // continuous
} };
/** /**
* operation type * operation type
*/ */
PICKUP.OPERATION_TYPE = { PICKUP.OPERATION_TYPE = {
LIST: "0", LIST: '0',
DRAWING: "1", DRAWING: '1',
VTOUR: "2", VTOUR: '2',
PDF: "3" PDF: '3',
}; };
/** /**
* task type of report answer * task type of report answer
*/ */
PICKUP.REPLYREPORT_TASK_TYPE = { PICKUP.REPLYREPORT_TASK_TYPE = {
REPORT: 0, REPORT: 0,
ANSWER: 1 ANSWER: 1,
} };
/** /**
* default Pickup List * default Pickup List
*/ */
PICKUP.defaultPickupList = { PICKUP.defaultPickupList = {
operationList:[] operationList: [],
} };
PICKUP.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()); PICKUP.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath());
PICKUP.getNewReportListApiUrl = PICKUP.baseApiUrl + CONSTANT.URL.CMS.API.NEW_REPORT; PICKUP.getNewReportListApiUrl = PICKUP.baseApiUrl + CONSTANT.URL.CMS.API.NEW_REPORT;
...@@ -53,71 +53,92 @@ PICKUP.getContinuousWorkListApiUrl = PICKUP.baseApiUrl + CONSTANT.URL.CMS.API.WO ...@@ -53,71 +53,92 @@ PICKUP.getContinuousWorkListApiUrl = PICKUP.baseApiUrl + CONSTANT.URL.CMS.API.WO
PICKUP.getReportWithWarningsListApiUrl = PICKUP.baseApiUrl + CONSTANT.URL.CMS.API.WARNING_WITH_REPORT; PICKUP.getReportWithWarningsListApiUrl = PICKUP.baseApiUrl + CONSTANT.URL.CMS.API.WARNING_WITH_REPORT;
/** /**
* Call get new report list api get data * Call get new report list api get data
*/ */
PICKUP.getNewreportListData = function (callback) { PICKUP.getNewreportListData = function (callback) {
let param = { let param = {
sid: COMMON.getSid(), sid: COMMON.getSid(),
}; };
COMMON.cmsAjax(PICKUP.getNewReportListApiUrl, param, false, function (json) { COMMON.cmsAjax(
if (callback) { PICKUP.getNewReportListApiUrl,
callback(json); param,
} false,
}, function() { function (json) {
console.log('DASHBOARD.getNewreportListData error'); if (callback) {
if (callback) { callback(json);
callback(PICKUP.defaultPickupList); }
} },
}); function () {
console.log('DASHBOARD.getNewreportListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
},
);
}; };
/** /**
* Call get Continuous Work list api get data * Call get Continuous Work list api get data
* @param {*} callback * @param {*} callback
*/ */
PICKUP.getContinuousWorkListData = function (callback) { PICKUP.getContinuousWorkListData = function (callback) {
let param = { let param = {
sid: COMMON.getSid(), sid: COMMON.getSid(),
}; };
COMMON.cmsAjax(PICKUP.getContinuousWorkListApiUrl, param, false, function (json) { COMMON.cmsAjax(
if (callback) { PICKUP.getContinuousWorkListApiUrl,
callback(json); param,
} false,
}, function() { function (json) {
console.log('DASHBOARD.getContinuousWorkListData error'); if (callback) {
if (callback) { callback(json);
callback(PICKUP.defaultPickupList); }
} },
}); function () {
console.log('DASHBOARD.getContinuousWorkListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
},
);
}; };
/** /**
* Call get Report With Warnings list api get data * Call get Report With Warnings list api get data
* @param {*} callback * @param {*} callback
*/ */
PICKUP.getReportWithWarningsListData = function (callback) { PICKUP.getReportWithWarningsListData = function (callback) {
let param = { let param = {
sid: COMMON.getSid(), sid: COMMON.getSid(),
}; };
COMMON.cmsAjax(PICKUP.getReportWithWarningsListApiUrl, param, false, function (json) { COMMON.cmsAjax(
if (callback) { PICKUP.getReportWithWarningsListApiUrl,
callback(json); param,
} false,
}, function() { function (json) {
console.log('DASHBOARD.getReportWithWarningListData error'); if (callback) {
if (callback) { callback(json);
callback(PICKUP.defaultPickupList); }
} },
}); function () {
console.log('DASHBOARD.getReportWithWarningListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
},
);
}; };
/** /**
* Initialization pickup html * Initialization pickup html
*/ */
PICKUP.init = function() { PICKUP.init = function () {
console.log("PICKUP.init"); //Check if user is logged in
sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.DASHBOARD; COMMON.checkAuth(false);
TEMPLATE.loadHearder("#includedHeader");
TEMPLATE.loadConfirmModal("#includedConfirmModal"); console.log('PICKUP.init');
const navs = [ sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.DASHBOARD;
TEMPLATE.loadHearder('#includedHeader');
TEMPLATE.loadConfirmModal('#includedConfirmModal');
const navs = [
{ {
titleLang: 'dashboard', titleLang: 'dashboard',
href: 'dashboard.html', href: 'dashboard.html',
...@@ -126,610 +147,645 @@ PICKUP.init = function() { ...@@ -126,610 +147,645 @@ PICKUP.init = function() {
titleLang: 'pickup', titleLang: 'pickup',
}, },
]; ];
TEMPLATE.loadMainNavsTitle("#includedMainTitle", "pickup", navs, null); TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'pickup', navs, null);
PICKUP.initSettingActivePickup(); PICKUP.initSettingActivePickup();
PICKUP.settingPickup(); PICKUP.settingPickup();
} };
/** /**
* Setting pickup data * Setting pickup data
*/ */
PICKUP.settingPickup = function() { PICKUP.settingPickup = function () {
DashboardSetting.getSettingData(function (settings) { DashboardSetting.getSettingData(function (settings) {
$("#liTabNewReport").addClass('d-none'); $('#liTabNewReport').addClass('d-none');
$("#liTabContinousWork").addClass('d-none'); $('#liTabContinousWork').addClass('d-none');
$("#liTabReportWithWarning").addClass('d-none'); $('#liTabReportWithWarning').addClass('d-none');
if(settings.newReport) if (settings.newReport) {
{ $('#liTabNewReport').removeClass('d-none');
$("#liTabNewReport").removeClass('d-none'); PICKUP.initNewReportTab();
PICKUP.initNewReportTab(); }
} if (settings.continousWork) {
if(settings.continousWork) $('#liTabContinousWork').removeClass('d-none');
{ PICKUP.initContinuosWorkTab();
$("#liTabContinousWork").removeClass('d-none'); }
PICKUP.initContinuosWorkTab(); if (settings.warningReport) {
} $('#liTabReportWithWarning').removeClass('d-none');
if(settings.warningReport) PICKUP.initReportWithWarningsTab();
{ }
$("#liTabReportWithWarning").removeClass('d-none');
PICKUP.initReportWithWarningsTab();
}
}); });
} };
/** /**
* init Setting Active Pickup * init Setting Active Pickup
*/ */
PICKUP.initSettingActivePickup = function() { PICKUP.initSettingActivePickup = function () {
var urlParam = COMMON.getUrlParameter(); var urlParam = COMMON.getUrlParameter();
if(urlParam.pickupActive == undefined || urlParam.pickupActive == '' ) if (urlParam.pickupActive == undefined || urlParam.pickupActive == '') {
{ urlParam.pickupActive = PICKUP.pickupDefault;
urlParam.pickupActive = PICKUP.pickupDefault; }
} PICKUP.pickupActive = urlParam.pickupActive;
PICKUP.pickupActive = urlParam.pickupActive; PICKUP.settingActivePickup(PICKUP.pickupActive);
PICKUP.settingActivePickup(PICKUP.pickupActive); };
}
/** /**
* setting Active Pickup * setting Active Pickup
* @param {*} pickupActive * @param {*} pickupActive
* @returns * @returns
*/ */
PICKUP.settingActivePickup = function(pickupActive) { PICKUP.settingActivePickup = function (pickupActive) {
PICKUP.pickupActive = pickupActive; PICKUP.pickupActive = pickupActive;
$('#liTabNewReport a').removeClass('active'); $('#liTabNewReport a').removeClass('active');
$('#liTabContinousWork a').removeClass('active'); $('#liTabContinousWork a').removeClass('active');
$('#liTabReportWithWarning a').removeClass('active'); $('#liTabReportWithWarning a').removeClass('active');
$('#tab-content-NewReport').removeClass('active show'); $('#tab-content-NewReport').removeClass('active show');
$('#tab-content-ContinousWork').removeClass('active show'); $('#tab-content-ContinousWork').removeClass('active show');
$('#tab-content-ReportWithWarnings').removeClass('active show'); $('#tab-content-ReportWithWarnings').removeClass('active show');
if(pickupActive == "newReport") if (pickupActive == 'newReport') {
{ $('#liTabNewReport a').addClass('active');
$('#liTabNewReport a').addClass('active'); $('#tab-content-NewReport').addClass('active show');
$('#tab-content-NewReport').addClass('active show'); return;
return; }
}
if (pickupActive == 'continousWork') {
if(pickupActive == "continousWork") $('#liTabContinousWork a').addClass('active');
{ $('#tab-content-ContinousWork').addClass('active show');
$('#liTabContinousWork a').addClass('active'); return;
$('#tab-content-ContinousWork').addClass('active show'); }
return; if (pickupActive == 'reportWarning') {
} $('#liTabReportWithWarning a').addClass('active');
if(pickupActive == "reportWarning") $('#tab-content-ReportWithWarnings').addClass('active show');
{ return;
$('#liTabReportWithWarning a').addClass('active'); }
$('#tab-content-ReportWithWarnings').addClass('active show'); };
return;
}
}
/** /**
* Initialization show not found pickup item html * Initialization show not found pickup item html
* @param {*} elementId * @param {*} elementId
*/ */
PICKUP.showNotFoundPickupItem = function(elementId) { PICKUP.showNotFoundPickupItem = function (elementId) {
$(elementId).removeClass(); $(elementId).removeClass();
$(elementId).addClass('p-0 mt-3 card-list'); $(elementId).addClass('p-0 mt-3 card-list');
let li = $("<li class='card mb-2 not-found'></li>"); let li = $("<li class='card mb-2 not-found'></li>");
let div = $("<div class='text-dark mb-1 px-3 py-5 text-center m-auto'></div>"); let div = $("<div class='text-dark mb-1 px-3 py-5 text-center m-auto'></div>");
let imgdiv = $("<img src=\"../common/img/icon_not_found.svg\" alt='" + I18N.i18nText('msgNotFound') +"' class='not-found-img mb-2'>"); let imgdiv = $('<img src="../common/img/icon_not_found.svg" alt=\'' + I18N.i18nText('msgNotFound') + "' class='not-found-img mb-2'>");
let childDiv = $("<div class='fs-9 text-secondary font-weight-bold'>" + I18N.i18nText('msgNotFound') +"</div>"); let childDiv = $("<div class='fs-9 text-secondary font-weight-bold'>" + I18N.i18nText('msgNotFound') + '</div>');
div.append(imgdiv); div.append(imgdiv);
div.append(childDiv); div.append(childDiv);
li.append(div); li.append(div);
$(elementId).append(li); $(elementId).append(li);
} };
/** /**
* Initialization view pickup menu html * Initialization view pickup menu html
* @param {*} elementId * @param {*} elementId
* @param {*} count * @param {*} count
*/ */
PICKUP.showCountDisplayPickupItem = function(elementId, count) { PICKUP.showCountDisplayPickupItem = function (elementId, count) {
let span = $('<span>' + I18N.i18nText('display') +'</span>'); let span = $('<span>' + I18N.i18nText('display') + '</span>');
$(elementId).append(count); $(elementId).append(count);
$(elementId).append(span); $(elementId).append(span);
} };
/** /**
* Initialization new report list html * Initialization new report list html
*/ */
PICKUP.initNewReportTab = function() { PICKUP.initNewReportTab = function () {
PICKUP.getNewreportListData(function (json) { PICKUP.getNewreportListData(function (json) {
PICKUP.createNewReportList(json.operationList); PICKUP.createNewReportList(json.operationList);
}); });
} };
/** /**
* Initialization continuous work list html * Initialization continuous work list html
*/ */
PICKUP.initContinuosWorkTab = function() { PICKUP.initContinuosWorkTab = function () {
PICKUP.getContinuousWorkListData(function (json) { PICKUP.getContinuousWorkListData(function (json) {
PICKUP.createContinousWorkList(json.operationList); PICKUP.createContinousWorkList(json.operationList);
}); });
} };
/** /**
* Initialization continuous work list html * Initialization continuous work list html
*/ */
PICKUP.initReportWithWarningsTab = function() { PICKUP.initReportWithWarningsTab = function () {
PICKUP.getReportWithWarningsListData(function (json) { PICKUP.getReportWithWarningsListData(function (json) {
PICKUP.createReportWithWarningList(json.operationList); PICKUP.createReportWithWarningList(json.operationList);
}); });
} };
/** /**
* sort New report operation list * sort New report operation list
* @param {*} operationList * @param {*} operationList
* @returns * @returns
*/ */
PICKUP.sortNewReportList = function(operationList) { PICKUP.sortNewReportList = function (operationList) {
operationList = operationList.sort(function(a,b) { operationList = operationList.sort(function (a, b) {
if (a.operationId < b.operationId) return 1; if (a.operationId < b.operationId) return 1;
if (a.operationId > b.operationId) return -1; if (a.operationId > b.operationId) return -1;
return 0; return 0;
}); });
return operationList; return operationList;
} };
/** /**
* Implement new report list html * Implement new report list html
* @param {*} operationListOld * @param {*} operationListOld
* @returns * @returns
*/ */
PICKUP.createNewReportList = function(operationListOld) { PICKUP.createNewReportList = function (operationListOld) {
if (typeof operationListOld === 'undefined' || operationListOld.length < 1) { if (typeof operationListOld === 'undefined' || operationListOld.length < 1) {
PICKUP.showNotFoundPickupItem("#newReport-list"); PICKUP.showNotFoundPickupItem('#newReport-list');
$('#viewMenuNewReport').addClass('d-none'); $('#viewMenuNewReport').addClass('d-none');
return; return;
} }
let operationList = PICKUP.sortNewReportList(operationListOld); let operationList = PICKUP.sortNewReportList(operationListOld);
$('#viewMenuNewReport').removeClass('d-none'); $('#viewMenuNewReport').removeClass('d-none');
$("#newReport-list").empty(); $('#newReport-list').empty();
PICKUP.countNewReportList = 0; PICKUP.countNewReportList = 0;
$('#newReport-list').addClass('task-list view-content view-block'); $('#newReport-list').addClass('task-list view-content view-block');
let classIcon ; let classIcon;
for (let i = 0; i < operationList.length; i++) { for (let i = 0; i < operationList.length; i++) {
switch (operationList[i].reportType) switch (operationList[i].reportType) {
{ case PICKUP.REPORT_TYPE.REPORTONLY:
case PICKUP.REPORT_TYPE.REPORTONLY: classIcon = 'report';
classIcon = "report"; break;
break; case PICKUP.REPORT_TYPE.INSPECT:
case PICKUP.REPORT_TYPE.INSPECT: classIcon = 'inspection';
classIcon = "inspection"; break;
break; case PICKUP.REPORT_TYPE.WITHREPLY:
case PICKUP.REPORT_TYPE.WITHREPLY: classIcon = 'questionary';
classIcon = "questionary"; break;
break; case PICKUP.REPORT_TYPE.WORKFLOW:
case PICKUP.REPORT_TYPE.WORKFLOW: classIcon = 'proccess';
classIcon = "proccess"; break;
break; }
} 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=\"javascript:PICKUP.sendReportFormFromNewReport ('" '<a href="javascript:PICKUP.sendReportFormFromNewReport (\'' + operationList[i].operationId + "');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>",
+ operationList[i].operationId +"');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>"); );
let divIcon = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'>" let divIcon = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'>" + "<div class='type-icon'>" + "<span class='" + classIcon + "'></span>" + '</div></div>');
+ "<div class='type-icon'>"
+ "<span class='" + classIcon + "'></span>" let divText = $(
+ "</div></div>") "<div class='pl-5 h-100 d-flex align-items-center'>" + "<div class='w-100'>" + "<div class='fs-12 text-truncate'>" + operationList[i].operationName + '</div>' + '</div></div>',
);
let divText = $("<div class='pl-5 h-100 d-flex align-items-center'>" ahrefRequiredFlg.append(divIcon);
+ "<div class='w-100'>" ahrefRequiredFlg.append(divText);
+ "<div class='fs-12 text-truncate'>" + operationList[i].operationName + "</div>" messageli.append(ahrefRequiredFlg);
+ "</div></div>");
ahrefRequiredFlg.append(divIcon); $('#newReport-list').append(messageli);
ahrefRequiredFlg.append(divText); PICKUP.countNewReportList = PICKUP.countNewReportList + 1;
messageli.append(ahrefRequiredFlg); }
// show not found if
$("#newReport-list").append(messageli); if (PICKUP.countNewReportList == 0) {
PICKUP.countNewReportList = PICKUP.countNewReportList + 1; PICKUP.showNotFoundPickupItem('#newReport-list');
$('#viewMenuNewReport').addClass('d-none');
} return;
// show not found if
if (PICKUP.countNewReportList == 0) {
PICKUP.showNotFoundPickupItem("#newReport-list");
$('#viewMenuNewReport').addClass('d-none');
return;
} }
PICKUP.showCountDisplayPickupItem("#count-NewReport", PICKUP.countNewReportList ) PICKUP.showCountDisplayPickupItem('#count-NewReport', PICKUP.countNewReportList);
};
}
/** /**
* sort continuous work operation list * sort continuous work operation list
* @param {*} operationList * @param {*} operationList
* @returns * @returns
*/ */
PICKUP.sortContinousWorkList = function(operationList) { PICKUP.sortContinousWorkList = function (operationList) {
let newOperationList = []; let newOperationList = [];
for (let i = 0; i < operationList.length; i++) { for (let i = 0; i < operationList.length; i++) {
if (operationList[i].reportType === 3) if (operationList[i].reportType === 3) {
{ if (typeof operationList[i].processList === 'undefined') continue;
if(typeof operationList[i].processList === 'undefined' ) continue; if (operationList[i].processList && operationList[i].processList.length != 0) {
if (operationList[i].processList && operationList[i].processList.length != 0) for (let j = 0; j < operationList[i].processList.length; j++) {
{ if (typeof operationList[i].processList[j].phaseList === 'undefined') continue;
for( let j = 0; j < operationList[i].processList.length; j++ ) for (let g = 0; g < operationList[i].processList[j].phaseList.length; g++) {
{ if (operationList[i].processList[j].phaseList[g].phaseStatus != 999) {
if(typeof operationList[i].processList[j].phaseList === 'undefined' ) continue; let item = {
for(let g = 0; g < operationList[i].processList[j].phaseList.length; g++ ) reportType: operationList[i].reportType,
{ operationType: operationList[i].operationType,
if(operationList[i].processList[j].phaseList[g].phaseStatus != 999) phaseList: operationList[i].processList[j].phaseList,
{ processKey: operationList[i].processList[j].processKey,
let item = {reportType: operationList[i].reportType, permitCodeRequiredFlg: operationList[i].permitCodeRequiredFlg,
operationType: operationList[i].operationType, operationId: operationList[i].operationId,
phaseList: operationList[i].processList[j].phaseList, contentId: operationList[i].contentId,
processKey: operationList[i].processList[j].processKey, operationName: operationList[i].operationName,
permitCodeRequiredFlg: operationList[i].permitCodeRequiredFlg, taskCode: operationList[i].processList[j].taskCode,
operationId: operationList[i].operationId, taskKey: operationList[i].processList[j].taskKey,
contentId: operationList[i].contentId, taskName: operationList[i].processList[j].taskName,
operationName: operationList[i].operationName, updateDate: operationList[i].processList[j].phaseList[g].updateDate,
taskCode: operationList[i].processList[j].taskCode, phaseNo: operationList[i].processList[j].phaseList[g].phaseNo,
taskKey: operationList[i].processList[j].taskKey, phaseName: operationList[i].processList[j].phaseList[g].phaseName,
taskName: operationList[i].processList[j].taskName, };
updateDate: operationList[i].processList[j].phaseList[g].updateDate,
phaseNo: operationList[i].processList[j].phaseList[g].phaseNo,
phaseName: operationList[i].processList[j].phaseList[g].phaseName
};
newOperationList.push(item); newOperationList.push(item);
} }
}
} }
}
} }
} }
} newOperationList = newOperationList.sort(function (a, b) {
} if (!a.updateDate) {
newOperationList = newOperationList.sort(function(a,b) { a.updateDate = '1900-01-01 00:00:00';
if (!a.updateDate) { }
a.updateDate = "1900-01-01 00:00:00"; if (!b.updateDate) {
} b.updateDate = '1900-01-01 00:00:00';
if (!b.updateDate) { }
b.updateDate = "1900-01-01 00:00:00"; if (a.updateDate < b.updateDate) return 1;
} if (a.updateDate > b.updateDate) return -1;
if (a.updateDate < b.updateDate) return 1; return 0;
if (a.updateDate > b.updateDate) return -1; });
return 0; //console.log("newOperationList: " + JSON.stringify(newOperationList));
}); return newOperationList;
//console.log("newOperationList: " + JSON.stringify(newOperationList)); };
return newOperationList;
}
/** /**
* Implement continous work html * Implement continous work html
* @param {*} operationListOld * @param {*} operationListOld
* @returns * @returns
*/ */
PICKUP.createContinousWorkList = function(operationListOld) { PICKUP.createContinousWorkList = function (operationListOld) {
if (typeof operationListOld === 'undefined' || operationListOld.length < 1) { if (typeof operationListOld === 'undefined' || operationListOld.length < 1) {
PICKUP.showNotFoundPickupItem("#continousWork-list"); PICKUP.showNotFoundPickupItem('#continousWork-list');
$('#viewMenuContinuousWork').addClass('d-none'); $('#viewMenuContinuousWork').addClass('d-none');
return; return;
} }
let operationList = PICKUP.sortContinousWorkList(operationListOld); let operationList = PICKUP.sortContinousWorkList(operationListOld);
$('#viewMenuContinuousWork').removeClass('d-none'); $('#viewMenuContinuousWork').removeClass('d-none');
$("#continousWork-list").empty(); $('#continousWork-list').empty();
PICKUP.countContinousWorkReport = 0; PICKUP.countContinousWorkReport = 0;
$('#continousWork-list').addClass('task-list view-content view-block'); $('#continousWork-list').addClass('task-list view-content view-block');
for (let i = 0; i < operationList.length; i++) { for (let i = 0; i < operationList.length; i++) {
let directKey = operationList[i].processKey; let directKey = operationList[i].processKey;
if (operationList[i].operationType == PICKUP.OPERATION_TYPE.VTOUR || operationList[i].operationType == PICKUP.OPERATION_TYPE.PDF) { if (operationList[i].operationType == PICKUP.OPERATION_TYPE.VTOUR || operationList[i].operationType == PICKUP.OPERATION_TYPE.PDF) {
directKey = operationList[i].taskKey; directKey = operationList[i].taskKey;
}
let messageli = $("<li class='card mb-2' id = 'list_" + operationList[i].processKey + "$" + operationList[i].phaseNo + "'></li>") ;
let ahrefRequiredFlg ;
if (operationList[i].permitCodeRequiredFlg == 1)
{
ahrefRequiredFlg = $("<a href=\"javascript:CHK.displayAlert('onlyRfid');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
} }
else let messageli = $("<li class='card mb-2' id = 'list_" + operationList[i].processKey + '$' + operationList[i].phaseNo + "'></li>");
{
ahrefRequiredFlg = $("<a href=\"javascript:PICKUP.sendReportFormFromContinuousWork ('" let ahrefRequiredFlg;
+ operationList[i].operationId +"','" + operationList[i].taskKey + "','" + operationList[i].processKey + "'," + operationList[i].phaseNo + ");\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>"); if (operationList[i].permitCodeRequiredFlg == 1) {
ahrefRequiredFlg = $("<a href=\"javascript:CHK.displayAlert('onlyRfid');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
} else {
ahrefRequiredFlg = $(
'<a href="javascript:PICKUP.sendReportFormFromContinuousWork (\'' +
operationList[i].operationId +
"','" +
operationList[i].taskKey +
"','" +
operationList[i].processKey +
"'," +
operationList[i].phaseNo +
");\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>",
);
} }
let divProccess = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'><span class='proccess'></span></div></div>"); let divProccess = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'><span class='proccess'></span></div></div>");
let divInfor = $("<div class='pl-5 h-100 d-flex align-items-center'></div>");
let divChildInfor = $("<div class='w-100'></div>");
let divOperationName = $("<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" + operationList[i].phaseName + '</div>');
let divProcessName = $("<div class='fs-12 text-truncate'>" + operationList[i].operationName + '</div>');
let divReportInfor = $("<div class='d-flex justify-content-between align-items-center'></div>");
let divReportName = $("<div class='fs-10 text-truncate'>" + operationList[i].taskName + '</div>');
let divReportCode = $("<div class='fs-8 text-secondary text-truncate'>" + operationList[i].taskCode + '</div>');
let divInfor = $("<div class='pl-5 h-100 d-flex align-items-center'></div>"); divReportInfor.append(divReportName);
let divChildInfor = $("<div class='w-100'></div>"); divReportInfor.append(divReportCode);
let divOperationName = $("<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" + operationList[i].phaseName + "</div>");
let divProcessName = $("<div class='fs-12 text-truncate'>" + operationList[i].operationName + "</div>");
let divReportInfor = $("<div class='d-flex justify-content-between align-items-center'></div>");
let divReportName = $("<div class='fs-10 text-truncate'>" + operationList[i].taskName + "</div>");
let divReportCode = $("<div class='fs-8 text-secondary text-truncate'>" + operationList[i].taskCode + "</div>");
divReportInfor.append(divReportName);
divReportInfor.append(divReportCode);
divChildInfor.append(divOperationName); divChildInfor.append(divOperationName);
divChildInfor.append(divProcessName); divChildInfor.append(divProcessName);
divChildInfor.append(divReportInfor); divChildInfor.append(divReportInfor);
divInfor.append(divChildInfor); divInfor.append(divChildInfor);
ahrefRequiredFlg.append(divProccess); ahrefRequiredFlg.append(divProccess);
ahrefRequiredFlg.append(divInfor); ahrefRequiredFlg.append(divInfor);
messageli.append(ahrefRequiredFlg); messageli.append(ahrefRequiredFlg);
$("#continousWork-list").append(messageli); $('#continousWork-list').append(messageli);
PICKUP.countContinousWorkReport = PICKUP.countContinousWorkReport + 1; PICKUP.countContinousWorkReport = PICKUP.countContinousWorkReport + 1;
}
// show not found if
if (PICKUP.countContinousWorkReport == 0) {
PICKUP.showNotFoundPickupItem("#continousWork-list");
$('#viewMenuContinuousWork').addClass('d-none');
return;
} }
PICKUP.showCountDisplayPickupItem("#count-ContinuousWork", PICKUP.countContinousWorkReport )
// show not found if
if (PICKUP.countContinousWorkReport == 0) {
PICKUP.showNotFoundPickupItem('#continousWork-list');
$('#viewMenuContinuousWork').addClass('d-none');
return;
}
PICKUP.showCountDisplayPickupItem('#count-ContinuousWork', PICKUP.countContinousWorkReport);
}; };
/** /**
* sort report with warnings list * sort report with warnings list
* @param {*} operationList * @param {*} operationList
* @returns * @returns
*/ */
PICKUP.sortWarningList = function(operationList) { PICKUP.sortWarningList = function (operationList) {
let newOperationList = []; let newOperationList = [];
for (let i = 0; i < operationList.length; i++) { for (let i = 0; i < operationList.length; i++) {
if(typeof operationList[i].warningReportList === 'undefined' ) continue; if (typeof operationList[i].warningReportList === 'undefined') continue;
if (operationList[i].warningReportList && operationList[i].warningReportList.length != 0) if (operationList[i].warningReportList && operationList[i].warningReportList.length != 0) {
{ for (let j = 0; j < operationList[i].warningReportList.length; j++) {
for( let j = 0; j < operationList[i].warningReportList.length; j++ ) let item = {
{ reportType: operationList[i].reportType,
let item = {reportType: operationList[i].reportType, operationType: operationList[i].operationType,
operationType: operationList[i].operationType, permitCodeRequiredFlg: operationList[i].permitCodeRequiredFlg,
permitCodeRequiredFlg: operationList[i].permitCodeRequiredFlg, operationId: operationList[i].operationId,
operationId: operationList[i].operationId, contentId: operationList[i].contentId,
contentId: operationList[i].contentId, operationName: operationList[i].operationName,
operationName: operationList[i].operationName, taskCode: operationList[i].warningReportList[j].taskCode,
taskCode: operationList[i].warningReportList[j].taskCode, taskKey: operationList[i].warningReportList[j].taskKey,
taskKey: operationList[i].warningReportList[j].taskKey, taskName: operationList[i].warningReportList[j].taskName,
taskName: operationList[i].warningReportList[j].taskName, taskType: operationList[i].warningReportList[j].taskType,
taskType: operationList[i].warningReportList[j].taskType, updateDate: operationList[i].warningReportList[j].updateDate,
updateDate: operationList[i].warningReportList[j].updateDate, reportStartDateString: operationList[i].warningReportList[j].reportStartDateString,
reportStartDateString: operationList[i].warningReportList[j].reportStartDateString, reportEndDateString: operationList[i].warningReportList[j].reportEndDateString,
reportEndDateString: operationList[i].warningReportList[j].reportEndDateString, processKey: operationList[i].warningReportList[j].processKey,
processKey: operationList[i].warningReportList[j].processKey, phaseNo: operationList[i].warningReportList[j].phaseNo,
phaseNo: operationList[i].warningReportList[j].phaseNo, phaseName: operationList[i].warningReportList[j].phaseName,
phaseName: operationList[i].warningReportList[j].phaseName };
}; newOperationList.push(item);
newOperationList.push(item); }
} }
} }
} newOperationList = newOperationList.sort(function (a, b) {
newOperationList = newOperationList.sort(function(a,b) { if (!a.updateDate) {
if (!a.updateDate) { a.updateDate = '1900-01-01 00:00:00';
a.updateDate = "1900-01-01 00:00:00"; }
} if (!b.updateDate) {
if (!b.updateDate) { b.updateDate = '1900-01-01 00:00:00';
b.updateDate = "1900-01-01 00:00:00"; }
} if (a.updateDate < b.updateDate) return 1;
if (a.updateDate < b.updateDate) return 1; if (a.updateDate > b.updateDate) return -1;
if (a.updateDate > b.updateDate) return -1; return 0;
return 0; });
}); //console.log("newOperationList: " + JSON.stringify(newOperationList));
//console.log("newOperationList: " + JSON.stringify(newOperationList)); return newOperationList;
return newOperationList; };
}
/** /**
* init Warning Report With ReportOnly Type * init Warning Report With ReportOnly Type
* @param {*} report * @param {*} report
* @returns * @returns
*/ */
PICKUP.initWarningReportWithReportOnlyType = function(report) { PICKUP.initWarningReportWithReportOnlyType = function (report) {
let ele = $("<li class='card mb-2'>" let ele = $(
+ "<a href=\"javascript:PICKUP.sendReportFormFromWarningReport ('" "<li class='card mb-2'>" +
+ report.operationId +"'," + PICKUP.REPORT_TYPE.REPORTONLY + ",'" + report.taskKey + "', null,null,null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" '<a href="javascript:PICKUP.sendReportFormFromWarningReport (\'' +
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'>" report.operationId +
+ "<div class='type-icon'><span class='report'></span></div></div>" "'," +
+ "<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" PICKUP.REPORT_TYPE.REPORTONLY +
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>" ",'" +
+ "<div class='d-flex justify-content-between align-items-center'>" report.taskKey +
+ "<div class='fs-10 text-truncate'>" + report.taskName+ "</div>" "', null,null,null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" +
+ "<div class='fs-8 text-secondary text-truncate'> " + report.taskCode + "</div>" "<div class='position-absolute translate-middle top-50 left-0 ml-3'>" +
+ "</div></div></div></a></li>"); "<div class='type-icon'><span class='report'></span></div></div>" +
return ele; "<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" +
} "<div class='fs-12 text-truncate'>" +
report.operationName +
PICKUP.initWarningReportWithInspectType = function(report) { '</div>' +
let ele = $("<li class='card mb-2'>" "<div class='d-flex justify-content-between align-items-center'>" +
+ "<a href=\"javascript:PICKUP.sendReportFormFromWarningReport ('" "<div class='fs-10 text-truncate'>" +
+ report.operationId +"'," + PICKUP.REPORT_TYPE.INSPECT + ",'" + report.taskKey + "', null,null,null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" report.taskName +
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'>" '</div>' +
+ "<div class='type-icon'><span class='inspection'></span></div></div>" "<div class='fs-8 text-secondary text-truncate'> " +
+ "<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" report.taskCode +
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>" '</div>' +
+ "<div class='d-flex justify-content-between align-items-center'>" '</div></div></div></a></li>',
+ "<div class='fs-10 text-truncate'></div>" );
+ "<div class='fs-8 text-secondary text-truncate'>" + PICKUP.getInspectDate(report.reportStartDateString) + " ~ " + PICKUP.getInspectDate(report.reportEndDateString) return ele;
+ "</div></div></div></div></a></li>"); };
return ele;
} PICKUP.initWarningReportWithInspectType = function (report) {
let ele = $(
"<li class='card mb-2'>" +
'<a href="javascript:PICKUP.sendReportFormFromWarningReport (\'' +
report.operationId +
"'," +
PICKUP.REPORT_TYPE.INSPECT +
",'" +
report.taskKey +
"', null,null,null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" +
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>" +
"<div class='type-icon'><span class='inspection'></span></div></div>" +
"<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" +
"<div class='fs-12 text-truncate'>" +
report.operationName +
'</div>' +
"<div class='d-flex justify-content-between align-items-center'>" +
"<div class='fs-10 text-truncate'></div>" +
"<div class='fs-8 text-secondary text-truncate'>" +
PICKUP.getInspectDate(report.reportStartDateString) +
' ~ ' +
PICKUP.getInspectDate(report.reportEndDateString) +
'</div></div></div></div></a></li>',
);
return ele;
};
/** /**
* init Warning Report With AnswerReport Type * init Warning Report With AnswerReport Type
* @param {*} report * @param {*} report
* @param {*} reportTypeMsg * @param {*} reportTypeMsg
* @returns * @returns
*/ */
PICKUP.initWarningReportWithAnswerReportType = function(report, reportTypeMsg) { PICKUP.initWarningReportWithAnswerReportType = function (report, reportTypeMsg) {
let ele = $("<li class='card mb-2'>" let ele = $(
+ "<a href=\"javascript:PICKUP.sendReportFormFromWarningReport ('" "<li class='card mb-2'>" +
+ report.operationId +"'," + PICKUP.REPORT_TYPE.WITHREPLY + ",null, null,null," + report.replyNo +");\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" '<a href="javascript:PICKUP.sendReportFormFromWarningReport (\'' +
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'>" report.operationId +
+ "<span class='questionary'></span></div></div><div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" "'," +
+ "<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" + reportTypeMsg + "</div>" PICKUP.REPORT_TYPE.WITHREPLY +
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>" ',null, null,null,' +
+ "<div class='d-flex justify-content-between align-items-center'>" report.replyNo +
+ "<div class='fs-10 text-truncate'>" + report.taskName+ "</div>" ");\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" +
+ "<div class='fs-8 text-secondary text-truncate'>" + report.taskCode+ "</div>" "<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'>" +
+ "</div></div></div></a></li>"); "<span class='questionary'></span></div></div><div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" +
return ele; "<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" +
} reportTypeMsg +
'</div>' +
"<div class='fs-12 text-truncate'>" +
report.operationName +
'</div>' +
"<div class='d-flex justify-content-between align-items-center'>" +
"<div class='fs-10 text-truncate'>" +
report.taskName +
'</div>' +
"<div class='fs-8 text-secondary text-truncate'>" +
report.taskCode +
'</div>' +
'</div></div></div></a></li>',
);
return ele;
};
/** /**
* init Warning Report With Continuous Report Type * init Warning Report With Continuous Report Type
* @param {*} report * @param {*} report
* @returns * @returns
*/ */
PICKUP.initWarningReportWithContinuousReportType = function(report) { PICKUP.initWarningReportWithContinuousReportType = function (report) {
let directKey = report.processKey; let directKey = report.processKey;
if (report.operationType == PICKUP.OPERATION_TYPE.VTOUR || report.operationType == PICKUP.OPERATION_TYPE.PDF) { if (report.operationType == PICKUP.OPERATION_TYPE.VTOUR || report.operationType == PICKUP.OPERATION_TYPE.PDF) {
directKey = report.taskKey; directKey = report.taskKey;
if (report.phaseNo > 1) { if (report.phaseNo > 1) {
//find taskKey of phaseNo 1 //find taskKey of phaseNo 1
for (let k = 0; k < operationList.length; k++) { for (let k = 0; k < operationList.length; k++) {
if (operationList[k].phaseNo == 1 && operationList[k].processKey == report.processKey) { if (operationList[k].phaseNo == 1 && operationList[k].processKey == report.processKey) {
directKey = operationList[k].taskKey; directKey = operationList[k].taskKey;
break; break;
} }
} }
} }
} }
let ele = $("<li class='card mb-2'>" let ele = $(
+ "<a href=\"javascript:PICKUP.sendReportFormFromWarningReport ('" "<li class='card mb-2'>" +
+ report.operationId +"'," + PICKUP.REPORT_TYPE.WORKFLOW + ",null,'" + report.processKey +"' ,'"+ report.phaseNo +"',null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" '<a href="javascript:PICKUP.sendReportFormFromWarningReport (\'' +
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'>" report.operationId +
+ "<div class='type-icon'><span class='proccess'></span></div></div>" "'," +
+ "<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" PICKUP.REPORT_TYPE.WORKFLOW +
+ "<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" + report.phaseName + "</div>" ",null,'" +
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>" report.processKey +
+ "<div class='d-flex justify-content-between align-items-center'>" "' ,'" +
+ "<div class='fs-10 text-truncate'>" + report.taskName+ "</div>" report.phaseNo +
+ "<div class='fs-8 text-secondary text-truncate'>" + report.taskCode+ "</div>" "',null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" +
+ "</div></div></div></a></li>"); "<div class='position-absolute translate-middle top-50 left-0 ml-3'>" +
return ele; "<div class='type-icon'><span class='proccess'></span></div></div>" +
} "<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" +
"<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" +
report.phaseName +
'</div>' +
"<div class='fs-12 text-truncate'>" +
report.operationName +
'</div>' +
"<div class='d-flex justify-content-between align-items-center'>" +
"<div class='fs-10 text-truncate'>" +
report.taskName +
'</div>' +
"<div class='fs-8 text-secondary text-truncate'>" +
report.taskCode +
'</div>' +
'</div></div></div></a></li>',
);
return ele;
};
/** /**
* create Report With Warnings List html * create Report With Warnings List html
* @param {*} operationListOld * @param {*} operationListOld
* @returns * @returns
*/ */
PICKUP.createReportWithWarningList = function(operationListOld) { PICKUP.createReportWithWarningList = function (operationListOld) {
if (typeof operationListOld === 'undefined' || operationListOld.length < 1) { if (typeof operationListOld === 'undefined' || operationListOld.length < 1) {
PICKUP.showNotFoundPickupItem("#reportWithWarnings-list"); PICKUP.showNotFoundPickupItem('#reportWithWarnings-list');
$('#viewMenuReportWithWarnings').addClass('d-none'); $('#viewMenuReportWithWarnings').addClass('d-none');
return; return;
} }
let operationList = PICKUP.sortWarningList(operationListOld); let operationList = PICKUP.sortWarningList(operationListOld);
$('#viewMenuReportWithWarnings').removeClass('d-none'); $('#viewMenuReportWithWarnings').removeClass('d-none');
$("#reportWithWarnings-list").empty(); $('#reportWithWarnings-list').empty();
PICKUP.countReportWithWarning = 0; PICKUP.countReportWithWarning = 0;
$('#reportWithWarnings-list').addClass('task-list view-content view-block'); $('#reportWithWarnings-list').addClass('task-list view-content view-block');
const msgLevelReport = I18N.i18nText('reportLevelReport'); const msgLevelReport = I18N.i18nText('reportLevelReport');
const msgLevelAnswer = I18N.i18nText('reportLevelAnswer'); const msgLevelAnswer = I18N.i18nText('reportLevelAnswer');
for (let i = 0; i < operationList.length; i++) { for (let i = 0; i < operationList.length; i++) {
let operationNameLi; let operationNameLi;
switch (operationList[i].reportType) switch (operationList[i].reportType) {
{ case PICKUP.REPORT_TYPE.REPORTONLY:
case PICKUP.REPORT_TYPE.REPORTONLY: operationNameLi = PICKUP.initWarningReportWithReportOnlyType(operationList[i]);
operationNameLi = PICKUP.initWarningReportWithReportOnlyType(operationList[i]); break;
break; case PICKUP.REPORT_TYPE.INSPECT:
case PICKUP.REPORT_TYPE.INSPECT: operationNameLi = PICKUP.initWarningReportWithInspectType(operationList[i]);
operationNameLi = PICKUP.initWarningReportWithInspectType(operationList[i]); break;
break; case PICKUP.REPORT_TYPE.WITHREPLY: // report answer
case PICKUP.REPORT_TYPE.WITHREPLY: // report answer if (operationList[i].taskType == PICKUP.REPLYREPORT_TASK_TYPE.REPORT) {
if( operationList[i].taskType == PICKUP.REPLYREPORT_TASK_TYPE.REPORT ) operationNameLi = PICKUP.initWarningReportWithAnswerReportType(operationList[i], msgLevelReport);
{ } else {
operationNameLi = PICKUP.initWarningReportWithAnswerReportType(operationList[i], msgLevelReport); operationNameLi = PICKUP.initWarningReportWithAnswerReportType(operationList[i], msgLevelAnswer);
} }
else break;
{ case PICKUP.REPORT_TYPE.WORKFLOW: // continouswork
operationNameLi = PICKUP.initWarningReportWithAnswerReportType(operationList[i], msgLevelAnswer); operationNameLi = PICKUP.initWarningReportWithContinuousReportType(operationList[i]);
} break;
break; }
case PICKUP.REPORT_TYPE.WORKFLOW: // continouswork $('#reportWithWarnings-list').append(operationNameLi);
operationNameLi = PICKUP.initWarningReportWithContinuousReportType(operationList[i]); PICKUP.countReportWithWarning = PICKUP.countReportWithWarning + 1;
break; }
// show not found if
} if (PICKUP.countReportWithWarning == 0) {
$("#reportWithWarnings-list").append(operationNameLi); PICKUP.showNotFoundPickupItem('#reportWithWarnings-list');
PICKUP.countReportWithWarning = PICKUP.countReportWithWarning + 1; $('#viewMenuReportWithWarnings').addClass('d-none');
} return;
// show not found if
if (PICKUP.countReportWithWarning == 0) {
PICKUP.showNotFoundPickupItem("#reportWithWarnings-list");
$('#viewMenuReportWithWarnings').addClass('d-none');
return;
} }
PICKUP.showCountDisplayPickupItem("#count-ReportWithWarnings", PICKUP.countReportWithWarning ) PICKUP.showCountDisplayPickupItem('#count-ReportWithWarnings', PICKUP.countReportWithWarning);
}; };
/** /**
* get Inspect Date format * get Inspect Date format
* @param {*} dateString * @param {*} dateString
* @returns * @returns
*/ */
PICKUP.getInspectDate = function(dateString) { PICKUP.getInspectDate = function (dateString) {
let date = new Date(dateString) let date = new Date(dateString);
return date.getFullYear() + "/" + ("0" + (date.getMonth() + 1)).slice(-2) + "/" + ("0" + date.getDate()).slice(-2) ; return date.getFullYear() + '/' + ('0' + (date.getMonth() + 1)).slice(-2) + '/' + ('0' + date.getDate()).slice(-2);
} };
/** /**
* send data to open report form from New report pickup * send data to open report form from New report pickup
* @returns * @returns
*/ */
PICKUP.sendReportFormFromNewReport = function(operationId) { PICKUP.sendReportFormFromNewReport = function (operationId) {
//Transition to the report form or operation list screen //Transition to the report form or operation list screen
let params = {}; let params = {};
params.sid = COMMON.getSid(); params.sid = COMMON.getSid();
params.operationId = operationId; params.operationId = operationId;
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM ; let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM;
COMMON.postCommunication(url, params); COMMON.postCommunication(url, params);
} };
/** /**
* send data to open report form of event click continuous work operation report * send data to open report form of event click continuous work operation report
* @returns * @returns
*/ */
PICKUP.sendReportFormFromContinuousWork = function(operationId, taskKey, processKey,phaseNo) { PICKUP.sendReportFormFromContinuousWork = function (operationId, taskKey, processKey, phaseNo) {
//Transition to the report form or operation list screen //Transition to the report form or operation list screen
let params = {}; let params = {};
params.sid = COMMON.getSid(); params.sid = COMMON.getSid();
params.operationId = operationId; params.operationId = operationId;
params.processKey = processKey; params.processKey = processKey;
params.phaseNo = phaseNo; params.phaseNo = phaseNo;
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM ; let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM;
COMMON.postCommunication(url, params); COMMON.postCommunication(url, params);
} };
/** /**
* send data to open report form of event click warning operation report * send data to open report form of event click warning operation report
* @returns * @returns
*/ */
PICKUP.sendReportFormFromWarningReport = function(operationId,reportType, taskKey, processKey,phaseNo, replyNo) { PICKUP.sendReportFormFromWarningReport = function (operationId, reportType, taskKey, processKey, phaseNo, replyNo) {
//Transition to the report form or operation list screen //Transition to the report form or operation list screen
let params = {}; let params = {};
params.sid = COMMON.getSid(); params.sid = COMMON.getSid();
params.operationId = operationId; params.operationId = operationId;
switch(reportType) { switch (reportType) {
case PICKUP.REPORT_TYPE.REPORTONLY: case PICKUP.REPORT_TYPE.REPORTONLY:
params.taskKey = taskKey; params.taskKey = taskKey;
break; break;
case PICKUP.REPORT_TYPE.INSPECT: case PICKUP.REPORT_TYPE.INSPECT:
params.taskKey = taskKey; params.taskKey = taskKey;
break; break;
case PICKUP.REPORT_TYPE.WITHREPLY: case PICKUP.REPORT_TYPE.WITHREPLY:
params.replyNo = replyNo; params.replyNo = replyNo;
break; break;
case PICKUP.REPORT_TYPE.WORKFLOW: case PICKUP.REPORT_TYPE.WORKFLOW:
params.processKey = processKey; params.processKey = processKey;
params.phaseNo = phaseNo; params.phaseNo = phaseNo;
break; break;
} }
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM ; let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM;
COMMON.postCommunication(url, params); COMMON.postCommunication(url, params);
} };
/**
* 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;
...@@ -7,18 +12,20 @@ PushMessageDetail.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), Clie ...@@ -7,18 +12,20 @@ PushMessageDetail.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), Clie
*/ */
PushMessageDetail.dummyMessageDetailJson = { PushMessageDetail.dummyMessageDetailJson = {
pushMessageId: 1, pushMessageId: 1,
pushMessage: "内容が入ります。内容が入ります。内容が入ります。内容が入ります。", pushMessage: '内容が入ります。内容が入ります。内容が入ります。内容が入ります。',
pushSendDate: "2022/07/06 14:14", pushSendDate: '2022/07/06 14:14',
operationName: "絞り検索", operationName: '絞り検索',
pushSendLoginId: "agentec" pushSendLoginId: 'agentec',
} };
/** /**
* init when html loaded * init when html loaded
*/ */
PushMessageDetail.init = function() { PushMessageDetail.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
//load common html //load common html
TEMPLATE.loadHearder("#includedHeader"); TEMPLATE.loadHearder('#includedHeader');
const navs = [ const navs = [
{ {
titleLang: 'dashboard', titleLang: 'dashboard',
...@@ -32,44 +39,50 @@ PushMessageDetail.init = function() { ...@@ -32,44 +39,50 @@ PushMessageDetail.init = function() {
titleLang: 'messageDetail', titleLang: 'messageDetail',
}, },
]; ];
TEMPLATE.loadMainNavsTitle("#includedMainTitle", "messageDetail", navs, null); TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'messageDetail', navs, null);
//request message detail data //request message detail data
let urlParam = COMMON.getUrlParameter(); let urlParam = COMMON.getUrlParameter();
if (typeof urlParam !== 'object' || typeof urlParam.pushMessageId === 'undefined') { if (typeof urlParam !== 'object' || typeof urlParam.pushMessageId === 'undefined') {
return; return;
} }
PushMessageDetail.getMessageDetail(urlParam.pushMessageId, function(message) { PushMessageDetail.getMessageDetail(urlParam.pushMessageId, function (message) {
PushMessageDetail.showMessage(message); PushMessageDetail.showMessage(message);
}); });
} };
/** /**
* request message data * request message data
* @param {string} pushMessageId * @param {string} pushMessageId
* @param {object} callback * @param {object} callback
*/ */
PushMessageDetail.getMessageDetail = function(pushMessageId, callback) { PushMessageDetail.getMessageDetail = function (pushMessageId, callback) {
let param = { let param = {
sid: COMMON.getSid(), sid: COMMON.getSid(),
pushMessageId: pushMessageId pushMessageId: pushMessageId,
}; };
const url = PushMessageDetail.baseApiUrl; const url = PushMessageDetail.baseApiUrl;
COMMON.cmsAjax(url, param, true, function (json) { COMMON.cmsAjax(
if (callback && json && json.pushMessage) { url,
callback(json.pushMessage); param,
} true,
}, function() { function (json) {
console.log('PushMessageDetail.getMessageDetail error'); if (callback && json && json.pushMessage) {
}); callback(json.pushMessage);
} }
},
function () {
console.log('PushMessageDetail.getMessageDetail error');
},
);
};
/** /**
* Show message data * Show message data
* @param {object} message * @param {object} message
*/ */
PushMessageDetail.showMessage = function(message) { PushMessageDetail.showMessage = function (message) {
$('#content').text(message.pushMessage); $('#content').text(message.pushMessage);
$('#sendDate').text(message.pushSendDate); $('#sendDate').text(message.pushSendDate);
$('#operationName').text(message.operationName); $('#operationName').text(message.operationName);
$('#sender').text(message.pushSendLoginId); $('#sender').text(message.pushSendLoginId);
} };
...@@ -8,8 +8,10 @@ PushMessageList.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), Client ...@@ -8,8 +8,10 @@ PushMessageList.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), Client
/** /**
* Init when html onload * Init when html onload
*/ */
PushMessageList.init = function() { PushMessageList.init = function () {
TEMPLATE.loadHearder("#includedHeader"); //Check if user is logged in
COMMON.checkAuth(false);
TEMPLATE.loadHearder('#includedHeader');
const navs = [ const navs = [
{ {
titleLang: 'dashboard', titleLang: 'dashboard',
...@@ -19,44 +21,50 @@ PushMessageList.init = function() { ...@@ -19,44 +21,50 @@ PushMessageList.init = function() {
titleLang: 'messageListTitle', titleLang: 'messageListTitle',
}, },
]; ];
TEMPLATE.loadMainNavsTitle("#includedMainTitle", "messageListTitle", navs, null); TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'messageListTitle', navs, null);
PushMessageList.getMessageList(function(messageList) { PushMessageList.getMessageList(function (messageList) {
PushMessageList.generateMessageListHtml(messageList.pushMessageList); PushMessageList.generateMessageListHtml(messageList.pushMessageList);
}); });
} };
/** /**
* get Message List from CMS * get Message List from CMS
* @param {function} callback * @param {function} callback
*/ */
PushMessageList.getMessageList = function (callback) { PushMessageList.getMessageList = function (callback) {
let param = { let param = {
sid: COMMON.getSid(), sid: COMMON.getSid(),
}; };
const url = PushMessageList.baseApiUrl; const url = PushMessageList.baseApiUrl;
COMMON.cmsAjax(url, param, true, function (json) { COMMON.cmsAjax(
if (callback) { url,
callback(json); param,
} true,
}, function() { function (json) {
console.log('PushMessageList.getMessageList error'); if (callback) {
}); callback(json);
}
},
function () {
console.log('PushMessageList.getMessageList error');
},
);
}; };
/** /**
* handle click message event * handle click message event
* @param {string} pushMessageId * @param {string} pushMessageId
*/ */
PushMessageList.clickMessage = function(pushMessageId) { PushMessageList.clickMessage = function (pushMessageId) {
COMMON.goUrlWithCurrentParams('pushMessageDetail.html', {pushMessageId: pushMessageId}); COMMON.goUrlWithCurrentParams('pushMessageDetail.html', { pushMessageId: pushMessageId });
} };
/** /**
* generate message list html * generate message list html
* @param {array} messageList * @param {array} messageList
* @returns * @returns
*/ */
PushMessageList.generateMessageListHtml = function(messageList) { PushMessageList.generateMessageListHtml = function (messageList) {
if (typeof messageList === 'undefined' || messageList.length < 1) { if (typeof messageList === 'undefined' || messageList.length < 1) {
//show not found //show not found
$('#messageList .not-found').removeClass('d-none'); $('#messageList .not-found').removeClass('d-none');
...@@ -69,42 +77,45 @@ PushMessageList.generateMessageListHtml = function(messageList) { ...@@ -69,42 +77,45 @@ PushMessageList.generateMessageListHtml = function(messageList) {
var mTitle = message.pushMessage; var mTitle = message.pushMessage;
var mDate = message.pushSendDate; var mDate = message.pushSendDate;
var mSubtitle = message.operationName; var mSubtitle = message.operationName;
var messageLi = $('<li class="card mb-2" id="pushMessageId_' + messageId + '"/>'); var messageLi = $('<li class="card mb-2" id="pushMessageId_' + messageId + '"/>');
if (message.readingFlg) { if (message.readingFlg) {
messageLi.addClass('read'); messageLi.addClass('read');
} else { } else {
messageLi.addClass('unread'); messageLi.addClass('unread');
} }
var messageA = $('<a class="d-block px-3 py-2 text-decoration-none text-dark"/>'); var messageA = $('<a class="d-block px-3 py-2 text-decoration-none text-dark"/>');
messageA.attr('href', "javascript:PushMessageList.clickMessage('" + messageId +"');"); messageA.attr('href', "javascript:PushMessageList.clickMessage('" + messageId + "');");
var titleDiv = $('<div class="fs-12 text-truncate">' + mTitle + '</div>'); var titleDiv = $('<div class="fs-12 text-truncate">' + mTitle + '</div>');
var subTitleMainDiv = $('<div class="d-flex justify-content-between align-items-center"></div>'); var subTitleMainDiv = $('<div class="d-flex justify-content-between align-items-center"></div>');
var subTitleDiv = $('<div class="fs-10 text-truncate">' + mSubtitle + '</div>'); var subTitleDiv = $('<div class="fs-10 text-truncate">' + mSubtitle + '</div>');
var dateDiv = $('<div class="fs-8 text-secondary text-nowrap">' + mDate + '</div>'); var dateDiv = $('<div class="fs-8 text-secondary text-nowrap">' + mDate + '</div>');
subTitleMainDiv.append(subTitleDiv); subTitleMainDiv.append(subTitleDiv);
subTitleMainDiv.append(dateDiv); subTitleMainDiv.append(dateDiv);
messageA.append(titleDiv); messageA.append(titleDiv);
messageA.append(subTitleMainDiv); messageA.append(subTitleMainDiv);
messageLi.append(messageA); messageLi.append(messageA);
$('#messageList').append(messageLi); $('#messageList').append(messageLi);
} }
}; };
/** /**
* dummy message list JSON for test * dummy message list JSON for test
*/ */
PushMessageList.dummyMessageListJson = { PushMessageList.dummyMessageListJson = {
pushMessageList: [{ pushMessageList: [
pushMessageId: 1, {
pushMessage: 'メッセージ内容が入ります。', pushMessageId: 1,
pushSendDate: '2022/07/06 14:14', pushMessage: 'メッセージ内容が入ります。',
operationName: '作業名が入ります。', pushSendDate: '2022/07/06 14:14',
readingFlg: 0, operationName: '作業名が入ります。',
}, { readingFlg: 0,
pushMessageId: 2, },
pushMessage: 'メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。', {
pushSendDate: 'xxxxxxxxxxxxxxxxxxxxxxxxxx', pushMessageId: 2,
operationName: '作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。', pushMessage: 'メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。',
readingFlg: 1, pushSendDate: 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
}] operationName: '作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。',
readingFlg: 1,
},
],
}; };
/**
* ReportForm function js
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var RF = {};
RF.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
RF.loadCommon();
RF.initFormView();
};
RF.loadCommon = function () {
$('#includedHeader').load('../html/common/header.html', function () {
I18N.initi18n();
HEADER.init();
});
$('#includedConfirmModal').load('../html/common/confirm-modal.html', function () {
I18N.initi18n();
});
};
RF.initFormView = function () {
const urlParameterList = COMMON.getUrlParameter();
const operationId = urlParameterList['operationId'];
if (operationId) {
let params = {};
const taskKey = urlParameterList['taskKey'];
const replyNo = urlParameterList['replyNo'];
const processKey = urlParameterList['processKey'];
const phaseNo = urlParameterList['phaseNo'];
params.sid = COMMON.getSid();
params.operationId = operationId;
if (taskKey) params.taskKey = taskKey;
if (replyNo) params.replyNo = replyNo;
if (processKey) params.processKey = processKey;
if (phaseNo) params.phaseNo = phaseNo;
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM;
$('#report-form').load(url, params, function () {
initPageLoad();
});
} else {
COMMON.avwScreenMove('index.html');
}
};
// ReportList function js /**
* ReportList function js
*
* @since cms:1.4.3.2&1.4.3.3 web:1.0
**/
var RL = {}; var RL = {};
RL.init = function() { RL.init = function () {
console.log("ReportList init start"); //Check if user is logged in
// COMMON.checkAuth(true); COMMON.checkAuth(false);
console.log('ReportList init start');
RL.loadCommon(); RL.loadCommon();
RL.initTaskReportList(); RL.initTaskReportList();
}; };
RL.loadCommon = function() { RL.loadCommon = function () {
$("#includedHeader").load("../html/common/header.html" , function() { $('#includedHeader').load('../html/common/header.html', function () {
I18N.initi18n(); I18N.initi18n();
HEADER.init(); HEADER.init();
}); });
$("#includedConfirmModal").load("../html/common/confirmModal.html", function() { $('#includedConfirmModal').load('../html/common/confirmModal.html', function () {
I18N.initi18n(); I18N.initi18n();
}); });
} };
RL.initTaskReportList = function() { RL.initTaskReportList = function () {
if (sessionStorage.OL_operationId) { if (sessionStorage.OL_operationId) {
let params = {}; let params = {};
params.sid = COMMON.getSid(); params.sid = COMMON.getSid();
params.operationId = sessionStorage.OL_operationId; params.operationId = sessionStorage.OL_operationId;
params.returnUrl = CONSTANT.URL.WEB.BASE + CONSTANT.URL.WEB.OPERATION_LIST; params.returnUrl = CONSTANT.URL.WEB.BASE + CONSTANT.URL.WEB.OPERATION_LIST;
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.TASK_REPORT_LIST; let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.TASK_REPORT_LIST;
$("#reportList").load(url, params); $('#reportList').load(url, params);
} else { } else {
COMMON.displayAlert("error"); COMMON.displayAlert('error');
COMMON.avwScreenMove("index.html"); COMMON.avwScreenMove('index.html');
} }
} };
RL.goPdfPrint = function() {
COMMON.avwScreenMove("pdfPrint.html");
}
RL.goPdfPrint = function () {
COMMON.avwScreenMove('pdfPrint.html');
};
/** /**
* 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 = {};
...@@ -12,49 +12,49 @@ SendMessage.contentMaxLength = 207; ...@@ -12,49 +12,49 @@ SendMessage.contentMaxLength = 207;
* Get input content * Get input content
* @returns string * @returns string
*/ */
SendMessage.getCurrentMessageContent = function() { SendMessage.getCurrentMessageContent = function () {
return $('#messageContent').val(); return $('#messageContent').val();
} };
/** /**
* Get operation id selected * Get operation id selected
* @returns string * @returns string
*/ */
SendMessage.getCurrentOperationId = function() { SendMessage.getCurrentOperationId = function () {
return $('#operationSelected').attr('data-operation-id'); return $('#operationSelected').attr('data-operation-id');
} };
/** /**
* Get send type selected * Get send type selected
* @returns string * @returns string
*/ */
SendMessage.getCurrentSendType = function() { SendMessage.getCurrentSendType = function () {
return $('input[name="sendType"]:checked').val(); return $('input[name="sendType"]:checked').val();
} };
/** /**
* Check data required when send message request to cms * Check data required when send message request to cms
* @returns boolean * @returns boolean
*/ */
SendMessage.checkValidation = function() { SendMessage.checkValidation = function () {
const message = SendMessage.getCurrentMessageContent(); const message = SendMessage.getCurrentMessageContent();
if (!ValidationUtil.CheckRequiredForText(message)) { if (!ValidationUtil.CheckRequiredForText(message)) {
alert(I18N.i18nText('msgContentRequired')); alert(I18N.i18nText('msgContentRequired'));
return false; return false;
} }
if (!ValidationUtil.CheckMaxLengthForByte(message, SendMessage.contentMaxLength)) { if (!ValidationUtil.CheckMaxLengthForByte(message, SendMessage.contentMaxLength)) {
alert(COMMON.format(I18N.i18nText('msgContentInvalidLength'), SendMessage.contentMaxLength)); alert(COMMON.format(I18N.i18nText('msgContentInvalidLength'), SendMessage.contentMaxLength));
return false; return false;
} }
const operationId = SendMessage.getCurrentOperationId(); const operationId = SendMessage.getCurrentOperationId();
if (!ValidationUtil.IsNumber(operationId)) { if (!ValidationUtil.IsNumber(operationId)) {
alert(I18N.i18nText('msgOperationRequired')); alert(I18N.i18nText('msgOperationRequired'));
return false; return false;
} }
const sendType = SendMessage.getCurrentSendType(); const sendType = SendMessage.getCurrentSendType();
if (!ValidationUtil.IsNumber(sendType)) { if (!ValidationUtil.IsNumber(sendType)) {
alert(I18N.i18nText('msgSendTypeRequired')); alert(I18N.i18nText('msgSendTypeRequired'));
return false; return false;
} }
return true; return true;
}; };
...@@ -62,7 +62,7 @@ SendMessage.checkValidation = function() { ...@@ -62,7 +62,7 @@ SendMessage.checkValidation = function() {
/** /**
* handle click event of send button * handle click event of send button
*/ */
SendMessage.onClickSend = function() { SendMessage.onClickSend = function () {
if (!SendMessage.checkValidation()) { if (!SendMessage.checkValidation()) {
return; return;
} }
...@@ -74,39 +74,44 @@ SendMessage.onClickSend = function() { ...@@ -74,39 +74,44 @@ SendMessage.onClickSend = function() {
/** /**
* post message data to cms * post message data to cms
* @param {string} message * @param {string} message
* @param {long} operationId * @param {long} operationId
* @param {int} sendType - 0: Group, 1: All * @param {int} sendType - 0: Group, 1: All
*/ */
SendMessage.postMessage = function(message, operationId, sendType) { SendMessage.postMessage = function (message, operationId, sendType) {
let param = { let param = {
sid: COMMON.getSid(), sid: COMMON.getSid(),
message: message, message: message,
operationId: operationId, operationId: operationId,
sendType: sendType sendType: sendType,
}; };
COMMON.cmsAjax(SendMessage.baseApiUrl, param, false, function (json) { COMMON.cmsAjax(
SendMessage.baseApiUrl,
}, function() { param,
console.log('SendMessage.postMessage error'); false,
function (json) {},
}); function () {
console.log('SendMessage.postMessage error');
},
);
}; };
SendMessage.operationSelectedCallback = function(operationId, operationName) { SendMessage.operationSelectedCallback = function (operationId, operationName) {
$('#operationSelected').attr('data-operation-id', operationId); $('#operationSelected').attr('data-operation-id', operationId);
$('#operationSelected').text(operationName); $('#operationSelected').text(operationName);
} };
SendMessage.templateSelectedCallback = function(template) { SendMessage.templateSelectedCallback = function (template) {
$('#messageContent').val(template); $('#messageContent').val(template);
} };
/** /**
* init data, action when screen onload * init data, action when screen onload
*/ */
SendMessage.init = function () { SendMessage.init = function () {
TEMPLATE.loadHearder("#includedHeader"); //Check if user is logged in
COMMON.checkAuth(false);
TEMPLATE.loadHearder('#includedHeader');
const navs = [ const navs = [
{ {
titleLang: 'dashboard', titleLang: 'dashboard',
...@@ -116,7 +121,7 @@ SendMessage.init = function () { ...@@ -116,7 +121,7 @@ SendMessage.init = function () {
titleLang: 'sendMessageTitle', titleLang: 'sendMessageTitle',
}, },
]; ];
TEMPLATE.loadMainNavsTitle("#includedMainTitle", "sendMessageTitle", navs, null); TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'sendMessageTitle', navs, null);
TEMPLATE.loadOperationSelect('#includeOperationSelect', SendMessage.operationSelectedCallback); TEMPLATE.loadOperationSelect('#includeOperationSelect', SendMessage.operationSelectedCallback);
TEMPLATE.loadNotificationSelect('#includeTemplateModal', SendMessage.templateSelectedCallback); TEMPLATE.loadNotificationSelect('#includeTemplateModal', SendMessage.templateSelectedCallback);
$('#messageContent').attr('maxlength', SendMessage.contentMaxLength); $('#messageContent').attr('maxlength', SendMessage.contentMaxLength);
...@@ -124,4 +129,4 @@ SendMessage.init = function () { ...@@ -124,4 +129,4 @@ SendMessage.init = function () {
I18N.initi18n(); I18N.initi18n();
$("label[for='sendTypeGroup']").append(I18N.i18nText('labelSendTypeGroup')); $("label[for='sendTypeGroup']").append(I18N.i18nText('labelSendTypeGroup'));
$("label[for='sendTypeAll']").append(I18N.i18nText('labelSendTypeAll')); $("label[for='sendTypeAll']").append(I18N.i18nText('labelSendTypeAll'));
}; };
\ No newline at end of file
/// 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 = {};
// Init function of page // Init function of page
$(document).ready(function () { $(document).ready(function () {
//Check if user is logged in
COMMON.checkAuth(false); COMMON.checkAuth(false);
SETTINGS.initScreen(); SETTINGS.initScreen();
$("#dspPwdUpd1").click(SETTINGS.dspPwdUpd1_Click); $('#dspPwdUpd1').click(SETTINGS.dspPwdUpd1_Click);
}); });
// Process changing password // Process changing password
SETTINGS.dspPwdUpd1_Click = function(e) { SETTINGS.dspPwdUpd1_Click = function (e) {
e.preventDefault(); e.preventDefault();
var isOK = true; var isOK = true;
var msgError = $('#main-error-message'); var msgError = $('#main-error-message');
// Check validation // Check validation
if (!ValidationUtil.CheckRequiredForText(SETTINGS.getCurrentPassword())) { if (!ValidationUtil.CheckRequiredForText(SETTINGS.getCurrentPassword())) {
isOK = false; isOK = false;
msgError.html(COMMON.format(I18N.i18nText('msgEssential'), I18N.i18nText('txtPwdCurr')).toString()); msgError.html(COMMON.format(I18N.i18nText('msgEssential'), I18N.i18nText('txtPwdCurr')).toString());
msgError.show(); msgError.show();
} } else {
else {
if (!ValidationUtil.CheckRequiredForText(SETTINGS.getNewPassword())) { if (!ValidationUtil.CheckRequiredForText(SETTINGS.getNewPassword())) {
isOK = false; isOK = false;
msgError.html(COMMON.format(I18N.i18nText('msgEssential'), I18N.i18nText('txtPwdNew')).toString()); msgError.html(COMMON.format(I18N.i18nText('msgEssential'), I18N.i18nText('txtPwdNew')).toString());
msgError.show(); msgError.show();
} else if (!ValidationUtil.CheckRequiredForText(SETTINGS.getNewPasswordRe())) { } else if (!ValidationUtil.CheckRequiredForText(SETTINGS.getNewPasswordRe())) {
isOK = false; isOK = false;
msgError.html(COMMON.format(I18N.i18nText('msgEssential'), I18N.i18nText('txtPwdNewRe')).toString()); msgError.html(COMMON.format(I18N.i18nText('msgEssential'), I18N.i18nText('txtPwdNewRe')).toString());
...@@ -38,7 +41,6 @@ SETTINGS.dspPwdUpd1_Click = function(e) { ...@@ -38,7 +41,6 @@ SETTINGS.dspPwdUpd1_Click = function(e) {
} }
} }
if (isOK) { if (isOK) {
// Check min length // Check min length
if (!ValidationUtil.CheckMinLengthForByte(SETTINGS.getNewPassword(), 6)) { if (!ValidationUtil.CheckMinLengthForByte(SETTINGS.getNewPassword(), 6)) {
isOK = false; isOK = false;
...@@ -53,58 +55,53 @@ SETTINGS.dspPwdUpd1_Click = function(e) { ...@@ -53,58 +55,53 @@ SETTINGS.dspPwdUpd1_Click = function(e) {
} }
// Check at least 3 consecutive characters // Check at least 3 consecutive characters
if (ValidationUtil.HasSeqChar(SETTINGS.getNewPassword(), 3)) { if (ValidationUtil.HasSeqChar(SETTINGS.getNewPassword(), 3)) {
isOK = false; isOK = false;
msgError.html(I18N.i18nText('msgHasSeqChar')); msgError.html(I18N.i18nText('msgHasSeqChar'));
msgError.show(); msgError.show();
} }
// Check 4 same characters in before password // Check 4 same characters in before password
if (ValidationUtil.ContainSameSeqChar(SETTINGS.getCurrentPassword(), SETTINGS.getNewPassword(), 4)) { if (ValidationUtil.ContainSameSeqChar(SETTINGS.getCurrentPassword(), SETTINGS.getNewPassword(), 4)) {
isOK = false; isOK = false;
msgError.html(I18N.i18nText('msgContainSameSeqChar')); msgError.html(I18N.i18nText('msgContainSameSeqChar'));
msgError.show(); msgError.show();
} }
} }
// Do changing password // Do changing password
if (isOK) { if (isOK) {
var params = { var params = {
sid: ClientData.userInfo_sid(), sid: ClientData.userInfo_sid(),
loginId: ClientData.userInfo_loginId_session(), loginId: ClientData.userInfo_loginId_session(),
password: SETTINGS.getCurrentPassword(), password: SETTINGS.getCurrentPassword(),
newPassword: SETTINGS.getNewPassword(), newPassword: SETTINGS.getNewPassword(),
language: I18N.getCurrentLanguage(), language: I18N.getCurrentLanguage(),
appId: 4 appId: 4,
}; };
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PASSWORD_CHANGE; const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PASSWORD_CHANGE;
COMMON.cmsAjax(url, params, false, COMMON.cmsAjax(url, params, false, SETTINGS.avwCmsApi_passwordChange_success, SETTINGS.avwCmsApi_passwordChange_fail);
SETTINGS.avwCmsApi_passwordChange_success, } else {
SETTINGS.avwCmsApi_passwordChange_fail);
}
else {
//alert('error'); //alert('error');
} }
}; };
SETTINGS.avwCmsApi_passwordChange_success = function(data) { SETTINGS.avwCmsApi_passwordChange_success = function (data) {
// OK // OK
var msgError = $('#main-error-message'); var msgError = $('#main-error-message');
if (data.httpStatus != CONSTANT.HTTP_STATUS.OK) { if (data.httpStatus != CONSTANT.HTTP_STATUS.OK) {
msgError.html(I18N.i18nText('msgPwdChangeNG')); msgError.html(I18N.i18nText('msgPwdChangeNG'));
msgError.show(); msgError.show();
} } else {
else {
msgError.html(''); msgError.html('');
$("#txtPwdCur").val(""); $('#txtPwdCur').val('');
$("#txtPwdNew").val(""); $('#txtPwdNew').val('');
$("#txtPwdNewRe").val(""); $('#txtPwdNewRe').val('');
/* show messages */ /* show messages */
COMMON.displayAlert('msgPwdChangeOK'); COMMON.displayAlert('msgPwdChangeOK');
} }
}; };
SETTINGS.avwCmsApi_passwordChange_fail = function(xhr, b, c) { SETTINGS.avwCmsApi_passwordChange_fail = function (xhr, b, c) {
/* show error messages */ /* show error messages */
var msgError = $('#main-error-message'); var msgError = $('#main-error-message');
if (xhr.errorMessage && xhr.httpStatus != 0) { if (xhr.errorMessage && xhr.httpStatus != 0) {
...@@ -115,7 +112,6 @@ SETTINGS.avwCmsApi_passwordChange_fail = function(xhr, b, c) { ...@@ -115,7 +112,6 @@ SETTINGS.avwCmsApi_passwordChange_fail = function(xhr, b, c) {
msgError.show(); msgError.show();
}; };
/* /*
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Event groups [ end ] Event groups [ end ]
...@@ -123,33 +119,32 @@ Event groups [ end ] ...@@ -123,33 +119,32 @@ Event groups [ end ]
*/ */
// Get input current password // Get input current password
SETTINGS.getCurrentPassword = function() { SETTINGS.getCurrentPassword = function () {
return $("#txtPwdCur").val(); return $('#txtPwdCur').val();
}; };
// Get input new password // Get input new password
SETTINGS.getNewPassword = function() { SETTINGS.getNewPassword = function () {
return $("#txtPwdNew").val(); return $('#txtPwdNew').val();
}; };
// Get input new password // Get input new password
SETTINGS.getNewPasswordRe = function() { SETTINGS.getNewPasswordRe = function () {
return $("#txtPwdNewRe").val(); return $('#txtPwdNewRe').val();
}; };
// Initalize screen // Initalize screen
SETTINGS.initScreen = function() { SETTINGS.initScreen = function () {
$("#includedHeader").load("../html/common/header.html" , function() { $('#includedHeader').load('../html/common/header.html', function () {
I18N.initi18n(); I18N.initi18n();
HEADER.init(); HEADER.init();
}); });
$("#includedConfirmModal").load("../html/common/confirmModal.html", function() { $('#includedConfirmModal').load('../html/common/confirmModal.html', function () {
I18N.initi18n(); I18N.initi18n();
}); });
// Login ID // Login ID
$("#txtLoginId").text(ClientData.userInfo_loginId_session()); $('#txtLoginId').text(ClientData.userInfo_loginId_session());
// Account Path // Account Path
$("#txtLoginAccPath").text(ClientData.userInfo_accountPath_session()); $('#txtLoginAccPath').text(ClientData.userInfo_accountPath_session());
// Recent login date // Recent login date
$("#txtLastLoginTime").text(ClientData.userInfo_lastLoginTime()); $('#txtLastLoginTime').text(ClientData.userInfo_lastLoginTime());
}; };
/** /**
* template js * template js
* @since cms:1.4.3.2&1.4.3.3 web:1.0 * @since cms:1.4.3.2&1.4.3.3 web:1.0
*/ */
var TEMPLATE = {}; var TEMPLATE = {};
/** template load header */ /** template load header */
TEMPLATE.loadHearder = function(elmentId) { TEMPLATE.loadHearder = function (elmentId) {
$(elmentId).load("../html/common/header.html" , function() { $(elmentId).load('../html/common/header.html', function () {
$("#iconHomeDashboard").removeClass('active'); $('#iconHomeDashboard').removeClass('active');
$("#iconHomeWorkList").removeClass('active'); $('#iconHomeWorkList').removeClass('active');
if(sessionStorage.activeHomePage == CONSTANT.PAGE_NAME.OPERATION_LIST) if (sessionStorage.activeHomePage == CONSTANT.PAGE_NAME.OPERATION_LIST) {
{ $('#iconHomeWorkList').addClass('active');
$("#iconHomeWorkList").addClass('active'); } else {
} $('#iconHomeDashboard').addClass('active');
else
{
$("#iconHomeDashboard").addClass('active');
} }
I18N.initi18n(); I18N.initi18n();
}); });
} };
/** /**
* template load dashboard setting * template load dashboard setting
* @param {string} elmentId - element to load setting html * @param {string} elmentId - element to load setting html
* @param {*} changeCallback - callback when setting changed * @param {*} changeCallback - callback when setting changed
*/ */
TEMPLATE.loadDashboardSetting = function(elmentId, changeCallback) { TEMPLATE.loadDashboardSetting = function (elmentId, changeCallback) {
$(elmentId).load("dashboardSetting.html", function() { $(elmentId).load('dashboardSetting.html', function () {
DashboardSetting.init(changeCallback); DashboardSetting.init(changeCallback);
I18N.initi18n(); I18N.initi18n();
}); });
} };
/** Template load confirm model */ /** Template load confirm model */
TEMPLATE.loadConfirmModal = function(elmentId) { TEMPLATE.loadConfirmModal = function (elmentId) {
$(elmentId).load("../html/common/confirmModal.html", function() { $(elmentId).load('../html/common/confirmModal.html', function () {
I18N.initi18n(); I18N.initi18n();
}); });
} };
/** Template load operation select */ /** Template load operation select */
TEMPLATE.loadOperationSelect = function(elmentId, selectCallback) { TEMPLATE.loadOperationSelect = function (elmentId, selectCallback) {
$(elmentId).load("operationSelect.html", function() { $(elmentId).load('operationSelect.html', function () {
OperationSelect.init(selectCallback); OperationSelect.init(selectCallback);
I18N.initi18n(); I18N.initi18n();
}); });
} };
/** /**
* show confirm model * show confirm model
*/ */
TEMPLATE.showModalConfirm = function () { TEMPLATE.showModalConfirm = function () {
$("#showConfirm").click(function(){ $('#showConfirm').click(function () {
$("#confirm-modal").modal(); $('#confirm-modal').modal();
}); });
}; };
/** Template load notification content*/ /** Template load notification content*/
TEMPLATE.loadNotificationSelect = function(elmentId, selectCallback) { TEMPLATE.loadNotificationSelect = function (elmentId, selectCallback) {
$(elmentId).load("notificationContent.html", function() { $(elmentId).load('notificationContent.html', function () {
NotificationSelect.init(selectCallback); NotificationSelect.init(selectCallback);
I18N.initi18n(); I18N.initi18n();
}); });
} };
/** /**
* load main navs title html to a element by id * load main navs title html to a element by id
...@@ -71,15 +68,15 @@ TEMPLATE.loadNotificationSelect = function(elmentId, selectCallback) { ...@@ -71,15 +68,15 @@ TEMPLATE.loadNotificationSelect = function(elmentId, selectCallback) {
* @param {string} titleLang - lang of title * @param {string} titleLang - lang of title
* @param {Array} navs - array nav items (titleLang, href) * @param {Array} navs - array nav items (titleLang, href)
*/ */
TEMPLATE.loadMainNavsTitle = function(elmentId, titleLang, navs, completeCallback) { TEMPLATE.loadMainNavsTitle = function (elmentId, titleLang, navs, completeCallback) {
var titleHtmlPath = '../common/mainTitle.html'; var titleHtmlPath = '../common/html/mainTitle.html';
if (navs) { if (navs) {
titleHtmlPath = '../common/mainNavTitle.html'; titleHtmlPath = '../common/html/mainNavTitle.html';
} }
$(elmentId).load(titleHtmlPath , function(data) { $(elmentId).load(titleHtmlPath, function (data) {
$(elmentId).replaceWith(data); $(elmentId).replaceWith(data);
if (titleLang) { if (titleLang) {
$('#mainTitleHeader').attr("lang", titleLang); $('#mainTitleHeader').attr('lang', titleLang);
} }
if (navs) { if (navs) {
var olElm = $('#mainTitleNavs ol'); var olElm = $('#mainTitleNavs ol');
...@@ -109,4 +106,4 @@ TEMPLATE.loadNotificationSelect = function(elmentId, selectCallback) { ...@@ -109,4 +106,4 @@ TEMPLATE.loadNotificationSelect = function(elmentId, selectCallback) {
completeCallback(); completeCallback();
} }
}); });
} };
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