Commit 6410c5ff by 周田

fix:弹框修改协议时,已经选择要清空

parent d97a61c9
......@@ -14,7 +14,7 @@
<el-input v-model="form.station_id" autocomplete="false" />
</el-form-item>
<el-form-item label="协议名称" :label-width="formLabelWidth" prop="protocol_name">
<el-select v-model="form.protocol_name" @change="handleProtocolChange">
<el-select v-model="form.protocol_name" @change="handleProtocolChange(form.protocol_name, [])">
<el-option v-for="protocolName in store.protocolNames" :label="protocolName.label" :value="protocolName.value" />
</el-select>
</el-form-item>
......@@ -145,7 +145,7 @@ watch(() => props.isShow, () => {
udp_port_dst: props.deviceInfo!.udp_port_dst,
}
handleModeChange(form.value.communicate_mode)
handleProtocolChange(form.value.protocol_name)
handleProtocolChange(form.value.protocol_name, checked_performance_fields.value)
checked_performance_fields.value = props.deviceInfo!.checked_performance_fields!
}
})
......@@ -209,10 +209,11 @@ const rules = reactive<FormRules<typeof form>>({
})
// 下拉框选择触发的事件
const handleProtocolChange = (protocol_name: string) => {
const handleProtocolChange = (protocol_name: string, checked_fields: string[]) => {
axios.get('/api/device_communication/protocol_performance/' + protocol_name + '/')
.then((res) => {
performance_fields.value = res.data
checked_performance_fields.value = checked_fields
})
.catch((err) => {
console.log(err);
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment