Commit 88a663f9 by Kang Donghun

パンくずボタン修正

parent e70749f2
......@@ -20,7 +20,14 @@ CONSTANT.PAGE_NAME = {
DASHBOARD: 'dashboard',
OPERATION_LIST: 'workList',
REPORT_LIST: 'reportList',
DEFAULT: 'index.html',
REPORT_FORM: 'reportForm',
MESSAGE_DETAIL: 'pushMessageDetail',
MESSAGE_LIST: 'pushMessageList',
SEND_MESSAGE: 'sendMessage',
SETTING: 'accountSetting',
PICKUP: 'pickup',
PDF_PRINT: 'pdfPrint',
DEFAULT: 'index',
LOGIN: './login.html',
};
......@@ -34,15 +41,25 @@ CONSTANT.URL_TREE_NAME = {
SEND_MESSAGE: 'sendMessage.html',
SETTING: 'accountSetting.html',
PICKUP: 'pickup.html',
PICKUP_NEW: 'pickup.html?pickupActive=newReport',
PICKUP_CONTINUOS: 'pickup.html?pickupActive=continousWork',
PICKUP_WARNING: 'pickup.html?pickupActive=warningReport',
PDF_PRINT: 'pdfPrint.html',
};
CONSTANT.PICK_UP_TYPE = {
NEW_REPORT : 'newReport',
CONTINOUS_WORK : 'continousWork',
WARNING_REPORT : 'warningReport',
}
CONSTANT.URL_TREE_PASS = {
1: [CONSTANT.URL_TREE_NAME.DASHBOARD, CONSTANT.URL_TREE_NAME.PICKUP, CONSTANT.URL_TREE_NAME.REPORT_LIST, CONSTANT.URL_TREE_NAME.REPORT_FORM],
2: [CONSTANT.URL_TREE_NAME.DASHBOARD, CONSTANT.URL_TREE_NAME.PICKUP, CONSTANT.URL_TREE_NAME.REPORT_FORM],
3: [CONSTANT.URL_TREE_NAME.DASHBOARD, CONSTANT.URL_TREE_NAME.MESSAGE_LIST, CONSTANT.URL_TREE_NAME.MESSAGE_DETAIL],
4: [CONSTANT.URL_TREE_NAME.DASHBOARD, CONSTANT.URL_TREE_NAME.SEND_MESSAGE],
5: [CONSTANT.URL_TREE_NAME.OPERATION_LIST, CONSTANT.URL_TREE_NAME.REPORT_LIST, CONSTANT.URL_TREE_NAME.REPORT_FORM],
5: [CONSTANT.URL_TREE_NAME.OPERATION_LIST, CONSTANT.URL_TREE_NAME.REPORT_FORM],
6: [CONSTANT.URL_TREE_NAME.OPERATION_LIST, CONSTANT.URL_TREE_NAME.REPORT_LIST, CONSTANT.URL_TREE_NAME.PDF_PRINT],
};
......
......@@ -19,85 +19,191 @@ HEADER.init = function () {
/**
* create url tree & show breadcrumbs list
*/
HEADER.urlTree = function () {
const pathName = location.pathname;
const htmlName = pathName.substring(pathName.lastIndexOf('/') + 1);
// HEADER.urlTree = function () {
// const pathUrl = location.pathname;
// const htmlName = pathUrl.substring(pathUrl.lastIndexOf('/') + 1);
// let pageName = urlPath.substring(0, urlPath.indexOf(".html"));
// if (pageName == CONSTANT.URL.WEB.OPERATION_LIST) pageName = CONSTANT.PAGE_NAME.OPERATION_LIST;
// check auth
let authFlg = false;
if ((htmlName == CONSTANT.URL_TREE_NAME.OPERATION_LIST) || (htmlName == CONSTANT.URL_TREE_NAME.DASHBOARD)) {
authFlg = true;
sessionStorage.urlTree = null;
}
//now url tree
const urlTree = sessionStorage.urlTree ? JSON.parse(sessionStorage.urlTree) : sessionStorage.urlTree;
// return;
if (urlTree) {
urlList: for (var i=0; i<urlTree.length; i++) {
const urlHtmlUrl = urlTree[i].href;
const urlHtmlHref = urlHtmlUrl.includes('?') ? urlHtmlUrl.substring(0, urlHtmlUrl.indexOf('?')) : urlHtmlUrl;
for (var v in CONSTANT.URL_TREE_PASS) {
findUrl: for (var k in CONSTANT.URL_TREE_PASS[v]) {
if (urlHtmlHref == CONSTANT.URL_TREE_PASS[v][k]) {
if (htmlName == CONSTANT.URL_TREE_PASS[v][k]) {
authFlg = true;
break urlList;
}
continue;
} else if ((urlHtmlHref != CONSTANT.URL_TREE_PASS[v][k]) && (htmlName == CONSTANT.URL_TREE_PASS[v][k])) {
authFlg = true;
break urlList;
} else {
break findUrl;
// // session reset
// if ((htmlName == CONSTANT.URL_TREE_NAME.OPERATION_LIST) || (htmlName == CONSTANT.URL_TREE_NAME.DASHBOARD)) {
// sessionStorage.pickUpParams = null;
// }
}
}
}
}
}
// let navs;
// switch (htmlName) {
// case CONSTANT.URL_TREE_NAME.DASHBOARD:
// case CONSTANT.URL_TREE_NAME.OPERATION_LIST:
// if (sessionStorage.urlTree) sessionStorage.urlTree = null;
// if (sessionStorage.pickUpType) sessionStorage.pickUpType = null;
// break;
// case CONSTANT.URL_TREE_NAME.PICKUP :
// navs = [
// {
// titleLang: CONSTANT.PAGE_NAME.DASHBOARD,
// href: CONSTANT.URL_TREE_NAME.DASHBOARD,
// },
// {
// titleLang: CONSTANT.PAGE_NAME.PICKUP,
// },
// ];
// break;
// case CONSTANT.URL_TREE_NAME.REPORT_LIST:
// if (sessionStorage.activeHomePage == CONSTANT.PAGE_TAB.DASHBOARD) {
// if (sessionStorage.pickUpType) {
// if (sessionStorage.pickUpType == CONSTANT.PICK_UP_TYPE.CONTINOUS_WORK) {
// navs = [
// {
// titleLang: CONSTANT.PAGE_NAME.DASHBOARD,
// href: CONSTANT.URL_TREE_NAME.DASHBOARD,
// },
// {
// titleLang: CONSTANT.PAGE_NAME.PICKUP,
// href: CONSTANT.URL_TREE_NAME.PICKUP_CONTINUOS,
// },
// {
// titleLang: CONSTANT.PAGE_NAME.REPORT_LIST,
// },
// ]
// } else if (sessionStorage.pickUpType == CONSTANT.PICK_UP_TYPE.WARNING_REPORT) {
// navs = [
// {
// titleLang: CONSTANT.PAGE_NAME.DASHBOARD,
// href: CONSTANT.URL_TREE_NAME.DASHBOARD,
// },
// {
// titleLang: CONSTANT.PAGE_NAME.PICKUP,
// href: CONSTANT.URL_TREE_NAME.PICKUP_WARNING,
// },
// {
// titleLang: CONSTANT.PAGE_NAME.REPORT_LIST,
// },
// ]
// } else {
// navs = [
// {
// titleLang: CONSTANT.PAGE_NAME.DASHBOARD,
// href: CONSTANT.URL_TREE_NAME.DASHBOARD,
// },
// {
// titleLang: CONSTANT.PAGE_NAME.PICKUP,
// href: CONSTANT.URL_TREE_NAME.PICKUP_NEW,
// },
// {
// titleLang: CONSTANT.PAGE_NAME.REPORT_LIST,
// },
// ]
// }
// } else {
// navs = [
// {
// titleLang: CONSTANT.PAGE_NAME.DASHBOARD,
// href: CONSTANT.URL_TREE_NAME.DASHBOARD,
// },
// {
// titleLang: CONSTANT.PAGE_NAME.PICKUP,
// href: CONSTANT.URL_TREE_NAME.PICKUP,
// },
// {
// titleLang: CONSTANT.PAGE_NAME.REPORT_LIST,
// },
// ]
// }
// } else {
// if (sessionStorage.pickUpType) sessionStorage.pickUpType = null;
// navs = [
// {
// titleLang: CONSTANT.PAGE_NAME.OPERATION_LIST,
// href: CONSTANT.URL_TREE_NAME.OPERATION_LIST,
// },
// {
// titleLang: CONSTANT.PAGE_NAME.REPORT_LIST,
// },
// ]
// }
// break;
// case CONSTANT.URL_TREE_NAME.REPORT_FORM:
// break;
// }
// CONSTANT.URL_TREE_PASS = {
// 1: [CONSTANT.URL_TREE_NAME.DASHBOARD, CONSTANT.URL_TREE_NAME.PICKUP, CONSTANT.URL_TREE_NAME.REPORT_LIST, CONSTANT.URL_TREE_NAME.REPORT_FORM],
// 2: [CONSTANT.URL_TREE_NAME.DASHBOARD, CONSTANT.URL_TREE_NAME.PICKUP, CONSTANT.URL_TREE_NAME.REPORT_FORM],
// 3: [CONSTANT.URL_TREE_NAME.DASHBOARD, CONSTANT.URL_TREE_NAME.MESSAGE_LIST, CONSTANT.URL_TREE_NAME.MESSAGE_DETAIL],
// 4: [CONSTANT.URL_TREE_NAME.DASHBOARD, CONSTANT.URL_TREE_NAME.SEND_MESSAGE],
// 5: [CONSTANT.URL_TREE_NAME.OPERATION_LIST, CONSTANT.URL_TREE_NAME.REPORT_LIST, CONSTANT.URL_TREE_NAME.REPORT_FORM],
// 6: [CONSTANT.URL_TREE_NAME.OPERATION_LIST, CONSTANT.URL_TREE_NAME.REPORT_LIST, CONSTANT.URL_TREE_NAME.PDF_PRINT],
// };
// //now url tree
// // const urlTree = sessionStorage.urlTree ? JSON.parse(sessionStorage.urlTree) : sessionStorage.urlTree;
// // console.log("kdh check urlTree : " + urlTree);
// // // return;
// // if (urlTree) {
// // urlList: for (var i = 0; i < urlTree.length; i++) {
// // const urlHtmlUrl = urlTree[i].href;
// // const urlHtmlHref = urlHtmlUrl.includes('?') ? urlHtmlUrl.substring(0, urlHtmlUrl.indexOf('?')) : urlHtmlUrl;
// // for (var v in CONSTANT.URL_TREE_PASS) {
// // findUrl: for (var k in CONSTANT.URL_TREE_PASS[v]) {
// // if (urlHtmlHref == CONSTANT.URL_TREE_PASS[v][k]) {
// // if (htmlName == CONSTANT.URL_TREE_PASS[v][k]) {
// // authFlg = true;
// // break urlList;
// // }
// // continue;
// // } else if ((urlHtmlHref != CONSTANT.URL_TREE_PASS[v][k]) && (htmlName == CONSTANT.URL_TREE_PASS[v][k])) {
// // authFlg = true;
// // break urlList;
// // } else {
// // break findUrl;
// // }
// // }
// // }
// // }
// // }
if (authFlg) {
const urlPath = htmlName + location.search;
let pageName = urlPath.substring(0, urlPath.indexOf(".html"));
if (pageName == CONSTANT.URL.WEB.OPERATION_LIST) pageName = CONSTANT.PAGE_NAME.OPERATION_LIST;
let addReportFlg = "0"
if (urlPath.includes(CONSTANT.URL_TREE_NAME.REPORT_FORM) && urlPath.includes("addReport")) {
addReportFlg = urlPath.substring(urlPath.indexOf("addReport=") + 10);
}
let newUrlTree = [];
if (urlTree) {
let isAdd = false;
for (var i = 0; i < urlTree.length; i++) {
const sessionUrl = urlTree[i].href.includes('?') ? urlTree[i].href.substring(0, urlTree[i].href.indexOf('?')) : urlTree[i].href;
const urlHtmlName = urlPath.includes('?') ? urlPath.substring(0, urlPath.indexOf('?')) : urlPath;
if (sessionUrl == urlHtmlName) {
if (addReportFlg == "1") {
var nav = {titleLang : CONSTANT.PAGE_NAME.REPORT_LIST , href : CONSTANT.URL_TREE_NAME.REPORT_LIST};
newUrlTree.push(nav);
};
var nav = {titleLang : pageName , href : urlPath};
newUrlTree.push(nav);
isAdd = true;
break;
} else {
newUrlTree.push(urlTree[i]);
};
};
if (!isAdd) {
const nav = {titleLang : pageName , href : urlPath};
newUrlTree.push(nav);
}
} else {
const nav = {titleLang : pageName , href : urlPath};
newUrlTree.push(nav);
}
sessionStorage.urlTree = JSON.stringify(newUrlTree);
// // if (authFlg) {
// // const urlPath = htmlName + location.search;
// // let pageName = urlPath.substring(0, urlPath.indexOf(".html"));
// // if (pageName == CONSTANT.URL.WEB.OPERATION_LIST) pageName = CONSTANT.PAGE_NAME.OPERATION_LIST;
// // let addReportFlg = "0"
// // if (urlPath.includes(CONSTANT.URL_TREE_NAME.REPORT_FORM) && urlPath.includes("addReport")) {
// // addReportFlg = urlPath.substring(urlPath.indexOf("addReport=") + 10);
// // }
// // let newUrlTree = [];
// // if (urlTree) {
// // let isAdd = false;
// // for (var i = 0; i < urlTree.length; i++) {
// // const sessionUrl = urlTree[i].href.includes('?') ? urlTree[i].href.substring(0, urlTree[i].href.indexOf('?')) : urlTree[i].href;
// // const urlHtmlName = urlPath.includes('?') ? urlPath.substring(0, urlPath.indexOf('?')) : urlPath;
// // if (sessionUrl == urlHtmlName) {
// // if (addReportFlg == "1") {
// // var nav = {titleLang : CONSTANT.PAGE_NAME.REPORT_LIST , href : CONSTANT.URL_TREE_NAME.REPORT_LIST};
// // newUrlTree.push(nav);
// // };
// // var nav = {titleLang : pageName , href : urlPath};
// // newUrlTree.push(nav);
// // isAdd = true;
// // break;
// // } else {
// // newUrlTree.push(urlTree[i]);
// // };
// // };
// // if (!isAdd) {
// // const nav = {titleLang : pageName , href : urlPath};
// // newUrlTree.push(nav);
// // }
// // } else {
// // const nav = {titleLang : pageName , href : urlPath};
// // newUrlTree.push(nav);
// // }
// // sessionStorage.urlTree = JSON.stringify(newUrlTree);
} else {
COMMON.avwScreenMove('index.html');
}
};
// // } else {
// // console.log("kdh check go index");
// // // COMMON.avwScreenMove('index.html');
// // }
// };
HEADER.init = function() {
$("#dspLoginId").text(ClientData.userInfo_loginId());
......
......@@ -128,6 +128,7 @@ DASHBOARD.init = function () {
COMMON.checkAuth(false);
sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.DASHBOARD;
sessionStorage.removeItem("operationId");
DASHBOARD.loadCommon();
DashboardSetting.getSettingData(function (settings) {
DASHBOARD.getDashboardData(function (dataDashboard) {
......
......@@ -23,6 +23,7 @@ OL.operationGroupMasterId;
OL.init = function () {
console.log('OperationList start');
sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.OPERATION_LIST;
sessionStorage.removeItem("operationId");
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'workList', true, null);
......@@ -504,11 +505,11 @@ OL.sendOperation = function (operationId, operationType, reportType, enableAddRe
//save operation logs. needed for sorting
OL.saveOperationReadingLog(operationId, operationType, reportType);
//Transition to the report form or operation list screen
sessionStorage.setItem("operationId", operationId);
if (enableAddReport == '1' || reportType == CONSTANT.REPORT_TYPE.ROUTINE) {
sessionStorage.OL_operationId = operationId;
COMMON.avwScreenMove('reportList.html');
} else {
const url = 'reportForm.html?operationId=' + operationId;
const url = 'reportForm.html?operationId=' + operationId + "&addReport=" + enableAddReport;
COMMON.avwScreenMove(url);
}
};
......
......@@ -27,18 +27,30 @@ PP.init = function () {
PP.loadCommon = function () {
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal('#includedConfirmModal');
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'pdfPrint', true, null);
let navs = [
{
titleLang: CONSTANT.PAGE_NAME.OPERATION_LIST,
href: CONSTANT.URL_TREE_NAME.OPERATION_LIST,
},
{
titleLang: CONSTANT.PAGE_NAME.REPORT_LIST,
href: CONSTANT.URL_TREE_NAME.OPERATION_LIST,
},
{
titleLang: CONSTANT.PAGE_NAME.PDF_PRINT,
}
];
TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.PDF_PRINT, navs, null);
};
/**
* init pdf list
*/
PP.initPdfList = function () {
if (sessionStorage.OL_operationId) {
if (sessionStorage.getItem("operationId")) {
let params = {};
params.sid = COMMON.getSid();
params.operationId = sessionStorage.OL_operationId;
params.returnUrl = CONSTANT.URL.WEB.BASE + CONSTANT.URL.WEB.OPERATION_LIST;
params.operationId = sessionStorage.getItem("operationId");
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.QUICK_REPORT_PRINT;
$('#pdfPrintDiv').load(url, params);
} else {
......
......@@ -134,16 +134,28 @@ PICKUP.getReportWithWarningsListData = function (callback) {
PICKUP.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
console.log('PICKUP.init');
sessionStorage.removeItem("pickUpType");
// sessionStorage.pickUpType = null;
sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.DASHBOARD;
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal('#includedConfirmModal');
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'pickup', true, null);
navs = [
{
titleLang: CONSTANT.PAGE_NAME.DASHBOARD,
href: CONSTANT.URL_TREE_NAME.DASHBOARD,
},
{
titleLang: CONSTANT.PAGE_NAME.PICKUP,
},
];
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'pickup', navs, null);
PICKUP.initSettingActivePickup();
PICKUP.settingPickup();
COMMON.closeLoading();
};
/**
* Setting pickup data
*/
......@@ -315,7 +327,7 @@ PICKUP.createNewReportList = function (operationListOld) {
}
let messageli = $("<li class='card mb-2' name = 'operationId_" + operationList[i].operationId + "' ></li>");
let ahrefRequiredFlg = $(
'<a href="javascript:PICKUP.sendReportFormFromNewReport (\'' + operationList[i].operationId + "," + operationList[i].addReport + "');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>",
'<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>",
);
let divIcon = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'>" + "<div class='type-icon'>" + "<span class='" + classIcon + "'></span>" + '</div></div>');
......@@ -736,9 +748,10 @@ PICKUP.getInspectDate = function (dateString) {
* @param operarionId
* @returns
*/
PICKUP.sendReportFormFromNewReport = function (operationId, addReport) {
PICKUP.sendReportFormFromNewReport = function (operationId) {
//Transition to the report form or operation list screen
const url = 'reportForm.html?operationId=' + operationId + "&addReport=" + addReport;
sessionStorage.setItem("pickUpType", CONSTANT.PICK_UP_TYPE.NEW_REPORT);
const url = 'reportForm.html?operationId=' + operationId;
COMMON.avwScreenMove(url);
};
......@@ -751,6 +764,7 @@ PICKUP.sendReportFormFromNewReport = function (operationId, addReport) {
*/
PICKUP.sendReportFormFromContinuousWork = function (operationId, taskKey, processKey, phaseNo) {
//Transition to the report form or operation list screen
sessionStorage.setItem("pickUpType", CONSTANT.PICK_UP_TYPE.CONTINOUS_WORK);
const url = 'reportForm.html?operationId=' + operationId + '&processKey=' + processKey + '&phaseNo=' + phaseNo;
COMMON.avwScreenMove(url);
};
......@@ -766,6 +780,7 @@ PICKUP.sendReportFormFromContinuousWork = function (operationId, taskKey, proces
*/
PICKUP.sendReportFormFromWarningReport = function (operationId, reportType, taskKey, processKey, phaseNo, replyNo) {
//Transition to the report form or operation list screen
sessionStorage.setItem("pickUpType", CONSTANT.PICK_UP_TYPE.WARNING_REPORT);
let url = 'reportForm.html?operationId=' + operationId;
switch (reportType) {
case PICKUP.REPORT_TYPE.REPORTONLY:
......
......@@ -26,7 +26,20 @@ PushMessageDetail.init = function () {
COMMON.checkAuth(false);
//load common html
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'messageDetail', true, null);
const navs = [
{
titleLang: 'dashboard',
href: 'dashboard.html',
},
{
titleLang: 'messageListTitle',
href: 'pushMessageList.html',
},
{
titleLang: 'messageDetail',
},
];
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'messageDetail', navs, null);
//request message detail data
let urlParam = COMMON.getUrlParameter();
if (typeof urlParam !== 'object' || typeof urlParam.pushMessageId === 'undefined') {
......
......@@ -12,7 +12,16 @@ PushMessageList.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'pushMessageList', true, null);
const navs = [
{
titleLang: 'dashboard',
href: 'dashboard.html',
},
{
titleLang: 'messageListTitle',
},
];
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'pushMessageList', navs, null);
PushMessageList.getMessageList(function (messageList) {
PushMessageList.generateMessageListHtml(messageList.pushMessageList);
});
......
......@@ -23,8 +23,91 @@ RF.init = function () {
RF.loadCommon = function () {
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal('#includedConfirmModal');
RF.initBreadcrumb();
};
RF.initBreadcrumb = function () {
if (sessionStorage.activeHomePage == CONSTANT.PAGE_TAB.DASHBOARD) {
if (sessionStorage.getItem("pickUpType") == CONSTANT.PICK_UP_TYPE.CONTINOUS_WORK) {
navs = [
{
titleLang: CONSTANT.PAGE_NAME.DASHBOARD,
href: CONSTANT.URL_TREE_NAME.DASHBOARD,
},
{
titleLang: CONSTANT.PAGE_NAME.PICKUP,
href: CONSTANT.URL_TREE_NAME.PICKUP_CONTINUOS,
},
{
titleLang: CONSTANT.PAGE_NAME.REPORT_FORM
},
]
} else if (sessionStorage.getItem("pickUpType") == CONSTANT.PICK_UP_TYPE.WARNING_REPORT) {
navs = [
{
titleLang: CONSTANT.PAGE_NAME.DASHBOARD,
href: CONSTANT.URL_TREE_NAME.DASHBOARD,
},
{
titleLang: CONSTANT.PAGE_NAME.PICKUP,
href: CONSTANT.URL_TREE_NAME.PICKUP_WARNING,
},
{
titleLang: CONSTANT.PAGE_NAME.REPORT_FORM
},
]
} else {
navs = [
{
titleLang: CONSTANT.PAGE_NAME.DASHBOARD,
href: CONSTANT.URL_TREE_NAME.DASHBOARD,
},
{
titleLang: CONSTANT.PAGE_NAME.PICKUP,
href: CONSTANT.URL_TREE_NAME.PICKUP_NEW,
},
{
titleLang: CONSTANT.PAGE_NAME.REPORT_LIST,
href: CONSTANT.URL_TREE_NAME.REPORT_LIST
},
{
titleLang: CONSTANT.PAGE_NAME.REPORT_FORM
},
]
}
} else {
if (sessionStorage.getItem("pickUpType")) sessionStorage.removeItem("pickUpType");
const urlParam = COMMON.getUrlParameter();
let addReportFlg = urlParam["addReport"];
if (addReportFlg == "1") {
navs = [
{
titleLang: CONSTANT.PAGE_NAME.OPERATION_LIST,
href: CONSTANT.URL_TREE_NAME.OPERATION_LIST,
},
{
titleLang: CONSTANT.PAGE_NAME.REPORT_LIST,
href: CONSTANT.URL_TREE_NAME.REPORT_LIST
},
{
titleLang: CONSTANT.PAGE_NAME.REPORT_FORM
},
]
} else {
navs = [
{
titleLang: CONSTANT.PAGE_NAME.OPERATION_LIST,
href: CONSTANT.URL_TREE_NAME.OPERATION_LIST,
},
{
titleLang: CONSTANT.PAGE_NAME.REPORT_FORM
},
]
}
}
TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_FORM, navs, null);
}
/**
* iinit form view
*/
......@@ -49,7 +132,7 @@ RF.initFormView = function () {
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();
COMMON.closeLoading();
// COMMON.closeLoading();
});
} else {
COMMON.avwScreenMove('index.html');
......
......@@ -16,7 +16,7 @@ RL.init = function () {
RL.checkQuickReport();
RL.loadCommon();
RL.initTaskReportList();
COMMON.closeLoading();
// COMMON.closeLoading();
};
/**
......@@ -25,20 +25,50 @@ RL.init = function () {
RL.loadCommon = function () {
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal('#includedConfirmModal');
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'reportList', true, RL.loadMainTitleCallback);
RL.initBreadcrumb();
};
RL.initBreadcrumb = function () {
if (sessionStorage.activeHomePage == CONSTANT.PAGE_TAB.DASHBOARD) {
navs = [
{
titleLang: CONSTANT.PAGE_NAME.DASHBOARD,
href: CONSTANT.URL_TREE_NAME.DASHBOARD,
},
{
titleLang: CONSTANT.PAGE_NAME.PICKUP,
href: CONSTANT.URL_TREE_NAME.PICKUP_NEW,
},
{
titleLang: CONSTANT.PAGE_NAME.REPORT_LIST,
},
]
} else {
if (sessionStorage.getItem("pickUpType")) sessionStorage.removeItem("pickUpType");
navs = [
{
titleLang: CONSTANT.PAGE_NAME.OPERATION_LIST,
href: CONSTANT.URL_TREE_NAME.OPERATION_LIST,
},
{
titleLang: CONSTANT.PAGE_NAME.REPORT_LIST,
},
]
}
TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_LIST, navs, RL.loadMainTitleCallback);
}
RL.isQuickReport;
/**
* check quick report
*/
RL.checkQuickReport = function () {
if (sessionStorage.OL_operationId) {
if (sessionStorage.getItem("operationId")) {
let params = {};
params.sid = COMMON.getSid();
params.operationId = sessionStorage.OL_operationId;
params.returnUrl = CONSTANT.URL.WEB.BASE + CONSTANT.URL.WEB.OPERATION_LIST;
params.operationId = sessionStorage.getItem("operationId");
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.IS_QUICK_REPORT;
COMMON.cmsAjax(
url,
......@@ -62,11 +92,10 @@ RL.checkQuickReport = function () {
* init task report list
*/
RL.initTaskReportList = function () {
if (sessionStorage.OL_operationId) {
if (sessionStorage.getItem("operationId")) {
let params = {};
params.sid = COMMON.getSid();
params.operationId = sessionStorage.OL_operationId;
params.returnUrl = CONSTANT.URL.WEB.BASE + CONSTANT.URL.WEB.OPERATION_LIST;
params.operationId = sessionStorage.getItem("operationId");
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);
} else {
......
......@@ -121,7 +121,16 @@ SendMessage.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'sendMessage', true, null);
const navs = [
{
titleLang: 'dashboard',
href: 'dashboard.html',
},
{
titleLang: 'sendMessageTitle',
},
];
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'sendMessage', navs, null);
TEMPLATE.loadOperationSelect('#includeOperationSelect', SendMessage.operationSelectedCallback);
TEMPLATE.loadNotificationSelect('#includeTemplateModal', SendMessage.templateSelectedCallback);
$('#messageContent').attr('maxlength', SendMessage.contentMaxLength);
......
......@@ -4,10 +4,12 @@
**/
var SETTINGS = {};
// SETTINGS.TOKEN_VALUE = "";
// Init function of page
$(document).ready(function () {
//Check if user is logged in
// SETTINGS.TOKEN_VALUE = random;
COMMON.checkAuth(false);
SETTINGS.initScreen();
$('#dspPwdUpd1').click(SETTINGS.dspPwdUpd1_Click);
......@@ -19,6 +21,7 @@ $(document).ready(function () {
* @param {*} e
*/
SETTINGS.dspPwdUpd1_Click = function (e) {
// const tokenVal = $('#tokenVal').val();
e.preventDefault();
var isOK = true;
var msgError = $('#main-error-message');
......@@ -80,6 +83,7 @@ SETTINGS.dspPwdUpd1_Click = function (e) {
password: SETTINGS.getCurrentPassword(),
newPassword: SETTINGS.getNewPassword(),
language: I18N.getCurrentLanguage(),
token: "",
appId: 4,
};
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PASSWORD_CHANGE;
......@@ -150,7 +154,16 @@ SETTINGS.getNewPasswordRe = function () {
SETTINGS.initScreen = function () {
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal('#includedConfirmModal');
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'accountSetting', true, null);
const navs = [
{
titleLang: 'txtTooltipBack',
href: 'javascript:history.back();',
},
{
titleLang: 'accountSetting',
},
]
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'accountSetting', navs, null);
// Login ID
$('#txtLoginId').text(ClientData.userInfo_loginId_session());
// Account Path
......
......@@ -81,14 +81,10 @@ TEMPLATE.loadNotificationSelect = function (elmentId, selectCallback) {
* @param {string} titleLang - lang of title
* @param {Array} navs - array nav items (titleLang, href)
*/
TEMPLATE.loadMainNavsTitle = function (elmentId, titleLang, isNav, completeCallback) {
TEMPLATE.loadMainNavsTitle = function (elmentId, titleLang, navs, completeCallback) {
var titleHtmlPath = '../common/html/mainTitle.html';
HEADER.urlTree();
var navs;
if (isNav) {
if (navs) {
titleHtmlPath = '../common/html/mainNavTitle.html';
navs = sessionStorage.urlTree ? JSON.parse(sessionStorage.urlTree) : null;
}
$(elmentId).load(titleHtmlPath, function (data) {
......@@ -96,23 +92,12 @@ TEMPLATE.loadMainNavsTitle = function (elmentId, titleLang, isNav, completeCallb
if (titleLang) {
$('#mainTitleHeader').attr('lang', titleLang);
}
if (isNav) {
if (titleLang == "accountSetting") {
navs = [
{
titleLang: 'txtTooltipBack',
href: 'javascript:history.back();',
},
{
titleLang: 'accountSetting',
},
];
}
if (navs) {
var olElm = $('#mainTitleNavs ol');
for (var i = 0; i < navs.length; i++) {
const nav = navs[i];
var liElm = $('<li class="breadcrumb-item" />');
if (nav.href && i != navs.length -1) {
if (nav.href) {
var aElm = $('<a class="text-decoration-none text-underline lang" />');
aElm.attr('href', nav.href);
if (nav.titleLang) {
......
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