From 0d52b486d651e2bc4eaa278f1bc383fc3848e580 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Thu, 05 Feb 2026 10:43:57 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 applications/drone-command/src/components/map-container/device-map-container.vue |  206 +++++++++++++++++++--------------------------------
 1 files changed, 77 insertions(+), 129 deletions(-)

diff --git a/applications/drone-command/src/components/map-container/device-map-container.vue b/applications/drone-command/src/components/map-container/device-map-container.vue
index 7d6383c..0e37663 100644
--- a/applications/drone-command/src/components/map-container/device-map-container.vue
+++ b/applications/drone-command/src/components/map-container/device-map-container.vue
@@ -131,8 +131,8 @@
 let favoritePulseElapsed = 0
 const favoritePulseEntities = []
 const pulseBaseColor = Cesium.Color.fromCssColorString('#FF3B30')
-const PULSE_MIN_RADIUS_M = 2
-const PULSE_MAX_RADIUS_M = 30
+const PULSE_MIN_RADIUS_M = 20
+const PULSE_MAX_RADIUS_M = 80
 const PULSE_DURATION_S = 1.4
 const detailVisible = ref(true)
 const clusterVisible = ref(false)
@@ -216,93 +216,17 @@
 	return canvas
 }
 
-class PulseSphereMaterialProperty {
-	constructor(color, speed = 1.2, bands = 3.0, softness = 0.18) {
-		this._definitionChanged = new Cesium.Event()
-		this.color = color
-		this.speed = speed
-		this.bands = bands
-		this.softness = softness
-	}
-	get isConstant() {
-		return true
-	}
-	get definitionChanged() {
-		return this._definitionChanged
-	}
-	getType() {
-		return 'PulseSphereMaterial'
-	}
-	getValue(_time, result = {}) {
-		result.color = this.color
-		result.time = (performance.now() / 1000) * this.speed
-		result.bands = this.bands
-		result.softness = this.softness
-		return result
-	}
-	equals(other) {
-		return (
-			other instanceof PulseSphereMaterialProperty &&
-			Cesium.Color.equals(this.color, other.color) &&
-			this.speed === other.speed &&
-			this.bands === other.bands &&
-			this.softness === other.softness
-		)
-	}
-}
-
-let pulseSphereMaterial = null
-const getPulseSphereMaterial = () => {
-	if (pulseSphereMaterial) return pulseSphereMaterial
-	Cesium.Material._materialCache.addMaterial('PulseSphereMaterial', {
-		fabric: {
-			type: 'PulseSphereMaterial',
-			uniforms: {
-				color: pulseBaseColor.withAlpha(0.45),
-				time: 0,
-				bands: 3.0,
-				softness: 0.18,
-			},
-			source: `
-				czm_material czm_getMaterial(czm_materialInput materialInput)
-				{
-					czm_material material = czm_getDefaultMaterial(materialInput);
-					vec3 normalEC = normalize(materialInput.normalEC);
-					vec3 viewEC = normalize(-materialInput.positionToEyeEC);
-					float ndv = max(dot(normalEC, viewEC), 0.0);
-					float fresnel = pow(1.0 - ndv, 1.6);
-					float wave = sin((ndv * bands + time) * 6.2831853);
-					float ring = smoothstep(-softness, softness, wave);
-					float alpha = (ring * 0.6 + fresnel * 0.4) * color.a;
-					material.diffuse = color.rgb;
-					material.alpha = alpha;
-					return material;
-				}
-			`,
-		},
-		translucent: () => true,
-	})
-	pulseSphereMaterial = new PulseSphereMaterialProperty(pulseBaseColor.withAlpha(0.45), 1.1, 3.2, 0.22)
-	return pulseSphereMaterial
-}
-
 const createFavoritePulseEntity = (billboard) => {
 	if (!viewer || !billboard) return
-	const material = getPulseSphereMaterial()
 	const pulse = {
-		material,
 		offset: Math.random() * PULSE_DURATION_S,
 		entity: null,
 	}
-	const getPulseRadius3D = () => {
-		const radius = getPulseRadius(pulse)
-		return new Cesium.Cartesian3(radius, radius, radius)
-	}
 	pulse.entity = viewer.entities.add({
 		position: new Cesium.CallbackProperty(() => getBillboardPosition(billboard), false),
-		ellipsoid: {
-			radii: new Cesium.CallbackProperty(() => getPulseRadius3D(), false),
-			material,
+		point: {
+			pixelSize: new Cesium.CallbackProperty(() => getPulseRadius(pulse), false),
+			color: pulseBaseColor.withAlpha(0.4),
 		},
 	})
 	favoritePulseEntities.push(pulse)
@@ -525,38 +449,43 @@
 	const basePoints = [
 		[
 			{
-				longitude: 114.963191,
-				latitude: 27.136716,
-				height: 120
+				longitude: 114.964975,
+				latitude: 27.134855,
+				height: 200
 			},
 			{
-				longitude: 114.957308,
-				latitude: 27.138452,
-				height: 120
+				longitude: 114.963966,
+				latitude: 27.132836,
+				height: 200
 			},
 			{
-				longitude: 114.952,
-				latitude: 27.136317,
-				height: 120
+				longitude: 114.963966,
+				latitude: 27.132836,
+				height: 320
 			},
 			{
-				longitude: 114.949293,
-				latitude: 27.133864,
-				height: 120
+				longitude: 114.963974,
+				latitude:  27.132677,
+				height: 320
 			},
 			{
-				longitude: 114.944666,
-				latitude: 27.130526,
-				height: 120
+				longitude: 114.963432,
+				latitude: 27.131665,
+				height: 320
 			},
 			{
-				longitude: 114.945909,
-				latitude: 27.127845,
-				height: 120
+				longitude: 114.962865,
+				latitude: 27.130377,
+				height: 320
 			},
 			{
-				longitude: 114.962974,
-				latitude: 27.136242,
+				longitude: 114.965318,
+				latitude: 27.129925,
+				height: 320
+			},
+			{
+				longitude: 114.960144,
+				latitude: 27.134902,
 				height: 120
 			},
 		],
@@ -578,29 +507,34 @@
 				height: 120
 			},
 			{
+				longitude: 114.925958,
+				latitude: 27.096963,
+				height: 400
+			},
+			{
 				longitude: 114.925836, 
 				latitude: 27.096102,
-				height: 120
+				height: 400
 			},
 			{
 				longitude: 114.928384, 
 				latitude: 27.095866,
-				height: 120
+				height: 400
 			},
 			{
 				longitude: 114.929874, 
 				latitude: 27.096095,
-				height: 120
+				height: 400
 			},
 			{
 				longitude: 114.931048, 
 				latitude: 27.097666,
-				height: 120
+				height: 400
 			},
-		]
+		],
 	]
 
-	return basePoints[center.trackIndex]
+	return basePoints[center.trackIndex] || basePoints[1]
 }
 
 
@@ -667,7 +601,9 @@
 
 const setupDroneTrackClock = () => {
 	if (!viewer) return
-	const startTime = Cesium.JulianDate.now()
+	const now = new Date()
+	const noon = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 12, 0, 0, 0)
+	const startTime = Cesium.JulianDate.fromDate(noon)
 	const stopTime = Cesium.JulianDate.addSeconds(startTime, DRONE_TRACK_DURATION_S, new Cesium.JulianDate())
 	viewer.clock.startTime = startTime
 	viewer.clock.stopTime = stopTime
@@ -892,32 +828,26 @@
 		const entityId = `online-device-${item.id ?? index}-${index}`
 		const rangeMeters = getDeviceRange(item)
 		devicePositions.push({ lng: position.longitude, lat: position.latitude })
-		const billboard = deviceBillboardCollection.add({
-			position: Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, 0),
-			image: isOnline ? equipmentIcon : offlineEquipmentIcon,
-			width: 40,
-			height: 56,
-			verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
-		})
-		billboard.id = entityId
-		devicePickMap.set(entityId, { data: item, billboard })
-		deviceEntries.push({ position, rangeMeters, billboard, isOnline })
+		deviceEntries.push({ position, rangeMeters, isOnline, entityId, data: item })
 	})
-	if (selectedTargetType.value === 'device' && selectedDeviceBillboard && !devicePickMap.has(selectedDeviceBillboard.id)) {
-		closePopup()
-	}
 	if (deviceEntries.length) {
 		const heights = await getPointPositionsHeight(devicePositions, viewer)
 		deviceEntries.forEach((entry, index) => {
 			const height = Number(heights?.[index]?.ASL)
 			const centerHeight = Number.isFinite(height) ? height : 0
-			if (entry.billboard) {
-				entry.billboard.position = Cesium.Cartesian3.fromDegrees(
+			const billboard = deviceBillboardCollection.add({
+				position: Cesium.Cartesian3.fromDegrees(
 					entry.position.longitude,
 					entry.position.latitude,
 					centerHeight
-				)
-			}
+				),
+				image: entry.isOnline ? equipmentIcon : offlineEquipmentIcon,
+				width: 40,
+				height: 56,
+				verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
+			})
+			billboard.id = entry.entityId
+			devicePickMap.set(entry.entityId, { data: entry.data, billboard })
 			if (!entry.isOnline) return
 			if (!Number.isFinite(entry.rangeMeters) || entry.rangeMeters <= 0) return
 			const primitive = createDeviceRangePrimitiveWithHeight(entry.position, entry.rangeMeters, centerHeight)
@@ -926,6 +856,9 @@
 			addCockpitPrimitive(primitive)
 			deviceRingFillPrimitives.push(primitive)
 		})
+	}
+	if (selectedTargetType.value === 'device' && selectedDeviceBillboard && !devicePickMap.has(selectedDeviceBillboard.id)) {
+		closePopup()
 	}
 	reorderCockpitPrimitives()
 }
@@ -1273,22 +1206,37 @@
 const handleDroneSignal = () => emit('droneSignal', selectedDevice.value)
 const handleDroneCounter = () => emit('droneCounter', selectedDevice.value)
 
-const renderCommandPosts = list => {
+const renderCommandPosts = async list => {
 	if (!viewer) return
 	ensureCommandPostCollection()
 	commandPostBillboardCollection.removeAll()
 	commandPostBillboardCollection.show = detailVisible.value
+	const entries = []
+	const positions = []
 		; (list || []).forEach((item, index) => {
 			const position = getDevicePosition(item)
 			if (!position) return
+			entries.push({ position, index })
+			positions.push({ lng: position.longitude, lat: position.latitude })
+		})
+	if (positions.length) {
+		const heights = await getPointPositionsHeight(positions, viewer)
+		entries.forEach((entry, idx) => {
+			const height = Number(heights?.[idx]?.ASL)
+			const centerHeight = Number.isFinite(height) ? height : 0
 			commandPostBillboardCollection.add({
-				position: Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, 0),
+				position: Cesium.Cartesian3.fromDegrees(
+					entry.position.longitude,
+					entry.position.latitude,
+					centerHeight
+				),
 				image: commandPostIcon,
 				width: 40,
 				height: 56,
 				verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
 			})
 		})
+	}
 	reorderCockpitPrimitives()
 }
 
@@ -1308,9 +1256,9 @@
 		const res = await newDefenseSceneManageList({
 			time: dayjs().format('YYYY-MM-DD HH:mm:ss')
 		})
-		renderCommandPosts(res?.data?.data ?? [])
+		await renderCommandPosts(res?.data?.data ?? [])
 	} catch (error) {
-		renderCommandPosts([])
+		await renderCommandPosts([])
 	}
 }
 

--
Gitblit v1.9.3