diff --git a/server/src/UdpServer.cs b/server/src/UdpServer.cs index f8502c9..e396120 100644 --- a/server/src/UdpServer.cs +++ b/server/src/UdpServer.cs @@ -436,7 +436,7 @@ public class UDPServer } var udpDataObj = await RecordUDPData(data, endPoint, time, Convert.ToInt32(data[1 + 4])); - PrintData(udpDataObj); + // PrintData(udpDataObj); } catch (Exception e) { diff --git a/src/components/equipments/Switch.vue b/src/components/equipments/Switch.vue index 8f0a021..edd892c 100644 --- a/src/components/equipments/Switch.vue +++ b/src/components/equipments/Switch.vue @@ -191,20 +191,30 @@ function setBtnStatus(idx: number, isOn: boolean) { } // 监听 props 变化只同步一次 +const isFirstEnableDigitalTwin = ref(true); watch( () => props.enableDigitalTwin, (newVal) => { - const client = getClient(); - client.setEnable(newVal); + if (isFirstEnableDigitalTwin.value) { + isFirstEnableDigitalTwin.value = false; + } else { + const client = getClient(); + client.setEnable(newVal); + } }, { immediate: true }, ); +const isFirstUpdateStatus = ref(true); watch( () => [switchCount.value, props.initialValues], () => { btnStatus.value = parseInitialValues(); - updateStatus(btnStatus.value); + if (isFirstUpdateStatus.value) { + isFirstUpdateStatus.value = false; + } else { + updateStatus(btnStatus.value); + } }, );