【代码优化】IoT: 数据桥梁配置切换类型时重置配置

This commit is contained in:
puhui999 2025-03-14 17:07:24 +08:00
parent 59062a1c17
commit 38f0aff482

View File

@ -22,7 +22,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="桥梁类型" prop="type">
<el-radio-group v-model="formData.type">
<el-radio-group :model-value="formData.type" @change="handleTypeChange">
<el-radio
v-for="dict in getIntDictOptions(DICT_TYPE.IOT_DATA_BRIDGE_TYPE_ENUM)"
:key="dict.value"
@ -185,6 +185,13 @@ const submitForm = async () => {
}
}
/** 处理类型切换事件 */
const handleTypeChange = (val: number) => {
formData.value.type = val
//
formData.value.config = {} as any
}
/** 重置表单 */
const resetForm = () => {
formData.value = {