fix: 修复模型参数修改后,未清除旧数据
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
shaohuzhang1 2024-10-30 21:11:23 +08:00 committed by shaohuzhang1
parent d49a7851b8
commit 44b3aed595

View File

@ -172,8 +172,17 @@ const render = (
formFieldList.value = ok.data
})
}
if (data) {
formValue.value = _.cloneDeep(data)
const form_data = data ? data : {}
if (form_data) {
const value = formFieldList.value
.map((item) => {
if (form_data[item.field] !== undefined) {
return { [item.field]: form_data[item.field] }
}
return { [item.field]: item.default_value }
})
.reduce((x, y) => ({ ...x, ...y }), {})
formValue.value = _.cloneDeep(value)
}
}
/**