【代码优化】IoT: 物模型

This commit is contained in:
puhui999
2025-02-20 16:30:36 +08:00
parent bfdf7f6173
commit 4f1c79ba6d
11 changed files with 128 additions and 155 deletions

View File

@@ -4,15 +4,15 @@
<el-radio-group v-model="dataSpecs.childDataType" @change="handleChange">
<template v-for="item in dataTypeOptions" :key="item.value">
<el-radio
class="w-1/3"
v-if="
!(
[DataSpecsDataType.ENUM, DataSpecsDataType.ARRAY, DataSpecsDataType.DATE] as any[]
).includes(item.value)
"
:value="item.value"
class="w-1/3"
>
{{ item.label }}
{{ `${item.value}(${item.label})` }}
</el-radio>
</template>
</el-radio-group>

View File

@@ -118,6 +118,9 @@ const submitForm = async () => {
}
// 查找是否已有相同 identifier 的项
if (isEmpty(dataSpecsList.value)) {
dataSpecsList.value = []
}
const existingIndex = dataSpecsList.value.findIndex(
(spec) => spec.identifier === data.identifier
)