guonan
2025-06-17 be9c1145fc79165142fbe29aacb04dd8e34dd23f
src/components/tools/LayerTree.vue
@@ -17,10 +17,15 @@
import { createPoint, removeEntities, addTileset } from "@/utils/map";
import { deviceDictList, getDictName } from "@/constant/dict.js";
import { useRoute } from "vue-router";
import { loadAreaPolygon, clearAreaPolygon } from "@/utils/area";
import {
  loadAreaPolygon,
  convertToGeoJson,
  clearAreaPolygon,
} from "@/utils/area";
import { checkedKeys } from "@/store/index";
import { getDuanMainData } from "@/api/index.js";
import { useSimStore } from "@/store/simulation";
import { getSafePoint } from "@/api/hpApi";
const simStore = useSimStore();
const route = useRoute();
@@ -319,9 +324,13 @@
 * 添加避险场所数据
 */
function addTetrahedron() {
  loadAreaPolygon("/json/emergency_area.geojson", true).then((entities) => {
    entities.forEach((entity) => (entity.show = false));
    treeMap.set("避险场所", entities);
  getSafePoint().then((res) => {
    const geoJsonData = convertToGeoJson(res.data); // 转换为 GeoJSON
    // 加载 GeoJSON 数据到地图
    loadAreaPolygon(geoJsonData, true).then((entities) => {
      entities.forEach((entity) => (entity.show = false));
      treeMap.set("避险场所", entities);
    });
  });
}
@@ -350,6 +359,7 @@
    const defaultKeys = [...defaultSelectedKeys.value];
    const checkedKeys =
      {
        // 页面默认勾选显示在此处
        "/yhgl": [...defaultKeys, "孙胡沟隐患点"],
        "/zhjc": [...defaultKeys, "综合监测设备信息"],
        // "/mnfz": [...defaultKeys, "孙胡沟断面"],