From 95750293c73a9f8201fb548571f251201375f83c Mon Sep 17 00:00:00 2001
From: guonan <guonan201020@163.com>
Date: 星期五, 23 五月 2025 10:00:48 +0800
Subject: [PATCH] 还原

---
 src/components/tools/LayerTree.vue |   74 ++++++++++++++++++++++++------------
 1 files changed, 49 insertions(+), 25 deletions(-)

diff --git a/src/components/tools/LayerTree.vue b/src/components/tools/LayerTree.vue
index 7a44b05..87a046b 100644
--- a/src/components/tools/LayerTree.vue
+++ b/src/components/tools/LayerTree.vue
@@ -184,6 +184,30 @@
     }
     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);
@@ -219,7 +243,7 @@
   } else if (entityList && typeof entityList.show !== "undefined") {
     entityList.show = checked;
   } else {
-    console.error(`鏃犳硶璁剧疆鍥惧眰 ${name} 鐨勫彲瑙佹�);
+    // console.error(`鏃犳硶璁剧疆鍥惧眰 ${name} 鐨勫彲瑙佹�);
   }
 }
 
@@ -233,7 +257,7 @@
     item.deviceName?.includes("瀛欒儭娌�")
   );
 };
-
+// 榛樿鍔犺浇閮ㄥ垎宸叉浛鎹㈣嚦Device.vue涓紝閫昏緫淇敼涓烘牴鎹綋鍓嶉�夋嫨鍦板舰鍒囨崲璁惧鐐规樉绀�
 async function initDevicePoint() {
   let list = [];
   await getDevicetList();
@@ -252,31 +276,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 = [];
 /**
@@ -325,7 +349,7 @@
  * 鍒濆鍖栨墍鏈夋暟鎹�
  */
 function getData() {
-  initDevicePoint();
+  // initDevicePoint();
   // initDistrictPoint();
   initDuanmianPoint();
   addTetrahedron();

--
Gitblit v1.9.3