From 3a8d7ebd8475106965081c1dde022ea3642e9d93 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Mon, 14 Apr 2025 17:56:28 +0800
Subject: [PATCH] feat: 当前任务和历史任务分页传参改成地址后传参

---
 src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue |   41 ++++++++++++++++++++++++++++-------------
 1 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue b/src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue
index 00dd6b4..630fd73 100644
--- a/src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue
+++ b/src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue
@@ -6,14 +6,15 @@
       <div class="info">
         <img src="../../../../assets/images/signMachineNest/machineRight/wrj.png" alt="">
         <div class="info-right">
-          <div class="name">{{ osdVisible?.callsign || '--' }}</div>
+          <!-- <div class="name">{{ osdVisible?.callsign || '--' }}</div> -->
+          <div class="name">{{ singleUavHome?.nickname || '--' }}</div>
           <div class="wz">
             <span class="left">当前位置:</span>
             <span class="right">{{ detailInfo.longitude }},{{ detailInfo.latitude }}</span>
           </div>
           <div class="close-wb">
             <div class="close">{{ AircraftStatus ? AircraftStatus : '舱内关机' }}</div>
-            <div class="wb">需要维保</div>
+            <!-- <div class="wb">需要维保</div> -->
           </div>
         </div>
       </div>
@@ -80,6 +81,8 @@
 const store = useStore();
 // 获取机巢信息
 let osdVisible = computed(() => store.state.home.osdVisible);
+console.log('333',osdVisible)
+const singleUavHome = computed(() => store.state.home.singleUavHome);
 // 单个机巢统计数据
 const singleTotal = computed(() => store.state.home.singleTotal);
 // 是否展示机机巢状态详情
@@ -135,18 +138,24 @@
 });
 let mode_code = ref('已断开连接');
 
+watch(() => store.state.home.osdVisible, (newValue) => {
+  console.log(newValue,'osdVisible222')
+});
+
 // 监听实时信息
-watch(store.state.home.wsMessage, (newValue) => {
-    // if (newValue || newValue.mode_code === 14) return
-    // if (Object.keys(newValue).length === 0) return
-    console.log(newValue,'咋没数据呀');
-    detailInfo.value.longitudee = newValue?.longitude.toFixed(6) || '--';
+watch(
+  () => store.state.home.wsMessage,
+  (newValue) => {
+    if (newValue.mode_code === 14) return
+    if (Object.keys(newValue).length === 0) return
+    detailInfo.value.longitude = newValue?.longitude.toFixed(6) || '--';
 		detailInfo.value.latitude = newValue?.latitude.toFixed(6) || '--';
-    getLnglatAltitude(newValue?.longitude,newValue?.latitude).then((res) => {
+    
+    getLnglatAltitude(Number(detailInfo.value.longitude), Number(detailInfo.value.latitude),window.$viewer).then((res) => {
       const height = newValue?.height - res?.height;
       //针对西安实时高度进行降低
       const wId = localStorage.getItem('bs_workspace_id');
-      if (wId == 'f47ac10b-58cc-4372-a567-0e02b2c3d479') {
+      if (wId === 'f47ac10b-58cc-4372-a567-0e02b2c3d479') {
         detailInfo.value.height = reduceHeight(height);
       } else {
         detailInfo.value.height = height.toFixed(1) || '--';
@@ -163,10 +172,11 @@
 // 获取最新机场状态
 watch(store.state.home.deviceState, (newValue) => {
     // if (data.currentSn !== osdVisible.gateway_sn) return;
-    if (newValue.currentType === EDeviceTypeName.Dock && newValue.dockInfo[newValue.currentSn]) {
+    if (newValue.currentType === EDeviceTypeName.Dock && newValue?.dockInfo[newValue.currentSn]) {
       // 机场状态
-      mode_code.value = EDockModeText[newValue.dockInfo[newValue.currentSn]?.basic_osd?.mode_code];
+      mode_code.value = EDockModeText[newValue?.dockInfo[newValue.currentSn]?.basic_osd?.mode_code];
       // this.$emit('updateModeCode', mode_code.value);
+      // console.log('3333333',deviceInfo.value)
       // 舱内状态
       AircraftStatus.value =
         EModeText[newValue.deviceInfo[
@@ -175,7 +185,8 @@
           ]?.mode_code
         ];
       // 舱内关机时显示的电量
-      let child_sn = newValue.dockInfo[newValue.currentSn].basic_osd.sub_device.device_sn;
+      // console.log('444',newValue.currentSn)
+      let child_sn = newValue?.dockInfo[newValue.currentSn].basic_osd.sub_device?.device_sn;
       // 飞机在线时取飞机中的电量
       if(newValue.deviceInfo[child_sn]) {
         drone_charge_state.value = {
@@ -188,6 +199,7 @@
           drone_charge_state.value = newValue.drone_charge_state_new;
         }
       }
+      // console.log('osdVisible',osdVisible.visible)
       if (osdVisible.visible && osdVisible.is_dock && osdVisible.gateway_sn !== '') {
         deviceInfo.value.dock = newValue.dockInfo[osdVisible.gateway_sn];
         deviceInfo.value.device =
@@ -200,7 +212,7 @@
           newValue.deviceInfo[
             deviceInfo.value.dock.basic_osd?.sub_device?.device_sn ??
             osdVisible.sn
-          ]?.mode_code == undefined || newValue.deviceInfo[
+          ]?.mode_code === undefined || newValue.deviceInfo[
             deviceInfo.value.dock.basic_osd?.sub_device?.device_sn ??
             osdVisible.sn
           ]?.mode_code == 14
@@ -293,6 +305,9 @@
           font-size: 24px;
           color: #0BE5F5;
           line-height: 28px;
+          overflow: hidden;          // 添加溢出隐藏
+          text-overflow: ellipsis;   // 显示省略号
+          white-space: nowrap;       // 不换行
         }
         .wz {
           font-family: Source Han Sans CN, Source Han Sans CN;

--
Gitblit v1.9.3