fix(iot):物模型编辑回显时,service / event 子字段补数组兜底,避免参数列表绑定 undefined

pull/878/head
YunaiV 2026-05-18 01:03:04 +08:00
parent 46c436e0df
commit 0c54bf28b3
1 changed files with 7 additions and 2 deletions

View File

@ -122,11 +122,16 @@ const open = async (type: string, id?: number) => {
} }
// //
if (isEmpty(formData.value.service)) { if (isEmpty(formData.value.service)) {
formData.value.service = {} formData.value.service = { inputParams: [], outputParams: [] }
} else {
formData.value.service.inputParams ??= []
formData.value.service.outputParams ??= []
} }
// //
if (isEmpty(formData.value.event)) { if (isEmpty(formData.value.event)) {
formData.value.event = {} formData.value.event = { outputParams: [] }
} else {
formData.value.event.outputParams ??= []
} }
} finally { } finally {
formLoading.value = false formLoading.value = false