From 7fbce1ecd95b4e12ceda0a5b874ec8f3951625f7 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期五, 17 一月 2025 17:58:59 +0800 Subject: [PATCH] WI水务智能助理 --- src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/Map.vue | 43 ++++++++++++++++++++++++++++++++++++------- 1 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/Map.vue b/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/Map.vue index 67799d2..6ba59b7 100644 --- a/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/Map.vue +++ b/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/Map.vue @@ -1,11 +1,18 @@ <template> <div class="h-[60vh] relative"> <!-- 鍘熷鍦板浘瀹瑰櫒 --> - <BasicMap v-show="!isFullscreen" class="h-full" :data="data" @markerClick="markerClick" @closeInfoWindow="closeInfoWindow" /> + <BasicMap + ref="normalMapRef" + v-show="!isFullscreen" + class="h-full" + :data="data" + @markerClick="markerClick" + @closeInfoWindow="closeInfoWindow" + /> <!-- 鍏ㄥ睆鎸夐挳 --> <div class="absolute right-2 top-2 cursor-pointer" @click="toggleFullScreen"> <el-tooltip content="鍏ㄥ睆灞曞紑" placement="top"> - <div class="ywifont text-[20px] text-black rounded-lg ywicon-fullscreen"></div> + <div class="ywifont !text-[20px] text-black rounded-lg ywicon-fullscreen"></div> </el-tooltip> </div> @@ -13,10 +20,17 @@ <Teleport to=".layout-parent"> <Transition name="fullscreen"> <div v-if="isRenderFullscreen" v-show="isFullscreen" class="absolute inset-0 z-50 w-full h-full"> - <BasicMap class="h-full" :data="data" @markerClick="markerClick" @closeInfoWindow="closeInfoWindow" /> + <BasicMap + ref="fullScreenMapRef" + :config="fullScreenMapConfig" + class="h-full" + :data="data" + @markerClick="markerClick" + @closeInfoWindow="closeInfoWindow" + /> <div class="absolute right-2 top-2 cursor-pointer" @click="toggleFullScreen"> <el-tooltip content="閫�鍑哄叏灞忥紙Esc锛�" placement="top"> - <div class="ywifont text-[20px] text-black rounded-lg ywicon-tuichuquanping"></div> + <div class="ywifont !text-[20px] text-black rounded-lg ywicon-tuichuquanping"></div> </el-tooltip> </div> <div class="absolute bottom-0 w-full"> @@ -29,6 +43,7 @@ :tableHeight="240" /> </div> + <SmallChat class="absolute bottom-0 right-0" :olMap="fullScreenOlMap" /> </div> </Transition> </Teleport> @@ -37,14 +52,19 @@ <script setup lang="ts"> import 'ol/ol.css'; -import { nextTick, onDeactivated, onMounted, onUnmounted, ref } from 'vue'; +import { computed, nextTick, onDeactivated, onMounted, onUnmounted, ref } from 'vue'; import EquipCurve from '../components/EquipCurve.vue'; import BasicMap from './BasicMap.vue'; +import SmallChat from '/@/components/chat/smallChat/index.vue'; +import { GaoDeSourceType } from '/@/model/map/OLMap'; +import { useCompRef } from '/@/utils/types'; const isRenderFullscreen = ref(false); const isFullscreen = ref(false); const props = defineProps(['data']); - +const normalMapRef = useCompRef(BasicMap); +const fullScreenMapRef = useCompRef(BasicMap); +const fullScreenOlMap = computed(() => fullScreenMapRef.value?.olMap); const emit = defineEmits(['equipClick', 'closeInfoWindow']); const markerClick = (row) => { @@ -62,18 +82,27 @@ } }; +const fullScreenMapConfig = ref({ + sourceType: GaoDeSourceType.Vector, + markerIsVisible: true, +}); // 鍒囨崲鍏ㄥ睆 const toggleFullScreen = async () => { isFullscreen.value = !isFullscreen.value; await nextTick(); if (isFullscreen.value) { + const config = normalMapRef.value.olMap.getConfig(); if (!isRenderFullscreen.value) { + fullScreenMapConfig.value = config; isRenderFullscreen.value = true; + } else { + // fullScreenMapRef.value.olMap.setConfig(config); } closeInfoWindow(); } else { - // olMap.map.addOverlay(infoWindowOverlay); + const config = fullScreenMapRef.value.olMap.getConfig(); + // normalMapRef.value.olMap.setConfig(config); } }; -- Gitblit v1.9.3