단속자료검사 화면 재조회 수정

main
이범준 4 months ago
parent a2eb77d7cb
commit 12f0a91a95

@ -147,9 +147,6 @@ $(document).ready(function(){
} }
}); });
$P.layoutControl.defaultFetchSize = FETCH_XS; $P.layoutControl.defaultFetchSize = FETCH_XS;
$P.layoutControl.untilPageNum = 0;
$P.layoutControl.beforeCurrent = null;
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
@ -157,7 +154,7 @@ $(document).ready(function(){
$P.layoutControl.dataset.onDatasetChange = (obj, option) => { $P.layoutControl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.layoutControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.layoutControl.dataset, t.found, t.notFound, t.replacer);
$P.renderLayoutList(obj["Total"], $P.layoutControl.dataset.length, trs); $P.renderLayoutList(obj["Total"], $P.layoutControl.dataset.length, trs, option);
Apply.fromDataset.paging($P.layoutControl.dataset, obj, "layoutPaging--${pageName}"); Apply.fromDataset.paging($P.layoutControl.dataset, obj, "layoutPaging--${pageName}");
}; };
@ -208,9 +205,7 @@ $(document).ready(function(){
return; return;
} }
$P.layoutControl.untilPageNum = $P.layoutControl.query.pageNum; $P.layoutControl.reload({all : true});
$P.layoutControl.query.fetchSize = $P.layoutControl.defaultFetchSize * $P.layoutControl.query.pageNum;
$P.layoutControl.load(1);
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -227,20 +222,17 @@ $(document).ready(function(){
}; };
} }
$P.renderLayoutList = (total, listLength, trs) => { $P.renderLayoutList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.layoutControl.query.pageNum < 2) && ($P.layoutControl.untilPageNum == 0); var initScroll = ($P.layoutControl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
$("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore); $("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
if($P.layoutControl.untilPageNum != 0){
$P.layoutControl.query.fetchSize = $P.layoutControl.defaultFetchSize;
$P.layoutControl.query.pageNum = $P.layoutControl.untilPageNum;
$P.layoutControl.untilPageNum = 0;
}
} }
$P.clickLayoutList = (dataKey) => { $P.clickLayoutList = (dataKey) => {

@ -411,7 +411,6 @@ $(document).ready(function(){
} }
}); });
$P.photoInspectionControl.defaultFetchSize = FETCH_XS; $P.photoInspectionControl.defaultFetchSize = FETCH_XS;
$P.photoInspectionControl.untilPageNum = 0;
$P.photoInspectionControl.beforeCurrent = null; $P.photoInspectionControl.beforeCurrent = null;
@ -428,7 +427,6 @@ $(document).ready(function(){
} }
}); });
$P.sameVehicleMainControl.defaultFetchSize = FETCH_XS; $P.sameVehicleMainControl.defaultFetchSize = FETCH_XS;
$P.sameVehicleMainControl.untilPageNum = 0;
$P.sameVehicleMainControl.beforeCurrent = null; $P.sameVehicleMainControl.beforeCurrent = null;
$P.sameVehicleSubControl = new DatasetControl({ $P.sameVehicleSubControl = new DatasetControl({
@ -463,7 +461,7 @@ $(document).ready(function(){
var t = $P.getGridTemplate("photoInspection"); var t = $P.getGridTemplate("photoInspection");
var trs = Apply.fromDataset.getTbody($P.photoInspectionControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.photoInspectionControl.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.photoInspectionControl.dataset.length, trs, "photoInspection"); $P.renderInspectionDataList(obj["Total"], $P.photoInspectionControl.dataset.length, trs, "photoInspection", option);
Apply.fromDataset.paging($P.photoInspectionControl.dataset, obj, "photoInspectionPaging--${pageName}"); Apply.fromDataset.paging($P.photoInspectionControl.dataset, obj, "photoInspectionPaging--${pageName}");
}; };
@ -490,7 +488,7 @@ $(document).ready(function(){
var t = $P.getGridTemplate("sameVehicleInspectionMain"); var t = $P.getGridTemplate("sameVehicleInspectionMain");
var trs = Apply.fromDataset.getTbody($P.sameVehicleMainControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.sameVehicleMainControl.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.sameVehicleMainControl.dataset.length, trs, "sameVehicleInspectionMain"); $P.renderInspectionDataList(obj["Total"], $P.sameVehicleMainControl.dataset.length, trs, "sameVehicleInspectionMain", option);
Apply.fromDataset.paging($P.sameVehicleMainControl.dataset, obj, "sameVehicleInspectionMainPaging--${pageName}"); Apply.fromDataset.paging($P.sameVehicleMainControl.dataset, obj, "sameVehicleInspectionMainPaging--${pageName}");
}; };
@ -507,7 +505,7 @@ $(document).ready(function(){
$P.sameVehicleSubControl.dataset.onDatasetChange = (obj, option) => { $P.sameVehicleSubControl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("sameVehicleInspectionSub"); var t = $P.getGridTemplate("sameVehicleInspectionSub");
var trs = Apply.fromDataset.getTbody($P.sameVehicleSubControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.sameVehicleSubControl.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.sameVehicleSubControl.dataset.length, trs, "sameVehicleInspectionSub"); $P.renderInspectionDataList(obj["Total"], $P.sameVehicleSubControl.dataset.length, trs, "sameVehicleInspectionSub", option);
}; };
$P.sameVehicleSubControl.dataset.onCurrentChange = (dataItem) => { $P.sameVehicleSubControl.dataset.onCurrentChange = (dataItem) => {
@ -603,22 +601,14 @@ $(document).ready(function(){
$P.refreshInspectionList = () => { $P.refreshInspectionList = () => {
switch ($P.currentDisplay) { switch ($P.currentDisplay) {
case "photoInspection": case "photoInspection":
$P.photoInspectionControl.untilPageNum = $P.photoInspectionControl.query.pageNum; $P.photoInspectionControl.beforeCurrent = {
$P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize * $P.photoInspectionControl.query.pageNum;
$P.photoInspectionControl.beforeCurrent = {
key : $P.photoInspectionControl.dataset.getCurrent()["CRDN_ID"], key : $P.photoInspectionControl.dataset.getCurrent()["CRDN_ID"],
index : $P.photoInspectionControl.dataset.getCurrent()["ROW_NUM"] - 1 index : $P.photoInspectionControl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.load($P.photoInspectionControl, 1).then((resp)=>{ Apply.fromDatasetControl.reload($P.photoInspectionControl).then((resp)=>{
Apply.toDataset.set($P.photoInspectionControl.dataset, resp); Apply.toDataset.set($P.photoInspectionControl.dataset, resp);
$P.photoInspectionControl.dataset.onDatasetChange(resp); $P.photoInspectionControl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.photoInspectionControl.untilPageNum != 0){
$P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize;
$P.photoInspectionControl.query.pageNum = $P.photoInspectionControl.untilPageNum;
$P.photoInspectionControl.untilPageNum = 0;
}
if($P.photoInspectionControl.beforeCurrent != null){ if($P.photoInspectionControl.beforeCurrent != null){
var beforeCurrentKey = $P.photoInspectionControl.beforeCurrent.key; var beforeCurrentKey = $P.photoInspectionControl.beforeCurrent.key;
@ -647,22 +637,14 @@ $(document).ready(function(){
}); });
break; break;
case "sameVehicleInspection": case "sameVehicleInspection":
$P.sameVehicleMainControl.untilPageNum = $P.sameVehicleMainControl.query.pageNum;
$P.sameVehicleMainControl.query.fetchSize = $P.sameVehicleMainControl.defaultFetchSize * $P.sameVehicleMainControl.query.pageNum;
$P.sameVehicleMainControl.beforeCurrent = { $P.sameVehicleMainControl.beforeCurrent = {
key : $P.sameVehicleMainControl.dataset.getCurrent()["CRDN_ID_LIST"], key : $P.sameVehicleMainControl.dataset.getCurrent()["CRDN_ID_LIST"],
index : $P.sameVehicleMainControl.dataset.getCurrent()["ROW_NUM"] - 1 index : $P.sameVehicleMainControl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.load($P.sameVehicleMainControl, 1).then((resp)=>{ Apply.fromDatasetControl.reload($P.sameVehicleMainControl).then((resp)=>{
Apply.toDataset.set($P.sameVehicleMainControl.dataset, resp); Apply.toDataset.set($P.sameVehicleMainControl.dataset, resp);
$P.sameVehicleMainControl.dataset.onDatasetChange(resp); $P.sameVehicleMainControl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.sameVehicleMainControl.untilPageNum != 0){
$P.sameVehicleMainControl.query.fetchSize = $P.sameVehicleMainControl.defaultFetchSize;
$P.sameVehicleMainControl.query.pageNum = $P.sameVehicleMainControl.untilPageNum;
$P.sameVehicleMainControl.untilPageNum = 0;
}
if($P.sameVehicleMainControl.beforeCurrent != null){ if($P.sameVehicleMainControl.beforeCurrent != null){
var beforeCurrentKey = $P.sameVehicleMainControl.beforeCurrent.key; var beforeCurrentKey = $P.sameVehicleMainControl.beforeCurrent.key;
@ -782,21 +764,26 @@ $(document).ready(function(){
}; };
} }
$P.renderInspectionDataList = (total, listLength, trs, renderDataType) => { $P.renderInspectionDataList = (total, listLength, trs, renderDataType, option) => {
let noMore = (listLength >= total);
switch (renderDataType) { switch (renderDataType) {
case "photoInspection": case "photoInspection":
let noMore = (listLength >= total); var initScroll = ($P.photoInspectionControl.query.pageNum < 2);
var initScroll = ($P.photoInspectionControl.query.pageNum < 2) && ($P.photoInspectionControl.untilPageNum == 0); if(option != null && option.reloaded){
initScroll = false;
}
$("#photoInspection-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore); $("#photoInspection-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
break; break;
case "sameVehicleInspectionMain": case "sameVehicleInspectionMain":
var initScroll = ($P.sameVehicleMainControl.query.pageNum < 2);
let noMore = (listLength >= total); if(option != null && option.reloaded){
var initScroll = ($P.sameVehicleMainControl.query.pageNum < 2) && ($P.sameVehicleMainControl.untilPageNum == 0); initScroll = false;
}
$("#sameVehicleInspectionMain-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore); $("#sameVehicleInspectionMain-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
break; break;

@ -92,7 +92,7 @@ var addrControl = new DatasetControl({
/************************************************************************** /**************************************************************************
* DatasetControl.on * DatasetControl.on
**************************************************************************/ **************************************************************************/
addrControl.onDatasetChange = (obj) => { addrControl.onDatasetChange = (obj, option) => {
renderAddrList(obj.common.totalCount); renderAddrList(obj.common.totalCount);

Loading…
Cancel
Save