From 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 21 Apr 2025 18:29:09 +0800
Subject: [PATCH] fix: 天气显示

---
 src/components/CurrentTaskDetails/TaskDetailsHead.vue |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/src/components/CurrentTaskDetails/TaskDetailsHead.vue b/src/components/CurrentTaskDetails/TaskDetailsHead.vue
index c6164b2..472373b 100644
--- a/src/components/CurrentTaskDetails/TaskDetailsHead.vue
+++ b/src/components/CurrentTaskDetails/TaskDetailsHead.vue
@@ -1,9 +1,9 @@
 <template>
 	<div class="detailsHead">
-		<div class="droneName" :title="taskDetails.name">{{ taskDetails.name }}</div>
+		<div class="droneName" :title="taskDetails.device_names">{{ taskDetails.device_names }}</div>
 		<div class="infoListBox">
 			<div v-for="item in infoList">
-				<div class="infoValue">{{ item.value }}{{ item.unit }}</div>
+				<div class="infoValue" :title="item.value">{{ item.value }}{{ item.unit }}</div>
 				<div class="infoTitle">{{ item.title }}</div>
 			</div>
 		</div>
@@ -44,8 +44,8 @@
 	{ index: 4, title: '经度', value: 0, unit: '°' },
 	{ index: 5, title: '纬度', value: 0, unit: '°' },
 	{ index: 6, title: '风速', value: 0, unit: 'M/s' },
-	{ index: 7, title: '4G信号', value: 0, unit: '' },
-	{ index: 8, title: 'SDR信号', value: 0, unit: '' },
+	{ index: 7, title: '4G信号', value: '-', unit: '' },
+	{ index: 8, title: 'SDR信号', value: '-', unit: '' },
 	{ index: 9, title: 'GPS搜星数', value: 0, unit: '' },
 	{ index: 10, title: 'RTK搜星数', value: 0, unit: '' },
 	{ index: 11, title: '距离机场', value: 0, unit: 'M' },
@@ -61,8 +61,8 @@
 	}
 }
 
-function refreshLive(){
-	EventBus.emit('CurrentTaskDetails-getAiLiveUrl')
+function refreshLive() {
+	EventBus.emit('CurrentTaskDetails-getDroneLiveUrl',true)
 }
 
 function getFlightStatisticsFun() {
@@ -72,6 +72,9 @@
 	})
 }
 
+const trueAltitude = inject('trueAltitude')
+
+// 获取真实高度
 function getRealTimeReallyHigh() {
 	if (!taskDetailsViewer?.value) return
 	const device_osd_host = wsInfo?.value?.device_osd?.data?.host || {}
@@ -79,7 +82,8 @@
 	if (!latitude) return
 	getLnglatAltitude(longitude, latitude, taskDetailsViewer.value).then(res => {
 		const last = height - res?.height
-		infoList.value[0].value = last ? infoList.value[0].value : _.round(height - res?.height, 1)
+		infoList.value[0].value = last ? _.round(height - res?.height, 1) : infoList.value[0].value
+		trueAltitude.value = infoList.value[0].value
 	})
 }
 
@@ -88,7 +92,6 @@
 	const dock_osd_host = wsInfo?.value?.dock_osd?.data?.host || {}
 	const { longitude, latitude, height, horizontal_speed, vertical_speed, wind_speed, battery } = device_osd_host
 	const { longitude: dockLon, latitude: dockLat, wireless_link } = dock_osd_host
-
 	let dist = infoList.value[11].value
 	if (longitude && latitude && dockLon && dockLat) {
 		dist = _.round(getLnglatDist(longitude, latitude, dockLon, dockLat), 0)
@@ -105,8 +108,8 @@
 	infoList.value[4].value = _.round(longitude || 0, 2)
 	infoList.value[5].value = _.round(latitude || 0, 2)
 	infoList.value[6].value = _.round(wind_speed || 0, 0)
-	if (newFourG !== undefined) infoList.value[7].value = newFourG
-	if (newSdr !== undefined) infoList.value[8].value = newSdr
+	if (newFourG !== undefined) infoList.value[7].value = fourGQuality[newFourG]
+	if (newSdr !== undefined) infoList.value[8].value = SDRQuality[newSdr]
 	if (newGPSNum !== undefined) infoList.value[9].value = newGPSNum
 	if (newRTKNum !== undefined) infoList.value[10].value = newRTKNum
 	infoList.value[11].value = dist
@@ -180,9 +183,12 @@
 			width: 90px;
 
 			.infoValue {
+				white-space: nowrap;
+				overflow: hidden;
+				text-overflow: ellipsis;
 				font-size: 20px;
 				color: #ffffff;
-				line-height: 15px;
+				line-height: 18px;
 				margin-bottom: 10px;
 			}
 

--
Gitblit v1.9.3