From d0b065d6baf3b0241a98cd0f225f044aed52f390 Mon Sep 17 00:00:00 2001 From: yangsy Date: Thu, 18 Dec 2025 21:35:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=B7=AF=E7=94=B1=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20`from`=20=E6=94=B9=E4=B8=BA`fromPage`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/device-card/ndm-alarm-host/alarm-host-card.vue | 4 ++-- .../device/device-card/ndm-camera/camera-card.vue | 4 ++-- .../device/device-card/ndm-decoder/decoder-card.vue | 4 ++-- .../device/device-card/ndm-keyboard/keyboard-card.vue | 4 ++-- src/components/device/device-card/ndm-nvr/nvr-card.vue | 4 ++-- .../device-card/ndm-security-box/security-box-card.vue | 4 ++-- .../device/device-card/ndm-server/server-card.vue | 4 ++-- .../device/device-card/ndm-switch/switch-card.vue | 4 ++-- src/composables/device/use-device-selection.ts | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) 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 a8d357f..5719a42 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 @@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore); const { ndmDevice, station } = toRefs(props); const showPageHeader = computed(() => { - return !!route.query['from']; + return !!route.query['fromPage']; }); const onBack = () => { - router.push({ path: `${route.query['from']}` }); + router.push({ path: `${route.query['fromPage']}` }); }; const activeTabName = ref('当前诊断'); 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 c0bf10f..0f87619 100644 --- a/src/components/device/device-card/ndm-camera/camera-card.vue +++ b/src/components/device/device-card/ndm-camera/camera-card.vue @@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore); const { ndmDevice, station } = toRefs(props); const showPageHeader = computed(() => { - return !!route.query['from']; + return !!route.query['fromPage']; }); const onBack = () => { - router.push({ path: `${route.query['from']}` }); + router.push({ path: `${route.query['fromPage']}` }); }; const activeTabName = ref('当前诊断'); 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 5fe4b34..9d5bd75 100644 --- a/src/components/device/device-card/ndm-decoder/decoder-card.vue +++ b/src/components/device/device-card/ndm-decoder/decoder-card.vue @@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore); const { ndmDevice, station } = toRefs(props); const showPageHeader = computed(() => { - return !!route.query['from']; + return !!route.query['fromPage']; }); const onBack = () => { - router.push({ path: `${route.query['from']}` }); + router.push({ path: `${route.query['fromPage']}` }); }; const activeTabName = ref('当前诊断'); 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 2f17410..737efb4 100644 --- a/src/components/device/device-card/ndm-keyboard/keyboard-card.vue +++ b/src/components/device/device-card/ndm-keyboard/keyboard-card.vue @@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore); const { ndmDevice, station } = toRefs(props); const showPageHeader = computed(() => { - return !!route.query['from']; + return !!route.query['fromPage']; }); const onBack = () => { - router.push({ path: `${route.query['from']}` }); + router.push({ path: `${route.query['fromPage']}` }); }; const activeTabName = ref('当前诊断'); 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 2cc200e..54ed2b1 100644 --- a/src/components/device/device-card/ndm-nvr/nvr-card.vue +++ b/src/components/device/device-card/ndm-nvr/nvr-card.vue @@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore); const { ndmDevice, station } = toRefs(props); const showPageHeader = computed(() => { - return !!route.query['from']; + return !!route.query['fromPage']; }); const onBack = () => { - router.push({ path: `${route.query['from']}` }); + router.push({ path: `${route.query['fromPage']}` }); }; const activeTabName = ref('当前诊断'); 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 ba81f4b..8ecbc9b 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 @@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore); const { ndmDevice, station } = toRefs(props); const showPageHeader = computed(() => { - return !!route.query['from']; + return !!route.query['fromPage']; }); const onBack = () => { - router.push({ path: `${route.query['from']}` }); + router.push({ path: `${route.query['fromPage']}` }); }; const activeTabName = ref('当前诊断'); 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 1afa360..96affcf 100644 --- a/src/components/device/device-card/ndm-server/server-card.vue +++ b/src/components/device/device-card/ndm-server/server-card.vue @@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore); const { ndmDevice, station } = toRefs(props); const showPageHeader = computed(() => { - return !!route.query['from']; + return !!route.query['fromPage']; }); const onBack = () => { - router.push({ path: `${route.query['from']}` }); + router.push({ path: `${route.query['fromPage']}` }); }; const activeTabName = ref('当前诊断'); 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 5d34a54..5448162 100644 --- a/src/components/device/device-card/ndm-switch/switch-card.vue +++ b/src/components/device/device-card/ndm-switch/switch-card.vue @@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore); const { ndmDevice, station } = toRefs(props); const showPageHeader = computed(() => { - return !!route.query['from']; + return !!route.query['fromPage']; }); const onBack = () => { - router.push({ path: `${route.query['from']}` }); + router.push({ path: `${route.query['fromPage']}` }); }; const activeTabName = ref('当前诊断'); diff --git a/src/composables/device/use-device-selection.ts b/src/composables/device/use-device-selection.ts index 6751666..dd1319b 100644 --- a/src/composables/device/use-device-selection.ts +++ b/src/composables/device/use-device-selection.ts @@ -58,16 +58,16 @@ export const useDeviceSelection = () => { stationCode, deviceType, deviceDbId, - from: route.path, + fromPage: route.path, }, }); }; const syncToRoute = () => { const query = { ...route.query }; - // 当选中的设备发生变化时,删除from参数 + // 当选中的设备发生变化时,删除fromPage参数 if (selectedDevice.value?.id && route.query.deviceDbId !== selectedDevice.value.id) { - delete query['from']; + delete query['fromPage']; } if (selectedStationCode.value) { query['stationCode'] = selectedStationCode.value;