| | |
| | | import { initeWaterPrimitiveView } from "@/utils/water"; //相机flyTo函数,后续options列表中有对应经纬度后弃用 |
| | | import { useRoute, onBeforeRouteUpdate } from "vue-router"; |
| | | import { Loading } from "@element-plus/icons-vue"; |
| | | // import { fetchAndLoadDangerPoints } from "@/api/hpApi.js"; |
| | | |
| | | const districtList = ref([]); |
| | | |
| | | // const displayData = ref([]); |
| | | |
| | | // const loadCallback = async (newData) => { |
| | | // districtList.value = [...newData]; |
| | | // console.log(districtList.value, "aaaaaaaaaaaaaaaaaaaaaaaaa"); |
| | | |
| | | // await initializeDevicePoints(); |
| | | // }; |
| | | |
| | | // onMounted(() => { |
| | | // fetchAndLoadDangerPoints(loadCallback); |
| | | // }); |
| | | |
| | | const simStore = useSimStore(); |
| | | // onBeforeRouteUpdate((to, from, next) => { |
| | | // if (to.path !== "/yhgl") { |
| | | // clearAllPoints(); |
| | | // } |
| | | // next(); |
| | | // }); |
| | | |
| | | const route = useRoute(); |
| | | |
| | | onBeforeUnmount(() => { |
| | |
| | | }; |
| | | let isInitialized = false; |
| | | |
| | | watch( |
| | | () => simStore.DangerShowSwitch, |
| | | async (newValue, oldValue) => { |
| | | console.log("当前状态:", newValue); |
| | | // watch( |
| | | // () => simStore.DangerShowSwitch, |
| | | // async (newValue, oldValue) => { |
| | | // console.log("当前状态:", newValue); |
| | | |
| | | if (newValue) { |
| | | if (!isInitialized) { |
| | | await initializeDevicePoints(); |
| | | isInitialized = true; |
| | | } |
| | | } else { |
| | | clearAllPoints(); |
| | | isInitialized = false; |
| | | } |
| | | } |
| | | ); |
| | | // if (newValue) { |
| | | // if (!isInitialized) { |
| | | // await initializeDevicePoints(); |
| | | // isInitialized = true; |
| | | // } |
| | | // } else { |
| | | // clearAllPoints(); |
| | | // isInitialized = false; |
| | | // } |
| | | // } |
| | | // ); |
| | | // 监听 simStore.DangerPoint 变化 |
| | | watch( |
| | | () => simStore.DangerPoint, |