Browse Source

修复刚打开表单时,关联选项设置没有默认隐藏的bug,包括开关

lwx_v1
liwenxuan 1 year ago
parent
commit
156436721c
  1. 11
      src/components/DesignForm/public/form/form.vue

11
src/components/DesignForm/public/form/form.vue

@ -165,15 +165,18 @@ const forEachGetFormModel = (list: FormList[], obj: any) => {
}) })
} else if (['card', 'div'].includes(item.type)) { } else if (['card', 'div'].includes(item.type)) {
forEachGetFormModel(item.list, obj) forEachGetFormModel(item.list, obj)
} /* else if(['switch'].includes(item.type)){ }else {
console.log(item)
} */else {
const excludeType = ['title', 'divider', 'txt', 'button'] const excludeType = ['title', 'divider', 'txt', 'button']
if (excludeType.indexOf(item.type) === -1) { if (excludeType.indexOf(item.type) === -1) {
obj[item.name] = jsonParseStringify(item.control.modelValue) obj[item.name] = jsonParseStringify(item.control.modelValue)
if(['switch'].includes(item.type)){
model.value[item.name] = jsonParseStringify(item.control.inactiveValue)
console.log(model.value)
}
} }
} }
}) })
showOrHide()
} }
function arrayEqual(a: string[], b: any[]) { function arrayEqual(a: string[], b: any[]) {
@ -401,7 +404,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st
// //
if(formProps.value.type!=5){ if(formProps.value.type!=5){
console.log(hideFieldArr) //console.log(hideFieldArr)
props.formData.config.hideField?.push(...hideFieldArr)// props.formData.config.hideField?.push(...hideFieldArr)//
} }

Loading…
Cancel
Save