From d54e0b172d77e2bd42b0866e6e80d5f414da3914 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Sat, 31 Jan 2026 14:24:44 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
applications/drone-command/src/views/areaManage/precinctInfo/FormDiaLog.vue | 43 ++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 42 insertions(+), 1 deletions(-)
diff --git a/applications/drone-command/src/views/areaManage/precinctInfo/FormDiaLog.vue b/applications/drone-command/src/views/areaManage/precinctInfo/FormDiaLog.vue
index 50e15ee..f698ff7 100644
--- a/applications/drone-command/src/views/areaManage/precinctInfo/FormDiaLog.vue
+++ b/applications/drone-command/src/views/areaManage/precinctInfo/FormDiaLog.vue
@@ -111,7 +111,7 @@
</template>
<script setup>
-import { computed, nextTick, ref } from 'vue'
+import { computed, nextTick, ref, watch } from 'vue'
import { ElMessage } from 'element-plus'
import { fwPoliceStationDetailApi, fwPoliceStationSubmitApi } from './precinctInfoApi'
import { fieldRules } from '@ztzf/utils'
@@ -121,6 +121,7 @@
import { saveOperationLog } from '@ztzf/apis'
import { useRoute } from 'vue-router'
import positionIcon from '@/assets/images/areaManage/positionIcon.png'
+import { MapTooltip } from '@/utils/cesium/shapeTools/Tooltip'
const initForm = () => ({
address: '', // 位置
@@ -185,6 +186,10 @@
let viewer
let redPointEntity
let leftClickBound = false
+let mouseMoveBound = false
+let mapTooltip
+let publicCesium
+const tooltipEventKey = 'precinct-info-point-tip'
const labelParams = {
font: '18px',
fillColor: Cesium.Color.WHITE, // 文字颜色:白色
@@ -271,12 +276,38 @@
await nextTick()
const map = inlineMapRef.value?.getMap()
viewer = map?.viewer || null
+ publicCesium = map?.publicCesium || null
if (viewer && !leftClickBound) {
map.publicCesium?.addLeftClickEvent?.(null, LeftClickEvent)
leftClickBound = true
}
+ if (viewer && !readonly.value) {
+ ensurePointTooltip()
+ }
if (formData.value.longitude != null && formData.value.latitude != null) {
setMapPoint(formData.value.longitude, formData.value.latitude)
+ }
+}
+
+function ensurePointTooltip() {
+ if (!viewer || !publicCesium || mouseMoveBound) return
+ mapTooltip ||= new MapTooltip(viewer, { offset: { x: 16, y: 24 } })
+ publicCesium.addMouseHandler?.(
+ null,
+ movement => {
+ if (!visible.value || readonly.value) return
+ mapTooltip?.show('点击地图选择派出所位置', movement.endPosition)
+ },
+ tooltipEventKey
+ )
+ mouseMoveBound = true
+}
+
+function clearPointTooltip() {
+ mapTooltip?.hide()
+ if (publicCesium && mouseMoveBound) {
+ publicCesium.removeMouseHandler?.(tooltipEventKey)
+ mouseMoveBound = false
}
}
@@ -296,6 +327,7 @@
formData.value = dialogMode.value === 'add' ? initForm() : row
redPointEntity = null
leftClickBound = false
+ clearPointTooltip()
if (dialogMode.value !== 'add') {
await loadDetail()
}
@@ -305,6 +337,15 @@
}, 500)
}
+watch(
+ () => visible.value,
+ val => {
+ if (!val) {
+ clearPointTooltip()
+ }
+ }
+)
+
defineExpose({ open })
</script>
<style scoped lang="scss">
--
Gitblit v1.9.3