Skip to content

Commit c56ed98

Browse files
committed
fix: update option list search logic to handle string and array form_data values
--bug=1053919 --user=刘瑞斌 【函数库】非必填启动参数开启启动参数后再次编辑多选置空 https://www.tapd.cn/57709429/s/1677136
1 parent 8a7e41b commit c56ed98

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ui/src/components/dynamics-form/index.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,13 @@ const render = (
181181
if (form_data[item.field] !== undefined) {
182182
if (item.value_field && item.option_list && item.option_list.length > 0) {
183183
const value_field = item.value_field
184-
const find = item.option_list?.find((i) => i[value_field] === form_data[item.field])
184+
const find = item.option_list?.find((i) => {
185+
if (typeof form_data[item.field] === 'string') {
186+
return i[value_field] === form_data[item.field]
187+
} else {
188+
return form_data[item.field].indexOf([value_field]) === -1
189+
}
190+
})
185191
if (find) {
186192
return { [item.field]: form_data[item.field] }
187193
}

0 commit comments

Comments
 (0)