guonan
2025-05-23 95750293c73a9f8201fb548571f251201375f83c
还原
已修改1个文件
74 ■■■■■ 文件已修改
src/components/tools/LayerTree.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 === "孙胡沟隐患点") {
    simStore.DangerShowSwitch = checked;
    if (checked) {
    if (!treeMap.get("孙胡沟隐患点")) {
    } else {
      toggleLayerVisible("孙胡沟隐患点", true);
    }
  } else {
    toggleLayerVisible("孙胡沟隐患点", 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("孙胡沟隐患点", list);
  }
});
//     treeMap.set("孙胡沟隐患点", list);
//   }
// });
let divPointList = [];
/**
@@ -325,7 +349,7 @@
 * 初始化所有数据
 */
function getData() {
  initDevicePoint();
  // initDevicePoint();
  // initDistrictPoint();
  initDuanmianPoint();
  addTetrahedron();