From 89380e6260a75d1d3b94de687ebcc2f50d50659d Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 03 Feb 2026 15:44:33 +0800
Subject: [PATCH] feat:环境变量配置调整

---
 applications/task-work-order/src/components/map-container/common-cesium-map.vue |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/applications/task-work-order/src/components/map-container/common-cesium-map.vue b/applications/task-work-order/src/components/map-container/common-cesium-map.vue
index 02eb8e5..47d6ad1 100644
--- a/applications/task-work-order/src/components/map-container/common-cesium-map.vue
+++ b/applications/task-work-order/src/components/map-container/common-cesium-map.vue
@@ -66,6 +66,22 @@
 let initialized = false
 let removeCameraListener = null
 
+
+const preventDefault = event => {
+	event.preventDefault()
+	return
+}
+
+const cesiumContextMenu = (isAdd = true) => {
+	let cesium = document.getElementById(mapId)
+	if (!cesium) return
+	if (isAdd) {
+		cesium.addEventListener('contextmenu', preventDefault)
+	} else {
+		cesium.removeEventListener('contextmenu', preventDefault)
+	}
+}
+
 const initMap = async () => {
 	if (initialized) return
 	initialized = true
@@ -77,9 +93,9 @@
 		boundary: props.boundary,
 		contour: props.contour,
 	})
+	cesiumContextMenu(true)
 	viewer.value = viewInstance.value.getViewer()
 	if (props.showAdminBoundary) {
-		console.log(props.zoomToBoundary,'props.zoomToBoundary')
 		adminBoundarySources = await loadJaAdminBoundary(viewer.value, {
 			zoomTo: props.zoomToBoundary,
 		})
@@ -119,13 +135,15 @@
 	if (removeCameraListener) removeCameraListener()
 	removeJaAdminBoundary(viewer.value, adminBoundarySources)
 	viewInstance.value?.viewerDestroy?.()
+	cesiumContextMenu(false)
 })
 
 const getMap = () => ({ viewer: viewer.value, publicCesium: viewInstance.value })
 const getViewer = () => viewer.value
 const getPublicCesium = () => viewInstance.value
+const flyBoundary = () => adminBoundarySources.flyBoundary()
 
-defineExpose({ getMap, getViewer, getPublicCesium })
+defineExpose({ getMap, getViewer, getPublicCesium,flyBoundary })
 </script>
 
 <style scoped lang="scss">

--
Gitblit v1.9.3