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/sceneManage/FormDiaLog.vue |   40 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/applications/drone-command/src/views/areaManage/sceneManage/FormDiaLog.vue b/applications/drone-command/src/views/areaManage/sceneManage/FormDiaLog.vue
index 7e096b0..da80178 100644
--- a/applications/drone-command/src/views/areaManage/sceneManage/FormDiaLog.vue
+++ b/applications/drone-command/src/views/areaManage/sceneManage/FormDiaLog.vue
@@ -160,6 +160,7 @@
 import { buildEllipsePositions } from '@/utils/cesium/shapeTools'
 import { cartesian3Convert } from '@/utils/cesium/mapUtil'
 import { AREA_TYPE_STYLE_MAP, BUFFER_LEVEL_STYLES, DEFAULT_AREA_STYLE } from '@ztzf/constants'
+import { MapTooltip } from '@/utils/cesium/shapeTools/Tooltip'
 
 // 初始化表单数据
 const initForm = () => ({
@@ -198,6 +199,10 @@
 let redPointEntity
 let areaDisplaySource
 let leftClickBound = false
+let mouseMoveBound = false
+let mapTooltip
+let publicCesium
+const tooltipEventKey = 'scene-manage-point-tip'
 
 // 表单验证规则
 const rules = {
@@ -555,13 +560,36 @@
 
 // 初始化地图实例
 function initMap() {
-	if (viewer) return
 	const map = mapRef.value?.getMap()
 	if (!map?.viewer) return
-	viewer = map.viewer
+	viewer ||= map.viewer
+	publicCesium ||= map.publicCesium
 	if (!readonly.value && !leftClickBound) {
 		map.publicCesium?.addLeftClickEvent?.(null, LeftClickEvent)
 		leftClickBound = true
+	}
+	if (!readonly.value) ensurePointTooltip()
+}
+
+function ensurePointTooltip() {
+	if (!viewer || !publicCesium || mouseMoveBound) return
+	mapTooltip ||= new MapTooltip(viewer, { offset: { x: 28, 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
 	}
 }
 
@@ -626,6 +654,9 @@
 	redPointEntity = null
 	await nextTick()
 	initMap()
+	if (dialogMode.value === 'view') {
+		clearPointTooltip()
+	}
 	await getSceneConfigList()
 	if (dialogMode.value === 'add') {
 		mapRef.value?.zoomToAdminBoundary?.()
@@ -652,7 +683,10 @@
 watch(
 	() => visible.value,
 	val => {
-		if (!val) clearAreaDisplay()
+		if (!val) {
+			clearAreaDisplay()
+			clearPointTooltip()
+		}
 	}
 )
 

--
Gitblit v1.9.3