From 0eff4f2fe1aa5090ad47aaf4583ed6c57e147399 Mon Sep 17 00:00:00 2001 From: kangsunlee Date: Mon, 23 Jun 2025 17:29:57 +0900 Subject: [PATCH 01/12] =?UTF-8?q?[FO]=20=EA=B0=9C=EC=9D=B8=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=88=98=EC=A0=95=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/info/user/user.html | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/front/src/main/resources/templates/info/user/user.html b/front/src/main/resources/templates/info/user/user.html index 762c90b3..f7b0c2c6 100644 --- a/front/src/main/resources/templates/info/user/user.html +++ b/front/src/main/resources/templates/info/user/user.html @@ -85,13 +85,13 @@
-
-
@@ -123,8 +123,7 @@
@@ -132,13 +131,13 @@
-
-
@@ -155,24 +154,26 @@ -
- +
-

시/도 선택

+

지역 선택

+
  • option1 + th:text="${item.codeText}" + th:selected="${item.id eq userInfo.regionMainCode ? 'current' : ''}">option1
@@ -185,14 +186,14 @@
+ data-props-default="세부지역 선택" data-props-type="bottomSheet">
-

시/군/구 선택

+

세부지역 선택

@@ -277,6 +278,10 @@
+ + + +
\ No newline at end of file diff --git a/admin/src/main/resources/templates/households/{seq}.html b/admin/src/main/resources/templates/households/{seq}.html index cde589a2..90a994ff 100644 --- a/admin/src/main/resources/templates/households/{seq}.html +++ b/admin/src/main/resources/templates/households/{seq}.html @@ -618,7 +618,6 @@
-
diff --git a/front/src/main/resources/templates/info/bank/input.html b/front/src/main/resources/templates/info/bank/input.html index 5ba8971e..f03c2a4f 100644 --- a/front/src/main/resources/templates/info/bank/input.html +++ b/front/src/main/resources/templates/info/bank/input.html @@ -7,7 +7,7 @@

- 은행 자동이체(수입) 내역 [[${bankList.totalElements}]]건 등록 되었습니다. + 은행 자동이체(수입) 내역 [[${bankList.totalElements}]]건 등록 되었습니다.

수입 내역을 등록해 주세요.

@@ -246,7 +246,7 @@ clearAllItems.style.display = "none"; } }, - openAddForm() { + openAddForm(callback) { ajaxUtil._ajaxAsyncMethod( "/api/front/info/bank/create/input/from", {}, @@ -298,6 +298,9 @@ ENV.module.modalPopup.open(); document.querySelector('.modal-content').scrollTop = 0; + + // 모두 로드된 후 콜백 실행 + if (typeof callback === 'function') callback(); }, function(code, rstData) { kri.logger.error('Do nothing. code: '+ code, rstData); @@ -423,11 +426,9 @@ const product = ENV.data.bankList.find(p => p.id == id); if (!product) return; - this.openAddForm(); - - setTimeout(function(){ - + this.openAddForm(() => { const form = document.getElementById('popupForm'); + if (!form) return; Object.entries(product).forEach(([key, val]) => { const field = form.elements.namedItem(key); @@ -446,20 +447,39 @@ ENV.elementRefs.select.transferCategoryCodeSelect.setValue(product.transferCategoryCode); ENV.elementRefs.select.unitCodeSelect.setValue(product.unitCode); document.getElementById("unit").value = product.unit; - - },100) - + }); }, // 선택 아이템 삭제 deleteItemById(id) { - ENV.data.bankList = ENV.data.bankList.filter(p => p.id != id); - const target = document.querySelector(`#listBody div[data-id='${id}']`); - if (target) target.remove(); - this.updateLayout(); + etUI.dialog.alert({ + title: '삭제 안내', + message: '등록하신 내용을 삭제하시겠어요?
삭제된 내용은 복구할 수 없습니다.', + type: 'confirm', + dialogType: 'confirm', + callback: function () { + ENV.data.bankList = ENV.data.bankList.filter(p => p.id != id); + const target = document.querySelector(`#listBody div[data-id='${id}']`); + if (target) target.remove(); + formControl.updateLayout(); + }, + }); }, // 전체 초기화 clearAllItems() { - location.reload(); + etUI.dialog.alert({ + title: '초기화 안내', + message: '등록하신 모든 내용을 삭제하시겠어요?
삭제된 내용은 복구할 수 없습니다.', + type: 'confirm', + dialogType: 'confirm', + callback: function () { + ENV.data.bankList = []; + document.getElementById('listBody').innerHTML = ''; + formControl.updateLayout(); + + // TODO(ks): 선택 삭제 시 전체 count 미반영 중. 일단 전체 초기화에서만 count 갱신. + document.getElementById('totalItems').textContent = ENV.data.bankList.length; + }, + }); }, goSave() { diff --git a/front/src/main/resources/templates/info/bank/output.html b/front/src/main/resources/templates/info/bank/output.html index 8c81dc06..f3b878a6 100644 --- a/front/src/main/resources/templates/info/bank/output.html +++ b/front/src/main/resources/templates/info/bank/output.html @@ -7,7 +7,7 @@

- 은행 자동이체(지출) 내역 [[${bankList.totalElements}]]건 등록 되었습니다. + 은행 자동이체(지출) 내역 [[${bankList.totalElements}]]건 등록 되었습니다.

지출 내역을 등록해 주세요.

@@ -245,7 +245,7 @@ clearAllItems.style.display = "none"; } }, - openAddForm() { + openAddForm(callback) { ajaxUtil._ajaxAsyncMethod( "/api/front/info/bank/create/output/from", {}, @@ -289,6 +289,9 @@ ENV.module.modalPopup.open(); document.querySelector('.modal-content').scrollTop = 0; + + // 모두 로드된 후 콜백 실행 + if (typeof callback === 'function') callback(); }, function(code, rstData) { kri.logger.error('Do nothing. code: '+ code, rstData); @@ -417,20 +420,18 @@ const product = ENV.data.bankList.find(p => p.id == id); if (!product) return; - this.openAddForm(); - - setTimeout(function(){ - + this.openAddForm(() => { const form = document.getElementById('popupForm'); + if (!form) return; Object.entries(product).forEach(([key, val]) => { const field = form.elements.namedItem(key); if (field) { field.value = val; - if(key == 'transferCategoryCode' && val == "code.bank.input.self"){ - document.getElementById(val+"_value").value = product["transferCategory"]; + if (key === 'transferCategoryCode' && val === "code.bank.input.self") { + document.getElementById(val + "_value").value = product["transferCategory"]; } - if(key == 'unitCode' && val == "code.record.unit.self"){ + if (key === 'unitCode' && val === "code.record.unit.self") { document.getElementById("unitDiv").style.display = ""; } } @@ -439,20 +440,40 @@ ENV.elementRefs.select.transferCategoryCodeSelect.setValue(product.transferCategoryCode); ENV.elementRefs.select.unitCodeSelect.setValue(product.unitCode); document.getElementById("unit").value = product.unit; - - },100) + }); }, // 선택 아이템 삭제 deleteItemById(id) { - ENV.data.bankList = ENV.data.bankList.filter(p => p.id != id); - const target = document.querySelector(`#listBody div[data-id='${id}']`); - if (target) target.remove(); - this.updateLayout(); + etUI.dialog.alert({ + title: '삭제 안내', + message: '등록하신 내용을 삭제하시겠어요?
삭제된 내용은 복구할 수 없습니다.', + type: 'confirm', + dialogType: 'confirm', + callback: function () { + ENV.data.bankList = ENV.data.bankList.filter(p => p.id != id); + const target = document.querySelector(`#listBody div[data-id='${id}']`); + if (target) target.remove(); + formControl.updateLayout(); + }, + }); }, // 전체 초기화 clearAllItems() { - location.reload(); + etUI.dialog.alert({ + title: '초기화 안내', + message: '등록하신 모든 내용을 삭제하시겠어요?
삭제된 내용은 복구할 수 없습니다.', + type: 'confirm', + dialogType: 'confirm', + callback: function () { + ENV.data.bankList = []; + document.getElementById('listBody').innerHTML = ''; + formControl.updateLayout(); + + // TODO(ks): 선택 삭제 시 전체 count 미반영 중. 일단 전체 초기화에서만 count 갱신. + document.getElementById('totalItems').textContent = ENV.data.bankList.length; + }, + }); }, goSave() { diff --git a/front/src/main/resources/templates/info/monthly/{id}.html b/front/src/main/resources/templates/info/monthly/{id}.html index 29c9eac8..2870f248 100644 --- a/front/src/main/resources/templates/info/monthly/{id}.html +++ b/front/src/main/resources/templates/info/monthly/{id}.html @@ -8,7 +8,7 @@

[[${currentMonthlyInfo.koreanMonth}]]의
- 임산물 현황 [[${currentList.totalElements}]]건 등록 되었습니다. + 임산물 현황 [[${currentList.totalElements}]]건 등록 되었습니다.

임산물 현황을 등록해 주세요.

@@ -298,7 +298,7 @@ }, // 등록폼 추가 - openAddForm() { + openAddForm(callback) { ajaxUtil._ajaxAsyncMethod( "/api/front/info/monthly/create/from", @@ -341,6 +341,9 @@ ENV.module.modalPopup.open(); document.querySelector('.modal-content').scrollTop = 0; + + // 모두 로드된 후 콜백 실행 + if (typeof callback === 'function') callback(); }, function(code, rstData) { kri.logger.error('Do nothing. code: '+ code, rstData); @@ -461,11 +464,10 @@ const product = ENV.data.productList.find(p => p.id == id); if (!product) return; - this.openAddForm(); - - setTimeout(function() { - + this.openAddForm(() => { const form = document.getElementById('forestForm'); + if (!form) return; + Object.entries(product).forEach(([key, val]) => { const field = form.elements.namedItem(key); if (field) { @@ -485,7 +487,6 @@ } }); - ENV.elementRefs.select.mainYieldUnitCodeSelect.setValue(product.mainYieldUnitCode); ENV.elementRefs.select.mainSaleUnitCodeSelect.setValue(product.mainSaleUnitCode); ENV.elementRefs.select.subYieldUnitCodeSelect.setValue(product.subYieldUnitCode); @@ -494,23 +495,39 @@ document.getElementById("mainSaleUnit").value = product.mainSaleUnit; document.getElementById("subYieldUnit").value = product.subYieldUnit; document.getElementById("subSaleUnit").value = product.subSaleUnit; - - },100); - + }); }, // 선택 아이템 삭제 deleteItemById(id) { - ENV.data.productList = ENV.data.productList.filter(p => p.id != id); - const target = document.querySelector(`#listBody div[data-id='${id}']`); - if (target) target.remove(); - this.updateLayout(); + etUI.dialog.alert({ + title: '삭제 안내', + message: '등록하신 내용을 삭제하시겠어요?
삭제된 내용은 복구할 수 없습니다.', + type: 'confirm', + dialogType: 'confirm', + callback: function () { + ENV.data.productList = ENV.data.productList.filter(p => p.id != id); + const target = document.querySelector(`#listBody div[data-id='${id}']`); + if (target) target.remove(); + formControl.updateLayout(); + }, + }); }, // 전체 초기화 clearAllItems() { - location.reload(); - // ENV.data.productList = []; - // document.getElementById('listBody').innerHTML = ''; - // this.updateListHeader(); + etUI.dialog.alert({ + title: '초기화 안내', + message: '등록하신 모든 내용을 삭제하시겠어요?
삭제된 내용은 복구할 수 없습니다.', + type: 'confirm', + dialogType: 'confirm', + callback: function () { + ENV.data.productList = []; + document.getElementById('listBody').innerHTML = ''; + formControl.updateLayout(); + + // TODO(ks): 선택 삭제 시 전체 count 미반영 중. 일단 전체 초기화에서만 count 갱신. + document.getElementById('totalItems').textContent = ENV.data.productList.length; + }, + }); }, // 아이템 겟수 처리 아이템에 따른 레이아웃 정리 diff --git a/front/src/main/resources/templates/info/user/user.html b/front/src/main/resources/templates/info/user/user.html index 3034ed8b..875d14dc 100644 --- a/front/src/main/resources/templates/info/user/user.html +++ b/front/src/main/resources/templates/info/user/user.html @@ -20,7 +20,7 @@
-
@@ -281,10 +281,6 @@