From 810886d11d0d33ff54d2f21fab9325275bf90d13 Mon Sep 17 00:00:00 2001 From: leebj Date: Tue, 27 Aug 2024 15:51:52 +0900 Subject: [PATCH] =?UTF-8?q?FimsFormFields.get=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/js/fims/cmmn/fims-base.js | 75 ++++++++++--------- .../resources/js/fims/cmmn/fims-support.js | 4 + 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/src/main/webapp/resources/js/fims/cmmn/fims-base.js b/src/main/webapp/resources/js/fims/cmmn/fims-base.js index d6a2e9c3..2966b4a4 100644 --- a/src/main/webapp/resources/js/fims/cmmn/fims-base.js +++ b/src/main/webapp/resources/js/fims/cmmn/fims-base.js @@ -101,48 +101,53 @@ class FimsFormFields extends FormFields { get() { let obj = {}; document.querySelectorAll(this.children).forEach(input => { - let property = input.name || input.id; - let value = input.value; - if("radio" == input.type) { - if(input.checked) - obj[property] = value; - } else if("checkbox" == input.type) { - if(input.checked){ - if(obj[property]){ - obj[property] += ","+value; - } else { - obj[property] = value; + if(input.tagName == "INPUT" || input.tagName == "SELECT" || input.tagName == "TEXTAREA"){ + let property = input.name || input.id; + let value = input.value; + if("radio" == input.type) { + if(input.checked) + obj[property] = value; + } else if("checkbox" == input.type) { + if(input.checked){ + if(obj[property]){ + obj[property] += ","+value; + } else { + obj[property] = value; + } } - } - } else { - if(input.dataset.fmtType){ - const fmtType = input.dataset.fmtType; - switch (fmtType) { - case 'dt' : - value = value.replaceAll("-","").replaceAll(":","").replaceAll(" ",""); - break; - case 'day' : - value = value.replaceAll("-",""); - break; - case 'time' : - value = value.replaceAll(":",""); - break; - case 'number' : - value = value.replaceAll(",",""); - break; - default: - break; - - } - } - obj[property] = value; - } + } else { + if(input.dataset.fmtType){ + const fmtType = input.dataset.fmtType; + switch (fmtType) { + case 'dt' : + value = value.replaceAll("-","").replaceAll(":","").replaceAll(" ",""); + break; + case 'day' : + value = value.replaceAll("-",""); + break; + case 'time' : + value = value.replaceAll(":",""); + break; + case 'number' : + value = value.replaceAll(",",""); + break; + default: + break; + } + } + obj[property] = value; + } + } }); return obj; } } +function newFimsFormFields(conf){ + return new FimsFormFields(conf); +} + /************************************************************************** * data-doctx,name 어트리뷰트로 찾기 **************************************************************************/ diff --git a/src/main/webapp/resources/js/fims/cmmn/fims-support.js b/src/main/webapp/resources/js/fims/cmmn/fims-support.js index 25ff7755..02d427bf 100644 --- a/src/main/webapp/resources/js/fims/cmmn/fims-support.js +++ b/src/main/webapp/resources/js/fims/cmmn/fims-support.js @@ -563,4 +563,8 @@ class FimsPagingSupport extends PagingSupport { $(this.doq.selector(this.linkContainer)).setPagingInfo(pagination); } +} + +function newFimsPagingSupport(conf){ + return new FimsPagingSupport(conf); } \ No newline at end of file