From a0967df707a547428df9fc80256877c26e061c4a Mon Sep 17 00:00:00 2001 From: guonan <guonan201020@163.com> Date: 星期二, 20 五月 2025 15:41:54 +0800 Subject: [PATCH] 还原目录树功能 --- src/components/tools/LayerTree.vue | 74 ++++++++++++------------------------ 1 files changed, 25 insertions(+), 49 deletions(-) diff --git a/src/components/tools/LayerTree.vue b/src/components/tools/LayerTree.vue index 87a046b..7a44b05 100644 --- a/src/components/tools/LayerTree.vue +++ b/src/components/tools/LayerTree.vue @@ -184,30 +184,6 @@ } return; } - if (label === "缁煎悎鐩戞祴璁惧淇℃伅") { - simStore.DeviceShowSwitch = checked; - if (checked) { - if (!treeMap.get("缁煎悎鐩戞祴璁惧淇℃伅")) { - } else { - toggleLayerVisible("缁煎悎鐩戞祴璁惧淇℃伅", true); - } - } else { - toggleLayerVisible("缁煎悎鐩戞祴璁惧淇℃伅", false); - } - return; -} -if (label === "瀛欒儭娌熼殣鎮g偣") { - simStore.DangerShowSwitch = checked; - if (checked) { - if (!treeMap.get("瀛欒儭娌熼殣鎮g偣")) { - } else { - toggleLayerVisible("瀛欒儭娌熼殣鎮g偣", true); - } - } else { - toggleLayerVisible("瀛欒儭娌熼殣鎮g偣", false); - } - return; -} // 鍏朵粬鍥惧眰鐨勫鐞嗛�昏緫 const list = treeMap.get(label); @@ -243,7 +219,7 @@ } else if (entityList && typeof entityList.show !== "undefined") { entityList.show = checked; } else { - // console.error(`鏃犳硶璁剧疆鍥惧眰 ${name} 鐨勫彲瑙佹�); + console.error(`鏃犳硶璁剧疆鍥惧眰 ${name} 鐨勫彲瑙佹�); } } @@ -257,7 +233,7 @@ item.deviceName?.includes("瀛欒儭娌�") ); }; -// 榛樿鍔犺浇閮ㄥ垎宸叉浛鎹㈣嚦Device.vue涓紝閫昏緫淇敼涓烘牴鎹綋鍓嶉�夋嫨鍦板舰鍒囨崲璁惧鐐规樉绀� + async function initDevicePoint() { let list = []; await getDevicetList(); @@ -276,31 +252,31 @@ } // 闅愭偅鐐瑰垪琛� -// watchEffect(() => { -// const dangerPoints = simStore.DangerPoint.filter((item) => -// item.position?.includes("瀛欒儭娌�") -// ); +watchEffect(() => { + const dangerPoints = simStore.DangerPoint.filter((item) => + item.position?.includes("瀛欒儭娌�") + ); -// if (dangerPoints && dangerPoints.length > 0) { -// const list = []; + if (dangerPoints && dangerPoints.length > 0) { + const list = []; -// dangerPoints.forEach((item) => { -// // console.log(item, "item"); -// item.id = item.hdId; -// item.name = item.hdName; -// item.latitude = item.lat; -// item.longitude = item.lon; -// item.showBillboard = true; -// item.type = item.disasterType; -// item.className = "district"; -// const entity = createPoint(item); -// entity.show = false; -// list.push(entity); -// }); + dangerPoints.forEach((item) => { + // console.log(item, "item"); + item.id = item.hdId; + item.name = item.hdName; + item.latitude = item.lat; + item.longitude = item.lon; + item.showBillboard = true; + item.type = item.disasterType; + item.className = "district"; + const entity = createPoint(item); + entity.show = false; + list.push(entity); + }); -// treeMap.set("瀛欒儭娌熼殣鎮g偣", list); -// } -// }); + treeMap.set("瀛欒儭娌熼殣鎮g偣", list); + } +}); let divPointList = []; /** @@ -349,7 +325,7 @@ * 鍒濆鍖栨墍鏈夋暟鎹� */ function getData() { - // initDevicePoint(); + initDevicePoint(); // initDistrictPoint(); initDuanmianPoint(); addTetrahedron(); -- Gitblit v1.9.3