Commit 6ff2a335 by Takumi Imai

#49471 検索結果の保持

parent 89f4ee7f
......@@ -10,7 +10,6 @@ var OL = {};
OL.operationList; //Operation json data
OL.operationGroupMaster; //category(operationGroupMaster) json data
OL.isOperationGroupMaster = 0; //0: category(operationGroupMaster) not exist 1: category(operationGroupMaster) exist
OL.operationSearchCriteria;
OL.sortIndex;
OL.operationGroupMasterId;
......@@ -25,7 +24,7 @@ OL.init = function () {
console.log('OperationList start');
//get all data of operation list scene
OL.getAllDataWeb();
OL.getAllDataWeb(sessionStorage.OL_searchKeyWord, sessionStorage.OL_sortIndex, sessionStorage.OL_searchStartDate, sessionStorage.OL_searchEndDate, sessionStorage.OL_operationGroupMasterId);
//show operation list
OL.createOperationList(OL.operationList);
......@@ -45,34 +44,83 @@ OL.init = function () {
* @param {String} searchEndDate
* @param {Number} operationGroupMasterId
*/
OL.getAllDataWeb = function (searchKeyword, sortIndex, searchStartDate, searchEndDate, operationGroupMasterId) {
OL.getAllDataWeb = function (searchKeyWord, sortIndex, searchStartDate, searchEndDate, operationGroupMasterId) {
let param = {};
param.sid = COMMON.getSid();
param.operationName = searchKeyword;
param.sort = sortIndex;
param.startDate = searchStartDate;
param.endDate = searchEndDate;
param.operationGroupMasterId = operationGroupMasterId;
if (typeof searchKeyWord !== 'undefined') {
param.operationName = searchKeyWord;
}
if (typeof sortIndex !== 'undefined') {
param.sort = sortIndex;
}
if (typeof searchStartDate !== 'undefined') {
param.startDate = searchStartDate;
}
if (typeof searchEndDate !== 'undefined') {
param.endDate = searchEndDate;
}
if (typeof operationGroupMasterId !== 'undefined') {
param.operationGroupMasterId = operationGroupMasterId;
}
const url = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + CONSTANT.URL.CMS.API.ALL_OPERATION_LIST;
COMMON.cmsAjax(url, param, false, function (json) {
OL.saveSearchKeyWord(searchKeyWord, sortIndex, searchStartDate, searchEndDate, operationGroupMasterId);
OL.setSearchInfoWeb();
OL.operationList = json.operationList;
OL.operationGroupMaster = json.operationGroupMasterList;
OL.isOperationGroupMaster = json.isOperationGroupMaster;
OL.operationSearchCriteria = json.operationSearchCriteria;
OL.setSearchInfoWeb();
});
};
/**
* Transfer search criteria to session.
* Keep value after page move.
*
* @param {String} searchKeyword
* @param {String} sortIndex
* @param {String} searchStartDate
* @param {String} searchEndDate
* @param {String} operationGroupMasterId
*/
OL.saveSearchKeyWord = function (searchKeyword, sortIndex, searchStartDate, searchEndDate, operationGroupMasterId) {
if (typeof searchKeyword !== 'undefined') {
sessionStorage.OL_searchKeyWord = searchKeyword;
}
if (typeof sortIndex !== 'undefined') {
sessionStorage.OL_sortIndex = sortIndex;
}
if (typeof searchStartDate !== 'undefined') {
sessionStorage.OL_searchStartDate = searchStartDate;
}
if (typeof searchEndDate !== 'undefined') {
sessionStorage.OL_searchEndDate = searchEndDate;
}
if (typeof operationGroupMasterId !== 'undefined') {
sessionStorage.OL_operationGroupMasterId = operationGroupMasterId;
}
};
/**
* set search criteria when Initial display.
*/
OL.setSearchInfoWeb = function () {
OL.sortIndex = OL.operationSearchCriteria.sort;
$('#searchTaskName').val(OL.operationSearchCriteria.operationName);
$('#searchStartDate').val(OL.operationSearchCriteria.startDate);
$('#searchEndDate').val(OL.operationSearchCriteria.endDate);
OL.operationGroupMasterId = OL.operationSearchCriteria.operationGroupMasterId;
if (sessionStorage.OL_sortIndex) {
OL.sortIndex = sessionStorage.OL_sortIndex;
}
if (sessionStorage.OL_searchKeyWord) {
$('#searchTaskName').val(sessionStorage.OL_searchKeyWord);
}
if (sessionStorage.OL_searchStartDate) {
$('#searchStartDate').val(sessionStorage.OL_searchStartDate);
}
if (sessionStorage.OL_searchEndDate) {
$('#searchEndDate').val(sessionStorage.OL_searchEndDate);
}
if (sessionStorage.OL_operationGroupMasterId) {
OL.operationGroupMasterId = sessionStorage.OL_operationGroupMasterId;
}
};
/**
......@@ -199,7 +247,7 @@ OL.createBreadcrumbList = function () {
}
$('#groupMasterPath').empty();
if (typeof OL.operationGroupMasterId == 'undefined' || OL.operationGroupMasterId == 0) {
if (typeof OL.operationGroupMasterId === 'undefined' || OL.operationGroupMasterId == 0) {
$('#groupMasterPath').append('<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">' + COMMON.getMsg('all') + '</a></li>');
} else {
let treeList = [];
......
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