From 07c3f08ccc376e4f1984ddd12ce418d97dd8d323 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Thu, 25 Jul 2024 10:34:27 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8F=90=EA=B8=B0=EB=B3=B4=EA=B3=A0?= =?UTF-8?q?=ED=86=B5=EA=B3=84=20-=20=ED=8E=98=EC=9D=B4=EC=A7=95=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dsuseMgtDsuseQyByBsshStatistics-main.jsp | 41 +++++------------- ...dsuseMgtDsuseQyByIndutyStatistics-main.jsp | 8 ++++ .../dsuseMgtDsuseQyByPrdStatistics-main.jsp | 42 ++++++------------- .../dsuseMgtNcrdAndPrtmStatistics-main.jsp | 8 ++++ 4 files changed, 39 insertions(+), 60 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp index 9f3445f..81c1b0f 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp @@ -146,7 +146,6 @@ * script 진입 **************************************************************************/ $(document).ready(function() { - let totalDs = null; // pageObject let $P = pageObject["${pageName}"]; @@ -163,18 +162,7 @@ , prefix: "dsuseMgtDsuseQyByBsshStatistics" , prefixName: "제품별 폐기 현황" , keymapper: info => info ? info.dept_cd : "" - , dataGetter: obj => { - let list = obj.${infoPrefix}List; - - // TOTAL 데이터 - totalDs = new Dataset({ - keymapper: info => info? info.bssh_cd : '' - , dataGetter: obj => obj - }); - totalDs.setData(list.filter(d => d.dept_cd === 'TOTAL')); - - return list.filter(d => d.dept_cd !== 'TOTAL'); - } + , dataGetter: obj => obj.${infoPrefix}List , appendData: true , infoSize: "xl" }); @@ -191,11 +179,12 @@ $P.control.onDatasetChange = (obj) => { $P.renderList(obj.${infoPrefix}Total); $("#${infoPrefix}Paging--${pageName}").setPagingInfo({ - list: $P.control.dataset - , prefix: "${infoPrefix}Paging--${pageName}" + //list: $P.control.dataset + prefix: "${infoPrefix}Paging--${pageName}" , start: obj.${infoPrefix}Start - , totalSize: $P.control.dataset.length + , totalSize: $P.control.dataset.length - 1 , fetchSize: obj.${infoPrefix}Fetch + , dataLength: $P.control.dataset.length - 1 , func: "pageObject['${pageName}'].control.load({index})" }); }; @@ -230,26 +219,18 @@ let replacer = (str, dataItem) => { str = str.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("bssh_cd") + "');") - str = str.replace(/{fw-bold-if-total}/gi, ""); + if(dataItem.getValue("dept_cd") === "TOTAL"){ + str = str.replace(/{fw-bold-if-total}/gi, "fw-bold"); + str = str.replace(/{ROW_NUM}/gi, "") + } else { + str = str.replace(/{fw-bold-if-total}/gi, ""); + } return str; } - let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML] : ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer); - $("#tbody--${pageName}").html(trs.join()); - - // TOTAL 데이터 추가 - let replacer2 = (str, dataItem) => { - str = str.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("prduct_cd") + "');") - str = str.replace(/{fw-bold-if-total}/gi, "fw-bold"); - str = str.replace(/{ROW_NUM}/gi, ""); - return str; - } - - let tr = totalDs.inStrings(foundTr.outerHTML, replacer2); - $("#tbody--${pageName}").append(tr); } $P.control.getBsshInfo = (gdccId) => { diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByIndutyStatistics-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByIndutyStatistics-main.jsp index 6bc5846..b82ba6d 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByIndutyStatistics-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByIndutyStatistics-main.jsp @@ -173,6 +173,14 @@ // Dataset 변경 이벤트 $P.control.onDatasetChange = (obj) => { $P.renderList(obj.${infoPrefix}Total); + $("#${infoPrefix}Paging--${pageName}").setPagingInfo({ + prefix: "${infoPrefix}Paging--${pageName}" + , start: obj.${infoPrefix}Start + , totalSize: $P.control.dataset.length - 1 + , fetchSize: obj.${infoPrefix}Fetch + , dataLength: $P.control.dataset.length - 1 + , func: "pageObject['${pageName}'].control.load({index})" + }); }; // 현재 선택 자료 변경 이벤트 diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByPrdStatistics-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByPrdStatistics-main.jsp index 7bb3420..80a905a 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByPrdStatistics-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByPrdStatistics-main.jsp @@ -145,7 +145,6 @@ * script 진입 **************************************************************************/ $(document).ready(function() { - let totalDs = null; // pageObject let $P = pageObject["${pageName}"]; @@ -162,18 +161,7 @@ , prefix: "dsuseMgtDsuseQyByPrdStatistics" , prefixName: "제품별 폐기 현황" , keymapper: info => info ? info.prduct_cd : "" - , dataGetter: obj => { - let list = obj.${infoPrefix}List; - - // TOTAL 데이터 - totalDs = new Dataset({ - keymapper: info => info? info.dept_cd : '' - , dataGetter: obj => obj - }); - totalDs.setData(list.filter(d => d.dept_cd === 'TOTAL')); - - return list.filter(d => d.dept_cd !== 'TOTAL'); - } + , dataGetter: obj => obj.${infoPrefix}List , appendData: true , infoSize: "xl" }); @@ -190,11 +178,12 @@ $P.control.onDatasetChange = (obj) => { $P.renderList(obj.${infoPrefix}Total); $("#${infoPrefix}Paging--${pageName}").setPagingInfo({ - list: $P.control.dataset - , prefix: "${infoPrefix}Paging--${pageName}" + //list: $P.control.dataset + prefix: "${infoPrefix}Paging--${pageName}" , start: obj.${infoPrefix}Start - , totalSize: $P.control.dataset.length + , totalSize: $P.control.dataset.length - 1 , fetchSize: obj.${infoPrefix}Fetch + , dataLength: $P.control.dataset.length - 1 , func: "pageObject['${pageName}'].control.load({index})" }); }; @@ -229,28 +218,21 @@ let replacer = (str, dataItem) => { str = str.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("prduct_cd") + "');") - str = str.replace(/{fw-bold-if-total}/gi, ""); - return str; + if(dataItem.getValue("dept_cd") === "TOTAL"){ + str = str.replace(/{fw-bold-if-total}/gi, "fw-bold"); + str = str.replace(/{ROW_NUM}/gi, "") + } else { + str = str.replace(/{fw-bold-if-total}/gi, ""); + } + return str; } let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML] : ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer); $("#tbody--${pageName}").html(trs.join()); - - // TOTAL 데이터 추가 - let replacer2 = (str, dataItem) => { - str = str.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("prduct_cd") + "');") - str = str.replace(/{fw-bold-if-total}/gi, "fw-bold"); - str = str.replace(/{ROW_NUM}/gi, ""); - return str; - } - - let tr = totalDs.inStrings(foundTr.outerHTML, replacer2); - $("#tbody--${pageName}").append(tr); } - $P.control.getBsshInfo = (gdccId) => { let dialogTitle = "마약류 취급업체 조회"; let params = {openPage : "frmSearch--${pageName}"}; diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp index 91981bd..0a124b1 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp @@ -184,6 +184,14 @@ // Dataset 변경 이벤트 $P.control.onDatasetChange = (obj) => { $P.renderList(); + $("#${infoPrefix}Paging--${pageName}").setPagingInfo({ + prefix: "${infoPrefix}Paging--${pageName}" + , start: obj.${infoPrefix}Start + , totalSize: $P.control.dataset.length - 1 + , fetchSize: obj.${infoPrefix}Fetch + , dataLength: $P.control.dataset.length - 1 + , func: "pageObject['${pageName}'].control.load({index})" + }); }; // 현재 선택 자료 변경 이벤트