From d0a16723319d21a8d579b65a5d536465b352c3f6 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 20 Jul 2023 15:54:41 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A1=A4=EB=A7=81=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 | 34 +++++++++---------- .../WEB-INF/jsp/fims/crdn/crdn01030-main.jsp | 21 +++++++----- .../WEB-INF/jsp/fims/crdn/crdn05010-main.jsp | 19 +++++++---- .../WEB-INF/jsp/fims/crdn/crdn06010-main.jsp | 18 ++++++---- .../WEB-INF/jsp/fims/crdn/crdn06020-main.jsp | 33 ++++++++++++------ .../WEB-INF/jsp/fims/crdn/crdn06030-main.jsp | 18 ++++++---- .../WEB-INF/jsp/fims/crdn/crdn06040-main.jsp | 20 ++++++----- 7 files changed, 98 insertions(+), 65 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 c5066f4e..336d1250 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 @@ -155,13 +155,13 @@ pageObject["${pageName}"] = {}; $(document).ready(function(){ var $P = pageObject["${pageName}"]; - $P.scrollable = true; + $P.holdList = []; $P.toast = new bootstrap.Toast(document.getElementById('divToast--${pageName}'), { animation: true, autohide: true, - delay: 2000, + delay: 2000 }); /************************************************************************** @@ -181,11 +181,11 @@ $(document).ready(function(){ /************************************************************************** * DatasetControl.on **************************************************************************/ - $P.crdnControl.onDatasetChange = obj => { - - $P.renderCrdnList(); + $P.crdnControl.onDatasetChange = (obj) => { + var prefix = obj.infoPrefix; + + $P.renderCrdnList(obj[prefix+"Total"]); - var prefix = obj.infoPrefix; $("#crdnPaging--${pageName}").setPagingInfo({ list: $P.crdnControl.dataset, prefix: "crdnPaging--${pageName}", @@ -212,12 +212,8 @@ $(document).ready(function(){ $P.crdnControl.onRemove = (selected, resp) => { if (resp.saved){ - var removed = $P.crdnControl.dataset.getKeys("selected"); - $P.crdnControl.dataset.remove(removed); - removed.forEach(function(item){ - $("#crdnTbody--${pageName}").find("tr[data-key='"+item+"']").remove(); - }); $P.toast.show(); + $P.crdnControl._load(); } } @@ -251,17 +247,17 @@ $(document).ready(function(){ } $P.scrollEnd = (obj) => { - if(!$P.scrollable){ - return; + if(obj.dataset.scrollStatus){ + return; } - + var el = $(obj); if(el.scrollTop() == 0){ return; } if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ - $P.scrollable = false; + obj.dataset.scrollStatus = "waiting"; $P.scrollCrdnList(); } } @@ -287,7 +283,7 @@ $(document).ready(function(){ $P.crdnControl.getInfo(dataKey); } - $P.renderCrdnList = () => { + $P.renderCrdnList = (total) => { var crdnList = $P.crdnControl.dataset; var empty = crdnList.empty; @@ -302,7 +298,11 @@ $(document).ready(function(){ //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); - $P.scrollable = true; + if(total == crdnList.length){ + $("#table-responsive--${pageName}").attr("data-scroll-status", "complete"); + } else { + $("#table-responsive--${pageName}").removeAttr("data-scroll-status"); + } $P.holdList.forEach(function(item){ $("#crdnTbody--${pageName}").find("tr[data-key='"+item+"']").addClass("bg-dark"); diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01030-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01030-main.jsp index 9176794b..0761944a 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01030-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01030-main.jsp @@ -153,7 +153,6 @@ pageObject["${pageName}"] = {}; $(document).ready(function(){ var $P = pageObject["${pageName}"]; - $P.scrollable = true; /************************************************************************** * DatasetControl @@ -173,11 +172,11 @@ $(document).ready(function(){ /************************************************************************** * DatasetControl.on **************************************************************************/ - $P.crdnControl.onDatasetChange = obj => { - - $P.renderCrdnList(); + $P.crdnControl.onDatasetChange = (obj) => { + var prefix = obj.infoPrefix; + + $P.renderCrdnList(obj[prefix+"Total"]); - var prefix = obj.infoPrefix; $("#crdnPaging--${pageName}").setPagingInfo({ list: $P.crdnControl.dataset, prefix: "crdnPaging--${pageName}", @@ -217,7 +216,7 @@ $(document).ready(function(){ } $P.scrollEnd = (obj) => { - if(!$P.scrollable){ + if(obj.dataset.scrollStatus){ return; } @@ -227,7 +226,7 @@ $(document).ready(function(){ } if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ - $P.scrollable = false; + obj.dataset.scrollStatus = "waiting"; $P.scrollCrdnList(); } } @@ -245,7 +244,7 @@ $(document).ready(function(){ $P.crdnControl.getInfo(dataKey); } - $P.renderCrdnList = () => { + $P.renderCrdnList = (total) => { var crdnList = $P.crdnControl.dataset; var empty = crdnList.empty; @@ -260,7 +259,11 @@ $(document).ready(function(){ //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); - $P.scrollable = true; + if(total == crdnList.length){ + $("#table-responsive--${pageName}").attr("data-scroll-status", "complete"); + } else { + $("#table-responsive--${pageName}").removeAttr("data-scroll-status"); + } } $P.getParams = () => { diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05010-main.jsp index 01084636..c6d9c8ae 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05010-main.jsp @@ -110,7 +110,6 @@ pageObject["${pageName}"] = {}; $(document).ready(function(){ var $P = pageObject["${pageName}"]; - $P.scrollable = true; /************************************************************************** * DatasetControl @@ -163,8 +162,10 @@ $(document).ready(function(){ * DatasetControl.on **************************************************************************/ $P.crdnControl.onDatasetChange = (obj) => { - - $P.renderCrdnList(); + + var prefix = obj.infoPrefix; + + $P.renderCrdnList(obj[prefix+"Total"]); $("#crdnPaging--${pageName}").setPagingInfo({ list: $P.crdnControl.dataset, @@ -216,7 +217,7 @@ $(document).ready(function(){ } $P.scrollEnd = (obj) => { - if(!$P.scrollable){ + if(obj.dataset.scrollStatus){ return; } @@ -226,7 +227,7 @@ $(document).ready(function(){ } if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ - $P.scrollable = false; + obj.dataset.scrollStatus = "waiting"; $P.scrollCrdnList(); } } @@ -240,7 +241,7 @@ $(document).ready(function(){ $("#crdnTbody--${pageName}").setCurrentRow(dataKey); } - $P.renderCrdnList = () => { + $P.renderCrdnList = (total) => { var crdnList = $P.crdnControl.dataset; var empty = crdnList.empty; @@ -257,7 +258,11 @@ $(document).ready(function(){ //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); - $P.scrollable = true; + if(total == crdnList.length){ + $("#table-responsive--${pageName}").attr("data-scroll-status", "complete"); + } else { + $("#table-responsive--${pageName}").removeAttr("data-scroll-status"); + } } $P.getParams = () => { diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp index 8c4966c2..59cc8469 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp @@ -223,7 +223,6 @@ pageObject["${pageName}"] = {}; $(document).ready(function(){ var $P = pageObject["${pageName}"]; - $P.scrollable = true; /************************************************************************** * DatasetControl @@ -262,9 +261,10 @@ $(document).ready(function(){ **************************************************************************/ $P.crdnControl.onDatasetChange = obj => { - $P.renderCrdnList(); + var prefix = obj.infoPrefix; + + $P.renderCrdnList(obj[prefix+"Total"]); - var prefix = obj.infoPrefix; $("#crdnPaging--${pageName}").setPagingInfo({ list: $P.crdnControl.dataset, prefix: "crdnPaging--${pageName}", @@ -329,7 +329,7 @@ $(document).ready(function(){ } $P.scrollEnd = (obj) => { - if(!$P.scrollable){ + if(obj.dataset.scrollStatus){ return; } @@ -339,7 +339,7 @@ $(document).ready(function(){ } if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ - $P.scrollable = false; + obj.dataset.scrollStatus = "waiting"; $P.scrollCrdnList(); } } @@ -357,7 +357,7 @@ $(document).ready(function(){ $P.crdnControl.getInfo(dataKey); } - $P.renderCrdnList = () => { + $P.renderCrdnList = (total) => { var crdnList = $P.crdnControl.dataset; var empty = crdnList.empty; @@ -381,7 +381,11 @@ $(document).ready(function(){ fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드 - $P.scrollable = true; + if(total == crdnList.length){ + $("#table-responsive--${pageName}").attr("data-scroll-status", "complete"); + } else { + $("#table-responsive--${pageName}").removeAttr("data-scroll-status"); + } } $P.getParams = () => { diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp index 8113d3ac..db3f0003 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp @@ -335,7 +335,6 @@ pageObject["${pageName}"] = {}; $(document).ready(function(){ var $P = pageObject["${pageName}"]; - $P.scrollable = true; /************************************************************************** * DatasetControl @@ -398,9 +397,10 @@ $(document).ready(function(){ }; $P.sameVehicleControl.main.onDatasetChange = (obj) => { - $P.renderInspectionDataList("sameVehicleInspectionMain"); + var prefix = obj.infoPrefix; + + $P.renderInspectionDataList(obj[prefix+"Total"], "sameVehicleInspectionMain"); - var prefix = obj.infoPrefix; $("#sameVehicleInspectionMainPaging--${pageName}").setPagingInfo({ list: $P.sameVehicleControl.main.dataset, prefix: "sameVehicleInspectionMainPaging--${pageName}", @@ -412,7 +412,10 @@ $(document).ready(function(){ $P.sameVehicleControl.sub.onDatasetChange = (obj) => { - $P.renderInspectionDataList("sameVehicleInspectionSub"); + var prefix = obj.infoPrefix; + + $P.renderInspectionDataList(obj[prefix+"Total"], "sameVehicleInspectionSub"); + }; /************************************************************************** @@ -487,7 +490,7 @@ $(document).ready(function(){ } $P.scrollEnd = (obj) => { - if(!$P.scrollable){ + if(obj.dataset.scrollStatus){ return; } @@ -497,7 +500,7 @@ $(document).ready(function(){ } if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ - $P.scrollable = false; + obj.dataset.scrollStatus = "waiting"; $P.scrollInspectionDataList(); } } @@ -586,8 +589,8 @@ $(document).ready(function(){ }; - $P.renderInspectionDataList = (renderDataType) => { - + $P.renderInspectionDataList = (total, renderDataType) => { + switch (renderDataType) { case "photoInspection": var dataList = $P.photoInspectionControl.dataset; @@ -599,6 +602,12 @@ $(document).ready(function(){ .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');"); var trs = empty ? notFound : dataList.inStrings(found, replacer); $("#photoInspectionTbody--${pageName}").html(trs.join()); + + if(total == dataList.length){ + $("#photoInspection-responsive--${pageName}").attr("data-scroll-status", "complete"); + } else { + $("#photoInspection-responsive--${pageName}").removeAttr("data-scroll-status"); + } break; case "sameVehicleInspectionMain": var dataList = $P.sameVehicleControl.main.dataset; @@ -609,6 +618,12 @@ $(document).ready(function(){ .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID_LIST") + "','sameVehicleInspectionMain');"); var trs = empty ? notFound : dataList.inStrings(found, replacer); $("#sameVehicleInspectionMainTbody--${pageName}").html(trs.join()); + + if(total == dataList.length){ + $("#sameVehicleInspectionMain-responsive--${pageName}").attr("data-scroll-status", "complete"); + } else { + $("#sameVehicleInspectionMain-responsive--${pageName}").removeAttr("data-scroll-status"); + } break; case "sameVehicleInspectionSub": var dataList = $P.sameVehicleControl.sub.dataset; @@ -626,8 +641,6 @@ $(document).ready(function(){ //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); - - $P.scrollable = true; } $P.getParams = () => { diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp index f8e545a2..726cac14 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp @@ -122,7 +122,6 @@ pageObject["${pageName}"] = {}; $(document).ready(function(){ var $P = pageObject["${pageName}"]; - $P.scrollable = true; /************************************************************************** * DatasetControl @@ -148,9 +147,10 @@ $(document).ready(function(){ * DatasetControl.on **************************************************************************/ $P.crdnControl.onDatasetChange = obj => { - $P.renderCrdnList(); + var prefix = obj.infoPrefix; + + $P.renderCrdnList(obj[prefix+"Total"]); - var prefix = obj.infoPrefix; $("#crdnPaging--${pageName}").setPagingInfo({ list: $P.crdnControl.dataset, prefix: "crdnPaging--${pageName}", @@ -177,7 +177,7 @@ $(document).ready(function(){ } $P.scrollEnd = (obj) => { - if(!$P.scrollable){ + if(obj.dataset.scrollStatus){ return; } @@ -187,7 +187,7 @@ $(document).ready(function(){ } if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ - $P.scrollable = false; + obj.dataset.scrollStatus = "waiting"; $P.scrollCrdnList(); } } @@ -206,7 +206,7 @@ $(document).ready(function(){ } - $P.renderCrdnList = () => { + $P.renderCrdnList = (total) => { var crdnList = $P.crdnControl.dataset; var empty = crdnList.empty; @@ -222,7 +222,11 @@ $(document).ready(function(){ //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); - $P.scrollable = true; + if(total == crdnList.length){ + $("#table-responsive--${pageName}").attr("data-scroll-status", "complete"); + } else { + $("#table-responsive--${pageName}").removeAttr("data-scroll-status"); + } } diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp index 6586c271..456d4113 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp @@ -134,7 +134,6 @@ pageObject["${pageName}"] = {}; $(document).ready(function(){ var $P = pageObject["${pageName}"]; - $P.scrollable = true; /************************************************************************** * DatasetControl @@ -156,9 +155,10 @@ $(document).ready(function(){ /************************************************************************** * DatasetControl.on **************************************************************************/ - $P.crdnControl.onDatasetChange = obj => { - - $P.renderCrdnList(); + $P.crdnControl.onDatasetChange = (obj) => { + var prefix = obj.infoPrefix; + + $P.renderCrdnList(obj[prefix+"Total"]); $("#crdnPaging--${pageName}").setPagingInfo({ list: $P.crdnControl.dataset, @@ -199,7 +199,7 @@ $(document).ready(function(){ } $P.scrollEnd = (obj) => { - if(!$P.scrollable){ + if(obj.dataset.scrollStatus){ return; } @@ -209,7 +209,7 @@ $(document).ready(function(){ } if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ - $P.scrollable = false; + obj.dataset.scrollStatus = "waiting"; $P.scrollCrdnList(); } } @@ -227,7 +227,7 @@ $(document).ready(function(){ $P.crdnControl.getInfo(dataKey); } - $P.renderCrdnList = () => { + $P.renderCrdnList = (total) => { var crdnList = $P.crdnControl.dataset; var empty = crdnList.empty; @@ -244,7 +244,11 @@ $(document).ready(function(){ //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); - $P.scrollable = true; + if(total == crdnList.length){ + $("#table-responsive--${pageName}").attr("data-scroll-status", "complete"); + } else { + $("#table-responsive--${pageName}").removeAttr("data-scroll-status"); + } } $P.getParams = () => {