From d899b06e661b59765ec3171a6e6049d2d37a0ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E4=BC=9F=E6=B4=8B?= Date: Thu, 13 Mar 2025 19:12:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8E=A7=E5=88=B6=E5=8C=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Drawer/index.vue | 1 + src/views/LeftPanel/index.vue | 1 + src/views/Main/MapSearch/index.vue | 117 ++++++++++++++++------------- src/views/Main/index.vue | 5 ++ src/views/RegionSelect/index.vue | 1 + src/views/RightPanel/index.vue | 1 + 6 files changed, 73 insertions(+), 53 deletions(-) diff --git a/src/views/Drawer/index.vue b/src/views/Drawer/index.vue index 42351de..2337604 100644 --- a/src/views/Drawer/index.vue +++ b/src/views/Drawer/index.vue @@ -21,5 +21,6 @@ defineOptions({ align-items: center; padding: 24px; gap: 16px; + pointer-events: all; } diff --git a/src/views/LeftPanel/index.vue b/src/views/LeftPanel/index.vue index 52c4c15..c1a5699 100644 --- a/src/views/LeftPanel/index.vue +++ b/src/views/LeftPanel/index.vue @@ -21,5 +21,6 @@ defineOptions({ display: flex; flex-direction: row; gap: 12px; + pointer-events: none; } diff --git a/src/views/Main/MapSearch/index.vue b/src/views/Main/MapSearch/index.vue index 22211e0..010026c 100644 --- a/src/views/Main/MapSearch/index.vue +++ b/src/views/Main/MapSearch/index.vue @@ -3,60 +3,59 @@ -
- - - +
@@ -64,7 +63,6 @@ import { ref, computed } from "vue"; import { getReservoirList } from "@/api/map"; import { useProjectStore } from "@/store/modules/project"; -import { ClickOutside as vClickOutside } from "element-plus"; import * as SyCim from "sy-cesium-sdk"; defineOptions({ name: "MapSearch", @@ -72,12 +70,24 @@ defineOptions({ const Cesium = SyCim.Cesium; const projectStore = useProjectStore(); const popoverVisible = ref(false); +const hidePopover = (e: any) => { + if (e?.target?.className?.includes("map-search-result-title")) { + return; + } + popoverVisible.value = false; +}; +const addEventListener = () => { + removeEventListener(); + document.addEventListener("click", hidePopover, false); +}; +const removeEventListener = () => { + document.removeEventListener("click", hidePopover); +}; const showPopover = () => { popoverVisible.value = true; + addEventListener(); }; -const onClickOutside = () => { - popoverVisible.value = false; -}; + const searchValue = ref(""); const searchResultList = ref([]); const layerData = computed(() => @@ -97,6 +107,7 @@ const changeInputValue = async (value: string) => { const flyTo = (item: any) => { const coordinates = item?.geometry?.coordinates; if (!coordinates) return; + popoverVisible.value = false; const center = SyCim.Parse.parsePosition( `${coordinates[0]},${coordinates[1]},10` ).toCartesian3(); diff --git a/src/views/Main/index.vue b/src/views/Main/index.vue index eab1d1c..42e8614 100644 --- a/src/views/Main/index.vue +++ b/src/views/Main/index.vue @@ -100,12 +100,17 @@ onBeforeUnmount(() => { flex-direction: column; justify-content: space-between; align-items: flex-end; + pointer-events: none; .top { + pointer-events: all; display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; } + .bottom { + pointer-events: all; + } } diff --git a/src/views/RegionSelect/index.vue b/src/views/RegionSelect/index.vue index e70322e..58524bd 100644 --- a/src/views/RegionSelect/index.vue +++ b/src/views/RegionSelect/index.vue @@ -48,6 +48,7 @@ onMounted(() => { height: 32px; border-radius: 4px; overflow: hidden; + pointer-events: all; .title { background: #36b29e; height: 100%; diff --git a/src/views/RightPanel/index.vue b/src/views/RightPanel/index.vue index bd4e5d1..f86c0d4 100644 --- a/src/views/RightPanel/index.vue +++ b/src/views/RightPanel/index.vue @@ -21,5 +21,6 @@ defineOptions({ display: flex; flex-direction: row; gap: 12px; + pointer-events: none; }