feat: enhance device tree

This commit is contained in:
yangsy
2025-08-18 02:16:41 +08:00
parent 9cf72a1734
commit 7de9d5ea5c
2 changed files with 104 additions and 36 deletions

View File

@@ -73,9 +73,8 @@ const treeData = computed<TreeOption[]>(() => {
key: type,
children: offlineDeviceList.map<TreeOption>((device) => ({
label: `${device.name}`,
key: device.deviceId,
key: device.id,
suffix: () => `${device.ipAddress ?? '未知IP地址'}`,
isLeaf: true,
device,
})),
};
@@ -85,7 +84,7 @@ const treeData = computed<TreeOption[]>(() => {
const nodeProps = ({ option }: { option: TreeOption }) => {
return {
ondblclick: () => {
if (option.isLeaf) {
if (option['device']) {
const queryControlStore = useQueryControlStore();
queryControlStore.enablePolling();
const device = option['device'] as NdmDeviceVO;