吉安感知网项目-前端
罗广辉
2026-01-26 830029e757b7e8c67b9ce77583e7dc0e300ed4f1
feat: 地图右键bug
2 files modified
19 ■■■■■ changed files
applications/task-work-order/src/components/map-container/common-cesium-map.vue 18 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/styles/common.scss 1 ●●●● patch | view | raw | blame | history
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 })
applications/task-work-order/src/styles/common.scss
@@ -270,6 +270,7 @@
}
.gd-cesium {
  position: relative;
  .cesium-viewer {
    height: 100%;
    overflow: hidden;