Commit 13d64db1 by Takumi Imai

修正

parent 310fb42a
......@@ -23,6 +23,25 @@ CONSTANT.PAGE_NAME = {
LOGIN: './login.html',
};
CONSTANT.URL_TREE_NAME = {
OPERATION_LIST: 'index.html',
DASHBOARD: 'dashboard.html',
REPORT_FORM: 'reportForm.html',
REPORT_LIST: 'reportList.html',
MESSAGE_DETAIL: 'pushMessageDetail.html',
MESSAGE_LIST: 'pushMessageList.html',
SEND_MESSAGE: 'sendMessage.html',
SETTING: 'accountSetting.html',
PICKUP: 'pickup.html',
};
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],
};
CONSTANT.PAGE_TAB = {
DASHBOARD: 'dashboard',
OPERATION_LIST: 'operationList',
......
......@@ -17,6 +17,69 @@ HEADER.init = function () {
};
/**
* create url tree & show breadcrumbs list
*/
HEADER.urlTree = function () {
const pathName = location.pathname;
const htmlName = pathName.substring(pathName.indexOf('/') + 1);
//now url tree
let urlTree = session.getItem('urlTree');
// check auth
let authFlg = false;
if ((!urlTree && htmlName == CONSTANT.URL_TREE_NAME.OPERATION_LIST) || htmlName == CONSTANT.URL_TREE_NAME.DASHBOARD) {
authFlg = true;
session.removeItem('urlTree');
}
urlList: for (const i in urlTree) {
const urlHtmlName = urlTree[i].substring(0, pathName.indexOf('?'));
findUrl: for (const passList in CONSTANT.URL_TREE_PASS) {
for (const k in passList) {
if (urlHtmlName == passList[k]) {
if (htmlName == passList[k]) {
authFlg = true;
break urlList;
}
break;
} else {
break findUrl;
}
}
}
}
if (authFlg) {
session.removeItem('urlTree');
let newUrlTree = {};
const urlPath = htmlName + location.search;
for (const i in urlTree) {
const urlHtmlName = urlTree[i].substring(0, pathName.indexOf('?'));
if (urlHtmlName == htmlName) {
newUrlTree.push(urlPath);
} else {
newUrlTree.push(urlTree[i]);
}
}
session.setItem('urlTree', newUrlTree);
//show urlTree
if ($('.breadcrumb').length) {
for (const i in newUrlTree) {
const urlHtmlName = newUrlTree[i].substring(0, pathName.indexOf('?'));
if (urlHtmlName == htmlName) {
$('.breadcrumb').append('<li class="breadcrumb-item">作業一覧</li>');
} else {
$('.breadcrumb').append('<li class="breadcrumb-item"><a href="task-list.html" class="text-decoration-none text-underline">作業一覧</a></li>');
}
}
}
} else {
COMMON.avwScreenMove('index.html');
}
};
/**
* Direct home page setting
* @param {*} pageId
*/
......
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