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 |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 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 f7773f7..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,6 +93,7 @@
 		boundary: props.boundary,
 		contour: props.contour,
 	})
+	cesiumContextMenu(true)
 	viewer.value = viewInstance.value.getViewer()
 	if (props.showAdminBoundary) {
 		adminBoundarySources = await loadJaAdminBoundary(viewer.value, {
@@ -118,6 +135,7 @@
 	if (removeCameraListener) removeCameraListener()
 	removeJaAdminBoundary(viewer.value, adminBoundarySources)
 	viewInstance.value?.viewerDestroy?.()
+	cesiumContextMenu(false)
 })
 
 const getMap = () => ({ viewer: viewer.value, publicCesium: viewInstance.value })

--
Gitblit v1.9.3