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); } }, },