fix: Fix default_value not show when image model changed
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

--bug=1052695 --user=刘瑞斌 【应用】高级编排-设置-图片生成组件-切换模型后图片尺寸为空-未同步切换到当前模型的首个尺寸 https://www.tapd.cn/57709429/s/1661346
This commit is contained in:
CaptainB 2025-03-03 18:14:47 +08:00 committed by 刘瑞斌
parent e7f13871f8
commit 5e563054f9

View File

@ -179,7 +179,12 @@ const render = (
const value = formFieldList.value
.map((item) => {
if (form_data[item.field] !== undefined) {
return { [item.field]: form_data[item.field] }
const v: any = item.option_list?.filter(i => i.value_field === form_data[item.field])
if (v?.length > 0) {
return { [item.field]: form_data[item.field] };
} else {
return { [item.field]: item.default_value };
}
}
if (item.show_default_value === true || item.show_default_value === undefined) {
return { [item.field]: item.default_value }