wangjuncheng
2025-04-28 f54c45de2ec6dfadc825c064b75e6707513bd094
src/views/Home.vue
@@ -57,12 +57,17 @@
// import DangerAssess from "@/components/monifangzhen/DangerAssess.vue";
import { showDeviceDetail } from "@/store";
import { setupTokenRefresh } from "@/api/hpApi.js"
import { getData } from "@/api/trApi.js"
import { getSimData ,fetchWaterSimulationData} from "@/api/trApi.js"
import { convertToWKT } from '@/utils/wktUtils';
const route = useRoute();
const simStore = useSimStore();
const backHome = ref(false);
// 接收来自 ComponentA 的事件,并更新 isFlying
function handleBackToHome() {
  backHome.value = false;
}
// 从 store 中解构需要的状态
const {
  flowShow,
@@ -94,12 +99,13 @@
// 计算属性
const showDetail = computed(() => showDeviceDetail.value);
onMounted(() => {
onMounted(async () => {
  setupTokenRefresh()// 获取宏图token
  getData() //测试tr后端
  getSimData() //测试tr后端
  try {
    const wktResult = convertToWKT(multiPolygonCoordinates);
    console.log(wktResult);
    // console.log(wktResult,'a');
    // 输出: MULTIPOLYGON(((120.123456 30.654321,120.234567 30.765432,120.345678 30.876543,120.123456 30.654321)))
  } catch (error) {
    console.error(error.message);