From 8d604014dbf6974f97d98a3719d04049af58216c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=9A=B0=EC=84=B1?= Date: Mon, 23 Jun 2025 18:14:57 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/info/user/user.html | 143 ++++++++++++------ 1 file changed, 95 insertions(+), 48 deletions(-) diff --git a/front/src/main/resources/templates/info/user/user.html b/front/src/main/resources/templates/info/user/user.html index f7b0c2c6..3034ed8b 100644 --- a/front/src/main/resources/templates/info/user/user.html +++ b/front/src/main/resources/templates/info/user/user.html @@ -61,23 +61,23 @@
@@ -100,7 +100,7 @@
-
@@ -108,7 +108,7 @@
-
    -
  • 010
  • +
  • 010
  • +
  • 011
@@ -156,7 +157,7 @@
- + @@ -173,7 +174,7 @@
  • option1 + th:classappend="${item.id eq userInfo.regionMainCode ? 'current' : ''}">option1
  • @@ -202,7 +203,9 @@
    • option1 + th:text="${item.codeText}" + th:classappend="${item.id eq userInfo.regionSubCode ? 'current' : ''}" + >option1
    • @@ -291,29 +294,66 @@ module: { confirmPopup: null }, + select:{ + select1:null, + select2:null, + select3:null, + select4:null + }, submitted: false, }; let formControl = { init() { - this._bindUI(); - ajaxUtil._alert('select 010->10으로 노출\n 최초값 지정 및 값 취득 함수 필요\n 개인정보 작성 필요\n 모달 내부 스크롤 기능 추가 필요', null); + console.log("init") + setTimeout(function(){ + formControl._bindUI(); + },300); + + //ajaxUtil._alert('select 010->10으로 노출\n 최초값 지정 및 값 취득 함수 필요\n 개인정보 작성 필요\n 모달 내부 스크롤 기능 추가 필요', null); }, _bindUI() { + + console.log("bind") ENV.module.confirmPopup = document.querySelector(".confirmPopup").ui; const $select1 = document.querySelector('#regionMainCodeId'); - const selectboxInstance1 = new etUI.components.SelectBox(); - selectboxInstance1.core.init($select1, { + ENV.select.select1 = new etUI.components.SelectBox(); + ENV.select.select1.core.init($select1, { selectItemCallback({selectValue, dataValue}){ - console.log('selectItemCallback', selectValue, dataValue) - $('input[name="regionMainCode"]').val(dataValue); + + document.querySelector('#regionMainCode').value = dataValue; } }); - // selectboxInstance1.update(); - selectboxInstance1.setValue($('input[name=regionMainCode]').val()); + const $select2 = document.querySelector('#regionSubCodeId'); + ENV.select.select2 = new etUI.components.SelectBox(); + ENV.select.select2.core.init($select2, { + selectItemCallback({selectValue, dataValue}){ + document.querySelector('#regionSubCode').value = dataValue; + } + }); + + const $select3 = document.querySelector('#tel1Id'); + ENV.select.select3 = new etUI.components.SelectBox(); + ENV.select.select3.core.init($select3, { + selectItemCallback({selectValue, dataValue}){ + document.querySelector('#tel1').value = dataValue; + } + }); + + + const $select4 = document.querySelector('#phone1Id'); + ENV.select.select4 = new etUI.components.SelectBox(); + ENV.select.select4.core.init($select4, { + selectItemCallback({selectValue, dataValue}){ + document.querySelector('#phone1').value = dataValue; + } + }); + + + // selectboxInstance1.setValue($('input[name=regionMainCode]').val()); }, confirmPopup() { ENV.module.confirmPopup.open(); @@ -328,23 +368,30 @@ updateUserInfo() { const f = document.reqForm; - // TODO 어쩔수 없이 이렇게 하는데..... 콤포넌트값 핸들링 방법 UX에서 지정하면 수정해야함. - const tel1Element = document.getElementById('tel1Id'); - const phone1IdElement = document.getElementById('phone1Id'); - const regionMainCodeIdElement = document.getElementById('regionMainCodeId'); - const regionSubCodeIdElement = document.getElementById('regionSubCodeId'); - if (tel1Element && tel1Element.value) { - f.tel1.value = tel1Element.value; - } - if (phone1IdElement && phone1IdElement.value) { - f.phone1.value = phone1IdElement.value; - } - if (regionMainCodeIdElement && regionMainCodeIdElement.value) { - f.regionMainCode.value = regionMainCodeIdElement.value; - } - if (regionSubCodeIdElement && regionSubCodeIdElement.value) { - f.regionSubCode.value = regionSubCodeIdElement.value; - } + // // TODO 어쩔수 없이 이렇게 하는데..... 콤포넌트값 핸들링 방법 UX에서 지정하면 수정해야함. + // const tel1Element = document.getElementById('tel1Id'); + // const phone1IdElement = document.getElementById('phone1Id'); + // const regionMainCodeIdElement = document.getElementById('regionMainCodeId'); + // const regionSubCodeIdElement = document.getElementById('regionSubCodeId'); + // if (tel1Element && tel1Element.value) { + // f.tel1.value = tel1Element.value; + // } + // if (phone1IdElement && phone1IdElement.value) { + // f.phone1.value = phone1IdElement.value; + // } + // if (regionMainCodeIdElement && regionMainCodeIdElement.value) { + // f.regionMainCode.value = regionMainCodeIdElement.value; + // } + // if (regionSubCodeIdElement && regionSubCodeIdElement.value) { + // f.regionSubCode.value = regionSubCodeIdElement.value; + // } + + f.regionMainCode.value = ENV.select.select1.getValue(); + f.regionSubCode.value = ENV.select.select2.getValue(); + f.tel1.value = ENV.select.select3.getValue(); + f.phone1.value = ENV.select.select4.getValue(); + + const obj = $(f).serializeObject();