guonan
2025-06-18 1188387a47e55590a87c161cb43b2db0729b0146
src/views/Home.vue
@@ -59,12 +59,11 @@
// import DangerAssess from "@/components/monifangzhen/DangerAssess.vue";
import { showDeviceDetail } from "@/store";
import { setupTokenRefresh, getDangerPoint } from "@/api/hpApi.js";
import { getSimData, fetchWaterSimulationData } from "@/api/trApi.js";
import { convertToWKT } from "@/utils/wktUtils";
import { getDeviceInfo, getSafePoint } from "@/api/hpApi";
const route = useRoute();
const simStore = useSimStore();
const backHome = ref(false);
// 接收来自 ComponentA 的事件,并更新 isFlying
function handleBackToHome() {
@@ -101,13 +100,18 @@
// 计算属性
const showDetail = computed(() => showDeviceDetail.value);
onMounted(async () => {
  setupTokenRefresh(); // 获取宏图token
  getSimData(); //测试tr后端
  // getSimData(); //测试tr后端
  // 获取隐患点列表(因为中科软后端接口获取加载时间较长)
  getDangerPoint().then((res) => {
  getDangerPoint("110116110000").then((res) => {
    simStore.DangerPoint = res.data.pageData;
  });
  getDeviceInfo(null, "110116110000").then((res) => {
    simStore.devices = res.data.pageData;
  });
  try {
    const wktResult = convertToWKT(multiPolygonCoordinates);
    // console.log(wktResult,'a');