diff --git a/src/components/device/device-card/ndm-alarm-host/alarm-host-card.vue b/src/components/device/device-card/ndm-alarm-host/alarm-host-card.vue index 771a9d1..968064c 100644 --- a/src/components/device/device-card/ndm-alarm-host/alarm-host-card.vue +++ b/src/components/device/device-card/ndm-alarm-host/alarm-host-card.vue @@ -35,8 +35,8 @@ const activeTabName = ref('当前诊断'); const onTabChange = (name: string) => { activeTabName.value = name; }; -watch([ndmDevice, showDeviceRawData], ([newDevice, enabled], [oldDevice]) => { - if (newDevice.id !== oldDevice.id || !enabled) { +watch([ndmDevice, showDeviceRawData], ([newDevice, showRaw], [oldDevice]) => { + if (newDevice.id !== oldDevice.id || (!showRaw && activeTabName.value === '原始数据')) { activeTabName.value = '当前诊断'; } }); diff --git a/src/components/device/device-card/ndm-camera/camera-card.vue b/src/components/device/device-card/ndm-camera/camera-card.vue index 1763f83..d5ee763 100644 --- a/src/components/device/device-card/ndm-camera/camera-card.vue +++ b/src/components/device/device-card/ndm-camera/camera-card.vue @@ -35,8 +35,8 @@ const activeTabName = ref('当前诊断'); const onTabChange = (name: string) => { activeTabName.value = name; }; -watch([ndmDevice, showDeviceRawData], ([newDevice, enabled], [oldDevice]) => { - if (newDevice.id !== oldDevice.id || !enabled) { +watch([ndmDevice, showDeviceRawData], ([newDevice, showRaw], [oldDevice]) => { + if (newDevice.id !== oldDevice.id || (!showRaw && activeTabName.value === '原始数据')) { activeTabName.value = '当前诊断'; } }); diff --git a/src/components/device/device-card/ndm-decoder/decoder-card.vue b/src/components/device/device-card/ndm-decoder/decoder-card.vue index ee3dcc0..d3aa989 100644 --- a/src/components/device/device-card/ndm-decoder/decoder-card.vue +++ b/src/components/device/device-card/ndm-decoder/decoder-card.vue @@ -35,8 +35,8 @@ const activeTabName = ref('当前诊断'); const onTabChange = (name: string) => { activeTabName.value = name; }; -watch([ndmDevice, showDeviceRawData], ([newDevice, enabled], [oldDevice]) => { - if (newDevice.id !== oldDevice.id || !enabled) { +watch([ndmDevice, showDeviceRawData], ([newDevice, showRaw], [oldDevice]) => { + if (newDevice.id !== oldDevice.id || (!showRaw && activeTabName.value === '原始数据')) { activeTabName.value = '当前诊断'; } }); diff --git a/src/components/device/device-card/ndm-keyboard/keyboard-card.vue b/src/components/device/device-card/ndm-keyboard/keyboard-card.vue index 850e118..1c0279a 100644 --- a/src/components/device/device-card/ndm-keyboard/keyboard-card.vue +++ b/src/components/device/device-card/ndm-keyboard/keyboard-card.vue @@ -35,8 +35,8 @@ const activeTabName = ref('当前诊断'); const onTabChange = (name: string) => { activeTabName.value = name; }; -watch([ndmDevice, showDeviceRawData], ([newDevice, enabled], [oldDevice]) => { - if (newDevice.id !== oldDevice.id || !enabled) { +watch([ndmDevice, showDeviceRawData], ([newDevice, showRaw], [oldDevice]) => { + if (newDevice.id !== oldDevice.id || (!showRaw && activeTabName.value === '原始数据')) { activeTabName.value = '当前诊断'; } }); diff --git a/src/components/device/device-card/ndm-nvr/nvr-card.vue b/src/components/device/device-card/ndm-nvr/nvr-card.vue index d5fa41f..a49e4d0 100644 --- a/src/components/device/device-card/ndm-nvr/nvr-card.vue +++ b/src/components/device/device-card/ndm-nvr/nvr-card.vue @@ -35,8 +35,8 @@ const activeTabName = ref('当前诊断'); const onTabChange = (name: string) => { activeTabName.value = name; }; -watch([ndmDevice, showDeviceRawData], ([newDevice, enabled], [oldDevice]) => { - if (newDevice.id !== oldDevice.id || !enabled) { +watch([ndmDevice, showDeviceRawData], ([newDevice, showRaw], [oldDevice]) => { + if (newDevice.id !== oldDevice.id || (!showRaw && activeTabName.value === '原始数据')) { activeTabName.value = '当前诊断'; } }); diff --git a/src/components/device/device-card/ndm-security-box/security-box-card.vue b/src/components/device/device-card/ndm-security-box/security-box-card.vue index f26854d..bc3ef1b 100644 --- a/src/components/device/device-card/ndm-security-box/security-box-card.vue +++ b/src/components/device/device-card/ndm-security-box/security-box-card.vue @@ -35,8 +35,8 @@ const activeTabName = ref('当前诊断'); const onTabChange = (name: string) => { activeTabName.value = name; }; -watch([ndmDevice, showDeviceRawData], ([newDevice, enabled], [oldDevice]) => { - if (newDevice.id !== oldDevice.id || !enabled) { +watch([ndmDevice, showDeviceRawData], ([newDevice, showRaw], [oldDevice]) => { + if (newDevice.id !== oldDevice.id || (!showRaw && activeTabName.value === '原始数据')) { activeTabName.value = '当前诊断'; } }); diff --git a/src/components/device/device-card/ndm-server/server-card.vue b/src/components/device/device-card/ndm-server/server-card.vue index 317c63d..6c5680d 100644 --- a/src/components/device/device-card/ndm-server/server-card.vue +++ b/src/components/device/device-card/ndm-server/server-card.vue @@ -35,8 +35,8 @@ const activeTabName = ref('当前诊断'); const onTabChange = (name: string) => { activeTabName.value = name; }; -watch([ndmDevice, showDeviceRawData], ([newDevice, enabled], [oldDevice]) => { - if (newDevice.id !== oldDevice.id || !enabled) { +watch([ndmDevice, showDeviceRawData], ([newDevice, showRaw], [oldDevice]) => { + if (newDevice.id !== oldDevice.id || (!showRaw && activeTabName.value === '原始数据')) { activeTabName.value = '当前诊断'; } }); diff --git a/src/components/device/device-card/ndm-switch/switch-card.vue b/src/components/device/device-card/ndm-switch/switch-card.vue index 770efaa..c4965ba 100644 --- a/src/components/device/device-card/ndm-switch/switch-card.vue +++ b/src/components/device/device-card/ndm-switch/switch-card.vue @@ -35,8 +35,8 @@ const activeTabName = ref('当前诊断'); const onTabChange = (name: string) => { activeTabName.value = name; }; -watch([ndmDevice, showDeviceRawData], ([newDevice, enabled], [oldDevice]) => { - if (newDevice.id !== oldDevice.id || !enabled) { +watch([ndmDevice, showDeviceRawData], ([newDevice, showRaw], [oldDevice]) => { + if (newDevice.id !== oldDevice.id || (!showRaw && activeTabName.value === '原始数据')) { activeTabName.value = '当前诊断'; } });