fix: remove dblclick of device node

This commit is contained in:
yangsy
2025-08-18 14:49:24 +08:00
parent 78dcbf9fa9
commit d0168f84bc

View File

@@ -107,31 +107,9 @@ const treeData = computed<TreeOption[]>(() => {
});
});
// 双击设备节点,跳转到`实时设备状`态页面
const nodeProps = ({ option }: { option: TreeOption }) => {
return {
ondblclick: () => {
if (option['device']) {
const queryControlStore = useQueryControlStore();
queryControlStore.enablePolling();
const device = option['device'] as NdmDeviceVO;
router.push({
path: '/device',
query: {
stationCode: station.value.code,
deviceType: device.deviceType,
deviceDBId: device.id,
from: route.path,
},
});
}
},
};
};
const override: TreeOverrideNodeClickBehavior = ({ option }) => {
if (!option['device']) {
return 'toggleExpand';
return 'none';
}
return 'default';
};
@@ -150,7 +128,6 @@ const onModalClose = () => {
<NInput v-model:value="searchPattern" placeholder="搜索设备名称或IP地址" clearable />
<NTree
:data="treeData"
:node-props="nodeProps"
:override-default-node-click-behavior="override"
:pattern="searchPattern"
:filter="searchFilter"