Commit f1fddc40 by 周田

feat:更改参数时,页面发生变化

parent cc0da931
......@@ -85,9 +85,10 @@ const props = defineProps<propType>();
const ip = ref<string>()
const port = ref<number>()
const checked_performance_fields = ref<string[]>([])
let is_tcp = false
onMounted(() => {
let is_tcp = props.deviceInfo.communicate_mode.toUpperCase().includes('TCP'.toUpperCase())
is_tcp = props.deviceInfo.communicate_mode.toUpperCase().includes('TCP'.toUpperCase())
ip.value = is_tcp ? props.deviceInfo.tcp_ip : props.deviceInfo.udp_ip_src
port.value = is_tcp ? props.deviceInfo.tcp_port : props.deviceInfo.udp_port_src
checked_performance_fields.value = JSON.parse(props.deviceInfo.performance_fields!)
......@@ -154,6 +155,14 @@ const handleCheckedCitiesChange = (value: CheckboxValueType[]) => {
const update_communication = () => {
dialogFormVisible.value = false
props.deviceInfo.device_name = form.value.device_name
props.deviceInfo.device_name_chn = form.value.device_name_chn
props.deviceInfo.station_id = form.value.station_id
props.deviceInfo.protocol_name = form.value.protocol_name
props.deviceInfo.communicate_mode = form.value.communicate_mode
ip.value = form.value.tcp_ip
port.value = form.value.tcp_port
form.value.performance_fields = JSON.stringify(checked_performance_fields.value)
axios.put(
'api/device_communication/communicate/' + form.value.id + '/',
......
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