|
|
|
@ -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 어트리뷰트로 찾기
|
|
|
|
|
**************************************************************************/
|
|
|
|
|