From a4201c87e9428d230d3778a940c2cbb114efd89a Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Tue, 27 Jan 2026 08:45:26 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
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