From 12f0a91a95469f209c6d44adcf673914274ae048 Mon Sep 17 00:00:00 2001 From: leebj Date: Tue, 9 Jul 2024 16:08:47 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A8=EC=86=8D=EC=9E=90=EB=A3=8C=EA=B2=80?= =?UTF-8?q?=EC=82=AC=20=ED=99=94=EB=A9=B4=20=EC=9E=AC=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/fims/crdn/crdn01010-main.jsp | 22 +++----- .../WEB-INF/jsp/fims/crdn/crdn02010-main.jsp | 55 +++++++------------ .../webapp/resources/html/searchAddr.html | 2 +- 3 files changed, 29 insertions(+), 50 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp index c53d2267..4be904fb 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp @@ -147,9 +147,6 @@ $(document).ready(function(){ } }); $P.layoutControl.defaultFetchSize = FETCH_XS; - $P.layoutControl.untilPageNum = 0; - $P.layoutControl.beforeCurrent = null; - /************************************************************************** * Dataset.on @@ -157,7 +154,7 @@ $(document).ready(function(){ $P.layoutControl.dataset.onDatasetChange = (obj, option) => { var t = $P.getGridTemplate(); 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}"); }; @@ -208,9 +205,7 @@ $(document).ready(function(){ return; } - $P.layoutControl.untilPageNum = $P.layoutControl.query.pageNum; - $P.layoutControl.query.fetchSize = $P.layoutControl.defaultFetchSize * $P.layoutControl.query.pageNum; - $P.layoutControl.load(1); + $P.layoutControl.reload({all : true}); } $P.getGridTemplate = () => { @@ -227,20 +222,17 @@ $(document).ready(function(){ }; } - $P.renderLayoutList = (total, listLength, trs) => { + $P.renderLayoutList = (total, listLength, trs, option) => { 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); 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) => { diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp index 6afd8b34..cec22b4f 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp @@ -411,7 +411,6 @@ $(document).ready(function(){ } }); $P.photoInspectionControl.defaultFetchSize = FETCH_XS; - $P.photoInspectionControl.untilPageNum = 0; $P.photoInspectionControl.beforeCurrent = null; @@ -428,7 +427,6 @@ $(document).ready(function(){ } }); $P.sameVehicleMainControl.defaultFetchSize = FETCH_XS; - $P.sameVehicleMainControl.untilPageNum = 0; $P.sameVehicleMainControl.beforeCurrent = null; $P.sameVehicleSubControl = new DatasetControl({ @@ -463,7 +461,7 @@ $(document).ready(function(){ var t = $P.getGridTemplate("photoInspection"); 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}"); }; @@ -490,7 +488,7 @@ $(document).ready(function(){ var t = $P.getGridTemplate("sameVehicleInspectionMain"); 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}"); }; @@ -507,7 +505,7 @@ $(document).ready(function(){ $P.sameVehicleSubControl.dataset.onDatasetChange = (obj, option) => { var t = $P.getGridTemplate("sameVehicleInspectionSub"); 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) => { @@ -603,22 +601,14 @@ $(document).ready(function(){ $P.refreshInspectionList = () => { switch ($P.currentDisplay) { case "photoInspection": - $P.photoInspectionControl.untilPageNum = $P.photoInspectionControl.query.pageNum; - $P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize * $P.photoInspectionControl.query.pageNum; - $P.photoInspectionControl.beforeCurrent = { + $P.photoInspectionControl.beforeCurrent = { key : $P.photoInspectionControl.dataset.getCurrent()["CRDN_ID"], 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); - $P.photoInspectionControl.dataset.onDatasetChange(resp); - - if($P.photoInspectionControl.untilPageNum != 0){ - $P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize; - $P.photoInspectionControl.query.pageNum = $P.photoInspectionControl.untilPageNum; - $P.photoInspectionControl.untilPageNum = 0; - } + $P.photoInspectionControl.dataset.onDatasetChange(resp, {reloaded : true}); if($P.photoInspectionControl.beforeCurrent != null){ var beforeCurrentKey = $P.photoInspectionControl.beforeCurrent.key; @@ -647,22 +637,14 @@ $(document).ready(function(){ }); break; case "sameVehicleInspection": - $P.sameVehicleMainControl.untilPageNum = $P.sameVehicleMainControl.query.pageNum; - $P.sameVehicleMainControl.query.fetchSize = $P.sameVehicleMainControl.defaultFetchSize * $P.sameVehicleMainControl.query.pageNum; $P.sameVehicleMainControl.beforeCurrent = { key : $P.sameVehicleMainControl.dataset.getCurrent()["CRDN_ID_LIST"], 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); - $P.sameVehicleMainControl.dataset.onDatasetChange(resp); - - if($P.sameVehicleMainControl.untilPageNum != 0){ - $P.sameVehicleMainControl.query.fetchSize = $P.sameVehicleMainControl.defaultFetchSize; - $P.sameVehicleMainControl.query.pageNum = $P.sameVehicleMainControl.untilPageNum; - $P.sameVehicleMainControl.untilPageNum = 0; - } + $P.sameVehicleMainControl.dataset.onDatasetChange(resp, {reloaded : true}); if($P.sameVehicleMainControl.beforeCurrent != null){ 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) { case "photoInspection": - let noMore = (listLength >= total); - var initScroll = ($P.photoInspectionControl.query.pageNum < 2) && ($P.photoInspectionControl.untilPageNum == 0); - + var initScroll = ($P.photoInspectionControl.query.pageNum < 2); + if(option != null && option.reloaded){ + initScroll = false; + } + $("#photoInspection-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore); break; case "sameVehicleInspectionMain": - - let noMore = (listLength >= total); - var initScroll = ($P.sameVehicleMainControl.query.pageNum < 2) && ($P.sameVehicleMainControl.untilPageNum == 0); - + var initScroll = ($P.sameVehicleMainControl.query.pageNum < 2); + if(option != null && option.reloaded){ + initScroll = false; + } + $("#sameVehicleInspectionMain-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore); break; diff --git a/src/main/webapp/resources/html/searchAddr.html b/src/main/webapp/resources/html/searchAddr.html index 0afbceb2..ad6e6ac6 100644 --- a/src/main/webapp/resources/html/searchAddr.html +++ b/src/main/webapp/resources/html/searchAddr.html @@ -92,7 +92,7 @@ var addrControl = new DatasetControl({ /************************************************************************** * DatasetControl.on **************************************************************************/ -addrControl.onDatasetChange = (obj) => { +addrControl.onDatasetChange = (obj, option) => { renderAddrList(obj.common.totalCount);