Commit 6ff2a335 by Takumi Imai

#49471 検索結果の保持

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