From 3f41712cfc8264ed2da1720ae187657f0ff86e89 Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Sat, 14 Oct 2023 15:28:09 +0800
Subject: [PATCH] 显示无人机操作栏、动态加载无人机型号

---
 src/components/GMap.vue |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/components/GMap.vue b/src/components/GMap.vue
index 5fd3dad..c9f2248 100644
--- a/src/components/GMap.vue
+++ b/src/components/GMap.vue
@@ -436,7 +436,7 @@
           <a-tooltip :title="osdVisible.model">
             <div style="width: 90%;" class="flex-column flex-align-center flex-justify-center">
               <span><a-image :src="M30" :preview="false" /></span>
-              <span>M30</span>
+              <span>{{ DEVICE_NAME[`${osdVisible.device_domain}-${osdVisible.device_type}-${osdVisible.device_sub_type}`] }}</span>
             </div>
           </a-tooltip>
         </div>
@@ -474,11 +474,11 @@
               </a-button>
             </a-col>
           </a-row>
-          <a-row v-if="deviceInfo.device?.mode_code != 14 && deviceInfo.device" class="p5" align="middle" justify="space-between">
+          <a-row class="p5" align="middle" justify="space-between">
             <a-col span="24">
               <a-button :class="[openDroneControl ? 'active-color' : 'unactive-color']" class="width-100" type="primary"
                 size="small" @click="openDeviceSetting">
-                操作
+                飞行控制
               </a-button>
             </a-col>
           </a-row>
@@ -730,7 +730,7 @@
 import { getLiveCapacity, startLivestream, stopLivestream } from '/@/api/manage'
 import {
   DeviceOsd, DeviceStatus, DockOsd, EGear, EModeCode, GatewayOsd, EDockModeCode, EDockModeText, EModeText,
-  NetworkStateQualityEnum, NetworkStateTypeEnum, RainfallEnum, DroneInDockEnum
+  NetworkStateQualityEnum, NetworkStateTypeEnum, RainfallEnum, DroneInDockEnum, DEVICE_NAME
 } from '/@/types/device'
 import pin from '/@/assets/icons/pin-2d8cf0.svg'
 import M30 from '/@/assets/icons/m30.png'
@@ -885,6 +885,7 @@
       if (showMonitor.value) {
         loadVideo()
       } else {
+        airPortUrl.value = ''
         // onClose()
       }
     }
@@ -901,6 +902,7 @@
       if (showAircraft.value) {
         loadDroneVideo(type)
       } else {
+        aircraftUrl.value = ''
         // closeFly()
       }
     }
@@ -949,6 +951,8 @@
           }
         })
         .catch(error => {
+          showMonitor.value = false
+          airPortUrl.value = ''
           message.error(error)
         })
     }
@@ -986,6 +990,8 @@
           }
         })
         .catch(error => {
+          showAircraft.value = false
+          aircrafIndex.value = -1
           message.error(error)
         })
     }
@@ -994,14 +1000,16 @@
       try {
         onStart()
       } catch (e) {
-        onClose()
+        airPortUrl.value = ''
+        // onClose()
       }
     }
     const flyTimeout = () => {
       try {
         flyOnStart()
       } catch (e) {
-        closeFly()
+        aircraftUrl.value = ''
+        // closeFly()
       }
     }
     // 设备开始播放
@@ -1392,6 +1400,7 @@
       str,
       EDockModeCode,
       EDockModeText,
+      DEVICE_NAME,
       EModeText,
       dockControlPanelVisible,
       setDockControlPanelVisible,

--
Gitblit v1.9.3