Skip to content

Commit 38f0aff

Browse files
author
puhui999
committed
【代码优化】IoT: 数据桥梁配置切换类型时重置配置
1 parent 59062a1 commit 38f0aff

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/views/iot/rule/databridge/IoTDataBridgeForm.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</el-radio-group>
2323
</el-form-item>
2424
<el-form-item label="桥梁类型" prop="type">
25-
<el-radio-group v-model="formData.type">
25+
<el-radio-group :model-value="formData.type" @change="handleTypeChange">
2626
<el-radio
2727
v-for="dict in getIntDictOptions(DICT_TYPE.IOT_DATA_BRIDGE_TYPE_ENUM)"
2828
:key="dict.value"
@@ -185,6 +185,13 @@ const submitForm = async () => {
185185
}
186186
}
187187
188+
/** 处理类型切换事件 */
189+
const handleTypeChange = (val: number) => {
190+
formData.value.type = val
191+
// 切换类型时重置配置
192+
formData.value.config = {} as any
193+
}
194+
188195
/** 重置表单 */
189196
const resetForm = () => {
190197
formData.value = {

0 commit comments

Comments
 (0)