| | |
| | | import { loadAreaPolygon, clearAreaPolygon } from "@/utils/area"; |
| | | import { checkedKeys } from "@/store/index"; |
| | | import { getDuanMainData, getDistrictListData } from "@/api/index.js"; |
| | | import { getDeviceInfo, getDangerPoint } from "@/api/hpApi"; |
| | | import { getDeviceInfoShg, getDangerPoint } from "@/api/hpApi"; |
| | | |
| | | import { useSimStore } from "@/store/simulation"; |
| | | |
| | |
| | | // 初始化地形数据(使用await等待Promise解析) |
| | | TerrainLayer = await earthCtrl.factory.createTerrainLayer({ |
| | | sourceType: "ctb", |
| | | url: "http://106.120.22.26:9103/gisserver/ctsserver/sungugoudem", |
| | | url: "http://106.120.22.26:9103/gisserver/ctsserver/sunhugoudem", |
| | | // url: "https://tiles1.geovisearth.com/base/v1/terrain?token=486dac3bec56d7d7c2a581c150be2bd937462f1e8f3bc9c78b5658b396122405", |
| | | requestVertexNormals: true, |
| | | }); |
| | | |
| | | treeMap.set("地形数据", TerrainLayer); |
| | |
| | | if (label === "综合监测设备信息") { |
| | | simStore.DeviceShowSwitch = checked; |
| | | if (checked) { |
| | | if (!treeMap.get("综合监测设备信息")) { |
| | | if (!treeMap.get("综合监测设备信息")) { |
| | | } else { |
| | | toggleLayerVisible("综合监测设备信息", true); |
| | | } |
| | | } else { |
| | | toggleLayerVisible("综合监测设备信息", true); |
| | | toggleLayerVisible("综合监测设备信息", false); |
| | | } |
| | | } else { |
| | | toggleLayerVisible("综合监测设备信息", false); |
| | | return; |
| | | } |
| | | return; |
| | | } |
| | | if (label === "孙胡沟隐患点") { |
| | | if (label === "孙胡沟隐患点") { |
| | | simStore.DangerShowSwitch = checked; |
| | | if (checked) { |
| | | if (!treeMap.get("孙胡沟隐患点")) { |
| | | if (!treeMap.get("孙胡沟隐患点")) { |
| | | } else { |
| | | toggleLayerVisible("孙胡沟隐患点", true); |
| | | } |
| | | } else { |
| | | toggleLayerVisible("孙胡沟隐患点", true); |
| | | toggleLayerVisible("孙胡沟隐患点", false); |
| | | } |
| | | } else { |
| | | toggleLayerVisible("孙胡沟隐患点", false); |
| | | return; |
| | | } |
| | | return; |
| | | } |
| | | |
| | | // 其他图层的处理逻辑 |
| | | const list = treeMap.get(label); |
| | |
| | | |
| | | // 监测设备列表 |
| | | const getDevicetList = async () => { |
| | | const res = await getDeviceInfo(); // 调整getDeviceInfo以接受动态参数,如果需要的话 |
| | | const res = await getDeviceInfoShg(); // 调整getDeviceInfoShg以接受动态参数,如果需要的话 |
| | | devicetList.value = res.data.pageData.filter((item) => |
| | | item.deviceName?.includes("孙胡沟") |
| | | ); |
| | |
| | | } |
| | | |
| | | // 隐患点列表 |
| | | // 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 = []; |
| | | /** |
| | |
| | | * 初始化所有数据 |
| | | */ |
| | | function getData() { |
| | | // initDevicePoint(); |
| | | initDevicePoint(); |
| | | // initDistrictPoint(); |
| | | initDuanmianPoint(); |
| | | addTetrahedron(); |