From 54637a3e838f425074e6ea990f30363c6995e94d Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 11 May 2023 13:20:05 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EC=86=8C=EC=8A=A4=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/fims/framework/cmm/cmmUtil.js | 158 +++++++++--------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js b/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js index c7f9683a..09504351 100644 --- a/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js +++ b/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js @@ -410,6 +410,85 @@ String.prototype.isEmail = function() { return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(this); }; + +class FimsFormFields extends FormFields { + + /** + * form 에 json data set + * element tag에 data-fmt-type 으로 데이타 format이 지정된 경우 해당 포맷으로 출력 + * @param {object} formObj document.querySelector('form') + * @param {object} jsonData json type data + */ + set(obj){ + + document.querySelectorAll(this.children).forEach(input => { + + let prop = input.getAttribute("data-map") + || input.name + || input.id; + if (!prop) return; + + let dataItem = obj instanceof DataItem, + value = dataItem ? obj.getValue(prop) : obj[prop]; + + if ("radio" == input.type) { + if (value && value == input.value) + input.checked = true; + } else if("checkbox" == input.type) { + if (value && value == input.value) + input.checked = ("Y" === value); + } else if(input.tagName == "SELECT") { + for(let option of input.options) { + if(option.value == value){ + option.selected = true; + } else { + option.selected = false; + } + } + } else { + if(value == null){ + value = ""; + } + // element data-fmt-type에 정의된 format 적용 + // dt - yyyy-mm-dd HH:mm:ss, day - yyyy-mm-dd, time - HH:mm:ss, number - #,### + if(input.dataset.fmtType){ + const fmtType = input.dataset.fmtType; + switch (fmtType) { + case 'dt' : + value = StrDateTimeFormat.format(value); + break; + case 'day' : + value = StrDateFormat.format(value); + break; + case 'time' : + value = StrTimeFormat.format(value); + break; + case 'number' : + value = CommaNumberFormat.format(value); + break; + default: + break; + + } + } + if(input.name){ + + input.value = value; + + //보안모드 마스킹 항목 + if(input.tagName === 'INPUT' && input.id && input.classList.contains("privacy")){ + let maskVal = value.replace(/[0-9a-zA-Z]/g, "*"); + document.getElementById(input.id+"$mask").value = maskVal; + } + } + + } + }); + + + } +} + /** * 숫자를 콤마 포멧으로 변환 **/ @@ -491,85 +570,6 @@ class CodeFormat { } } -class FimsFormFields extends FormFields { - - /** - * form 에 json data set - * element tag에 data-fmt-type 으로 데이타 format이 지정된 경우 해당 포맷으로 출력 - * @param {object} formObj document.querySelector('form') - * @param {object} jsonData json type data - */ - set(obj){ - - document.querySelectorAll(this.children).forEach(input => { - - let prop = input.getAttribute("data-map") - || input.name - || input.id; - if (!prop) return; - - let dataItem = obj instanceof DataItem, - value = dataItem ? obj.getValue(prop) : obj[prop]; - - if ("radio" == input.type) { - if (value && value == input.value) - input.checked = true; - } else if("checkbox" == input.type) { - if (value && value == input.value) - input.checked = ("Y" === value); - } else if(input.tagName == "SELECT") { - for(let option of input.options) { - if(option.value == value){ - option.selected = true; - } else { - option.selected = false; - } - } - } else { - if(value == null){ - value = ""; - } - // element data-fmt-type에 정의된 format 적용 - // dt - yyyy-mm-dd HH:mm:ss, day - yyyy-mm-dd, time - HH:mm:ss, number - #,### - if(input.dataset.fmtType){ - const fmtType = input.dataset.fmtType; - switch (fmtType) { - case 'dt' : - value = StrDateTimeFormat.format(value); - break; - case 'day' : - value = StrDateFormat.format(value); - break; - case 'time' : - value = StrTimeFormat.format(value); - break; - case 'number' : - value = CommaNumberFormat.format(value); - break; - default: - break; - - } - } - if(input.name){ - - input.value = value; - - //보안모드 마스킹 항목 - if(input.tagName === 'INPUT' && input.id && input.classList.contains("privacy")){ - let maskVal = value.replace(/[0-9a-zA-Z]/g, "*"); - document.getElementById(input.id+"$mask").value = maskVal; - } - } - - } - }); - - - } -} - - /** *