<template>
|
<!-- <Viewer /> -->
|
<!-- <UeView /> -->
|
<GisView />
|
<Flow v-if="flowShow" @video-ended="flowShow = false" />
|
<Screen @showWeatherDetail="weatherShow = true" />
|
<Navigation />
|
<!-- <Left v-if="leftShow" />
|
<Right v-if="rightShow" /> -->
|
|
<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" /> -->
|
<!-- <Function v-if="functionShow" class="functionTool" /> -->
|
<Table v-if="tableShow" class="tableTool" />
|
<!-- <RightRiver v-if="rightRiverShow" @close="flowShow = false" /> -->
|
<!-- <River class="plottingTool" /> -->
|
<ImagePreview v-if="showPreview" />
|
<!-- <Weather v-if="weatherShow" @close="weatherShow = false" /> -->
|
<Bar v-if="barShow" @close="barShow = false" />
|
|
<Detail v-if="showDetail" />
|
</template>
|
|
<script setup>
|
import { computed, onMounted, ref, getCurrentInstance } from "vue";
|
import { useRoute } from "vue-router";
|
import { useSimStore } from "@/store/simulation";
|
import { storeToRefs } from "pinia";
|
import Screen from "./Screen.vue";
|
// import Viewer from "./Viewer.vue"
|
import UeView from "./UeView.vue";
|
import Navigation from "./nav/Navigation.vue";
|
// import Left from "./left/Left.vue";
|
// import Right from "./right/Right.vue";
|
import Tools from "@/components/tools/Tools.vue";
|
// import Message from "@/components/tools/Message.vue";
|
import Announcement from "@/components/tools/Announcement.vue";
|
// import Function from "@/components/menu/Function.vue";
|
// import Location from "@/components/menu/Location.vue";
|
import Table from "@/components/tools/Table.vue";
|
import Flow from "./Flow.vue";
|
// import RightRiver from "./right/RightRiver.vue";
|
// import River from "@/components/tools/River.vue";
|
import ImagePreview from "@/components/tools/ImagePreview.vue";
|
// import Weather from "@/components/tools/Weather.vue";
|
import Bar from "@/components/tools/Bar.vue";
|
import GisView from "./GisView.vue";
|
// import Device from "@/components/menu/Device.vue";
|
import Detail from "@/components/tools/Detail.vue";
|
// 不可以删除,否则全局样式会丢掉,不知道原因
|
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 { convertToWKT } from '@/utils/wktUtils';
|
|
const route = useRoute();
|
const simStore = useSimStore();
|
const backHome = ref(false);
|
|
// 接收来自 ComponentA 的事件,并更新 isFlying
|
function handleBackToHome() {
|
backHome.value = false;
|
}
|
// 从 store 中解构需要的状态
|
const {
|
flowShow,
|
weatherShow,
|
messageShow,
|
tableShow,
|
rightRiverShow,
|
showPreview,
|
barShow,
|
showDangerAssess,
|
} = storeToRefs(simStore);
|
const { init, startYHGL, startZHJC, startMNFZ, startMNPG } = simStore;
|
// 模拟的经纬度数组
|
const multiPolygonCoordinates = [
|
[
|
[120.123456, 30.654321],
|
[120.234567, 30.765432],
|
[120.345678, 30.876543],
|
[120.123456, 30.654321] // 闭合点
|
],
|
[
|
[121.111111, 31.222222],
|
[121.333333, 31.444444],
|
[121.555555, 31.666666],
|
[121.111111, 31.222222] // 闭合点
|
]
|
];
|
|
|
// 计算属性
|
const showDetail = computed(() => showDeviceDetail.value);
|
onMounted(() => {
|
setupTokenRefresh()// 获取宏图token
|
getData() //测试tr后端
|
try {
|
const wktResult = convertToWKT(multiPolygonCoordinates);
|
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();
|
</script>
|
|
<style lang="less" scoped>
|
@import url("../assets/css/home.css");
|
</style>
|