diff --git a/src/components/device-page/device-tree.vue b/src/components/device-page/device-tree.vue index 569f20b..44aa257 100644 --- a/src/components/device-page/device-tree.vue +++ b/src/components/device-page/device-tree.vue @@ -62,7 +62,21 @@ const selectedKeys = computed(() => (selectedDevice.value?.id ? [selectedDevice. const onSelectDevice = (device: NdmDeviceResultVO, stationCode: string) => { emit('select-device', device, stationCode); }; -const override: TreeOverrideNodeClickBehavior = () => 'none'; +const override: TreeOverrideNodeClickBehavior = ({ option }) => { + const isDeviceNode = !!option['device']; + // 单击车站节点展开/收起设备 + if (!isDeviceNode) { + return 'toggleExpand'; + } else { + // 录像机集群节点的`单击展开/收起`与`双击选择`交互存在冲突 + // 暂不考虑支持 + // const device = option['device'] as NdmDeviceResultVO; + // if (isNvrCluster(device)) { + // return 'toggleExpand'; + // } + return 'none'; + } +}; const nodeProps: TreeProps['nodeProps'] = ({ option }) => { return { onDblclick: (payload: MouseEvent) => {