From be9c1145fc79165142fbe29aacb04dd8e34dd23f Mon Sep 17 00:00:00 2001 From: guonan <guonan201020@163.com> Date: 星期二, 17 六月 2025 17:32:29 +0800 Subject: [PATCH] 避险场所以及完善弹窗详情 --- src/components/tools/LayerTree.vue | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/tools/LayerTree.vue b/src/components/tools/LayerTree.vue index e29ab66..d209e48 100644 --- a/src/components/tools/LayerTree.vue +++ b/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, "瀛欒儭娌熼殣鎮g偣"], "/zhjc": [...defaultKeys, "缁煎悎鐩戞祴璁惧淇℃伅"], // "/mnfz": [...defaultKeys, "瀛欒儭娌熸柇闈�"], -- Gitblit v1.9.3