From bd13b522f95d4f9429eb0e8bc7df2e1ce3d58554 Mon Sep 17 00:00:00 2001 From: wangjuncheng <1> Date: 星期三, 16 四月 2025 16:41:55 +0800 Subject: [PATCH] change --- src/views/Home.vue | 35 ++++++++++++++++++++++++----------- 1 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/views/Home.vue b/src/views/Home.vue index aae5a90..95b8455 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -8,14 +8,10 @@ <!-- <Left v-if="leftShow" /> <Right v-if="rightShow" /> --> - <Tools - :style=" - rightRiverShow || showDangerAssess - ? { right: '400px' } - : { right: '12px' } - " - class="tools" - /> + <Tools :style="rightRiverShow || showDangerAssess + ? { right: '400px' } + : { right: '12px' } + " class="tools" /> <!-- <Message v-if="messageShow" class="messageTool" /> --> <Announcement v-show="$route.fullPath != '/'" class="announcementTool" /> <!-- <Location v-if="locationShow" class="locationTool" /> --> @@ -31,7 +27,7 @@ </template> <script setup> -import { computed, onMounted } from "vue"; +import { computed, onMounted, ref, getCurrentInstance } from "vue"; import { useRoute } from "vue-router"; import { useSimStore } from "@/store/simulation"; import { storeToRefs } from "pinia"; @@ -60,8 +56,9 @@ import ResultAssess from "@/components/monifangzhen/ResultAssess.vue"; // import DangerAssess from "@/components/monifangzhen/DangerAssess.vue"; import { showDeviceDetail } from "@/store"; -import { setupTokenRefresh } from "@/api/hpApi.js" -import { getData } from "@/api/trApi.js" +import { setupTokenRefresh } from "@/api/hpApi.js" +import { getData } from "@/api/trApi.js" +import { convertToWKT } from '@/utils/wktUtils'; const route = useRoute(); const simStore = useSimStore(); @@ -78,12 +75,28 @@ showDangerAssess, } = storeToRefs(simStore); const { init, startYHGL, startZHJC, startMNFZ, startMNPG } = simStore; +// 妯℃嫙鐨勭粡绾害鏁扮粍 +const coordinates = [ + [120.123456, 30.654321], + [120.234567, 30.765432], + [120.345678, 30.876543], + [120.123456, 30.654321] +]; + // 璁$畻灞炴�� const showDetail = computed(() => showDeviceDetail.value); onMounted(() => { setupTokenRefresh()// 鑾峰彇瀹忓浘token getData() //娴嬭瘯tr鍚庣 + try { + const wktResult = convertToWKT(coordinates); + console.log(wktResult); + // 杈撳嚭: MULTIPOLYGON(((120.123456 30.654321,120.234567 30.765432,120.345678 30.876543,120.123456 30.654321))) + } catch (error) { + console.error(error.message); + + } }); // 鍒濆鍖� init(); -- Gitblit v1.9.3