From ec4dd8917fe2cb75e9cca779449b1fe9130b513f Mon Sep 17 00:00:00 2001 From: yangsy Date: Wed, 17 Dec 2025 13:58:51 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=AE=80=E5=8C=96=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=A0=91=E8=8A=82=E7=82=B9=E5=8F=8C=E5=87=BB=E5=92=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/device/device-tree/device-tree.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/device/device-tree/device-tree.vue b/src/components/device/device-tree/device-tree.vue index b62e4d5..22ca275 100644 --- a/src/components/device/device-tree/device-tree.vue +++ b/src/components/device/device-tree/device-tree.vue @@ -189,12 +189,13 @@ const nodeProps: TreeProps['nodeProps'] = ({ option }) => { if (option['device']) { payload.stopPropagation(); const device = option['device'] as NdmDeviceResultVO; - const stationCode = option['stationCode'] as string; + const stationCode = option['stationCode'] as Station['code']; // 区分是否需要跳转路由 + // 当 props.station 存在时,说明当前是单独渲染车站的设备树,需要跳转路由到设备诊断页面 if (!station.value) { onSelectDevice(device, stationCode); } else { - onRouteDevice(device, station.value.code); + onRouteDevice(device, stationCode); } } }, @@ -244,10 +245,11 @@ const renderDeviceNodePrefix = (device: NdmDeviceResultVO, stationCode: Station[ e.stopPropagation(); // 选择设备 // 区分是否需要跳转路由 + // 当 props.station 存在时,说明当前是单独渲染车站的设备树,需要跳转路由到设备诊断页面 if (!station.value) { onSelectDevice(device, stationCode); } else { - onRouteDevice(device, station.value.code); + onRouteDevice(device, stationCode); } }, },