feat(device-tree): expand/fold station node when click it

This commit is contained in:
yangsy
2025-11-11 12:21:12 +08:00
parent a583fa2a4b
commit d2791ad093

View File

@@ -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) => {