From e1f4e11c122910d66013a1fa3e6c762ae8d06609 Mon Sep 17 00:00:00 2001 From: JoJH Date: Tue, 12 Nov 2024 16:46:46 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=84=EA=B3=A0=EC=9E=A5=20=EB=B0=9C?= =?UTF-8?q?=EC=86=A1=20=EB=8C=80=EC=83=81=20=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/epst/epst02010-main.jsp | 4 +- .../WEB-INF/jsp/fims/epst/epst02030-main.jsp | 2 +- .../WEB-INF/jsp/fims/epst/epst02040-info.jsp | 11 +- .../WEB-INF/jsp/fims/excl/excl01010-main.jsp | 8 +- .../WEB-INF/jsp/fims/excl/excl01020-info.jsp | 11 +- .../WEB-INF/jsp/fims/sndb/sndb01010-main.jsp | 1470 ++++++++--------- .../WEB-INF/jsp/fims/sndb/sndb01020-info.jsp | 735 ++++----- .../resources/js/fims/sndb/sndb01010.js | 127 ++ .../resources/js/fims/sndb/sndb01020.js | 100 ++ 9 files changed, 1233 insertions(+), 1235 deletions(-) create mode 100644 src/main/webapp/resources/js/fims/sndb/sndb01010.js create mode 100644 src/main/webapp/resources/js/fims/sndb/sndb01020.js diff --git a/src/main/webapp/WEB-INF/jsp/fims/epst/epst02010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/epst/epst02010-main.jsp index 24f15382..ba94ff31 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/epst/epst02010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/epst/epst02010-main.jsp @@ -3,7 +3,7 @@ 안내문 - +
@@ -185,7 +185,7 @@
- + diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01020-info.jsp index 884bd13d..ed129da1 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01020-info.jsp @@ -3,431 +3,320 @@ 계고장 발송 대상 정보 - -
- -
- - -
- -
-
- -
- - - -
- -
- - -
- -
- - - -
- -
- - - -
- -
- - -
- -
- - -
-
-
- - - -
- - -
- -
    -
-
- - - - -
-
- - -
- -
-
- - -
- + +
+ +
+
+ +
+ + + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + + +
+
+ + +
+ +
+ + +
+
+
+ + + +
+ + +
+ +
    +
+
+ + + + +
+
+ + +
+ +
+
+ +
+
- + diff --git a/src/main/webapp/resources/js/fims/sndb/sndb01010.js b/src/main/webapp/resources/js/fims/sndb/sndb01010.js new file mode 100644 index 00000000..8a011f83 --- /dev/null +++ b/src/main/webapp/resources/js/fims/sndb/sndb01010.js @@ -0,0 +1,127 @@ +function newSndb01010Control(pageName, doctx="[data-doctx='sndb01010']") { + let ctrl = new DatasetControl({ + doctx: doctx + , prefix: "wrngTrgt" + , prefixName: "계고장 발송 대상" + , dataGetter: obj => obj["List"] + , keys: ["CRDN_ID"] + , appendData: true + , infoSize: "xl" + , urls: { + load: "/list.do" + , getInfo: "/info.do" + , remove: "/remove.do" + } + , formats: { + CVLCPT_RCPT_YMD: dateFormat + , LEVY_EXCL_YMD: dateFormat + , CRDN_YMD_TM: datetimeFormat + , FFNLG_CRDN_AMT: numberFormat + , REG_DT: datetimeFormat + , MDFCN_DT: datetimeFormat + } + }); + + // 검색 조건 + ctrl.query = { pageNum: 1, fetchSize: DEFAULT_FETCH_SIZE }; // 1 페이지당 자료 건수 index.jsp에서 확인 + // paging + ctrl.pagingSupport = new FimsPagingSupport({ + ctrl: ctrl // DatasetControl + , ignoreCtrlPrefix: true // ctrl.prefix 가 있더라도 무시 + , linkContainer: "[name='dataPaging']" //
    + }); + + /************************************************************************** + * DatasetControl Events + **************************************************************************/ + // Dataset 변경 이벤트 + ctrl.onDatasetChange = (obj, option) => { + // 데이터 셋 + let dataList = ctrl.dataset; + let empty = dataList.empty; + let clsForTask = $(ctrl.find("[name='frmSearch']")).find("[name='taskSeCd']:checked").val().toLowerCase(); + + // 업무별 dataTables(그리드) tr, td + let foundContent = ctrl.find("[name='tmpltRows']").content; + let foundTr = $(foundContent).find("tr")[0].cloneNode(false); + let foundTds = $(foundContent).find("." + clsForTask + ",.cmn"); + + foundTds.each(function() { + foundTr.appendChild(this.cloneNode(true)); + }); + + let replacer = (str, dataItem) => str + .replace(/{onclick}/gi, "pageObject['" + pageName + "'].dataTableClick('{data-index}');") + .replace(/{ondblclick}/gi, "pageObject['" + pageName + "'].dataTableDblClick('{data-index}');"); + + let trs = empty ? + [ctrl.find("[name='tmpltNotFound']").content.querySelector("." + clsForTask + ",.cmn").outerHTML] + : dataList.inStrings(foundTr.outerHTML, replacer); + + let noMore = (dataList.length >= obj["Paging"]?.totalSize); // 전체 건수 + let initScroll = (ctrl.query.pageNum < 2); + + if (option != null && option.reloaded) { + initScroll = false; + } + + // dataTables(그리드)에 자료 표시 td + ctrl.find("[name='tableRspns']").changeContent(trs.join(), initScroll, noMore); + + // checkbox 체크 해제 + $(ctrl.find("[name='gridAllCheckbox']")).prop("checked", false); + + // dataTables(그리드)에 페이지 표시 pagingInfo + ctrl.pagingSupport.setPagingInfo(obj); + + // 보안모드 + fn_securityModeToggle($("#securityMode--top").is(":checked")); + }; + + // 현재 선택 자료 변경 이벤트 + ctrl.onCurrentChange = (item) => { + Apply.fromDataset.currentRow(ctrl.dataset, item, ctrl.find("[name='tbodyList']")); + }; + + // 선택(체크) 변경 이벤트 + ctrl.onSelectionChange = (selectedArr) => { + // gridCheckbox + Apply.fromDataset.gridCheckbox(ctrl.dataset, ctrl.find("[name='tbodyList']"), 1, selectedArr); + // gridButton + Apply.fromDataset.gridButton(ctrl.dataset, ctrl.find("[name='btnCreateSlctnTrgtInfo']"), selectedArr); // 선택 대상 등록 버튼 + }; + + // 상세 정보 dialog + ctrl.getInfo = (params) => { + if (!params) return; + + ajax.get({ + url: ctrl.urls.getInfo + , data: params || {} + , success: (resp) => { + let dialogName = ctrl.prefixed("Dialog"); + let dialogId = dialogName + "-" + uuid(); + + dialog.open({ + id: dialogId + , title: params.btnTitle + , size: ctrl.infoSize + , content: resp + , init: () => { + $("#" + dialogId).attr("name", dialogName); + $("#" + dialogId).attr("data-ref-doctx", pageName); + + AppSupport.setDialogZindex(); + } + , onClose: () => { + ctrl.query.crdnIds = null; // 단속 IDs + + ctrl.reload({all : true}); // 자료 재조회 + } + }); + } + }); + } + + return ctrl; +} diff --git a/src/main/webapp/resources/js/fims/sndb/sndb01020.js b/src/main/webapp/resources/js/fims/sndb/sndb01020.js new file mode 100644 index 00000000..07355eef --- /dev/null +++ b/src/main/webapp/resources/js/fims/sndb/sndb01020.js @@ -0,0 +1,100 @@ +function newSndb01020Control(pageName, doctx="[data-doctx='sndb01020']") { + let ctrl = new DatasetControl({ + doctx: doctx + , prefix: "wrngTrgt" + , prefixName: "계고장 발송 대상" + , dataGetter: obj => obj["List"] + , keys: ["CRDN_ID"] + , appendData: true + , urls: { + load: "/list.do" + , create: "/create.do" + } + , formats: { + TNOCS: numberFormat + , GRAMT: numberFormat + , LEVY_EXCL_YMD: dateFormat + , CVLCPT_RCPT_YMD: dateFormat + , CRDN_YMD_TM: datetimeFormat + , FFNLG_CRDN_AMT: numberFormat + , REG_DT: datetimeFormat + , MDFCN_DT: datetimeFormat + } + }); + + // 검색 조건 + ctrl.query = { pageNum: 1, fetchSize: DEFAULT_FETCH_SIZE }; // 1 페이지당 자료 건수 index.jsp에서 확인 + // paging + ctrl.pagingSupport = new FimsPagingSupport({ + ctrl: ctrl // DatasetControl + , ignoreCtrlPrefix: true // ctrl.prefix 가 있더라도 무시 + , linkContainer: "[name='dataPaging']" //
      + }); + + /************************************************************************** + * DatasetControl Events + **************************************************************************/ + ctrl.onDatasetChange = (obj, option) => { + // 데이터 셋 + let dataList = ctrl.dataset; + let empty = dataList.empty; + + let replacer = (str, dataItem) => str + .replace(/{onclick}/gi, "pageObject['" + pageName + "'].dataTableClick('{data-index}');"); + + let trs = empty ? + [ctrl.find("[name='tmpltNotFound']").innerHTML] + : dataList.inStrings(ctrl.find("[name='tmpltRows']").innerHTML, replacer); + + let noMore = (dataList.length >= obj["Paging"]?.totalSize); // 전체 건수 + let initScroll = (ctrl.query.pageNum < 2); + + if (option != null && option.reloaded) { + initScroll = false; + } + + // dataTables(그리드)에 자료 표시 td + ctrl.find("[name='tableRspns']").changeContent(trs.join(), initScroll, noMore); + + // dataTables(그리드)에 페이지 표시 pagingInfo + ctrl.pagingSupport.setPagingInfo(obj); + + // 보안모드 + fn_securityModeToggle($("#securityMode--top").is(":checked")); + }; + + // 현재 선택 자료 변경 이벤트 + ctrl.onCurrentChange = (item) => { + Apply.fromDataset.currentRow(ctrl.dataset, item, ctrl.find("[name='tbodyList']")); + }; + + // 저장 callback + ctrl.onSave = (params, resp) => { + let modalId = $(document.querySelector(doctx)).parents(".modal")[0].id; + let dialogTitle = $("#" + modalId).find("h5.modal-title").html(); + let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle); + + // 메시지 출력 + dialog.alert({ + content: showMessage + , init: () => { AppSupport.setDialogZindex(); } + , onOK: () => { } + , onClose: () => { + if (resp.saved) { dialog.close(modalId); } + } + }); + } + + // 저장 + ctrl.save = (params) => { + if (!params) return; + + ajax.post({ + url: ctrl.urls.create + , data: params || {} + , success: (resp) => { ctrl.onSave(params, resp); } + }); + } + + return ctrl; +}