From b434e38f6458310acd9638b8edc5ff221704bd6a Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Mon, 16 Oct 2023 18:16:19 +0800
Subject: [PATCH] 飞行控制:代码还原

---
 src/components/GMap.vue                            |    2 +-
 src/components/g-map/use-drone-control-ws-event.ts |    2 +-
 src/components/g-map/DroneControlPanel.vue         |    7 +++----
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/components/GMap.vue b/src/components/GMap.vue
index 08e0e0c..813c026 100644
--- a/src/components/GMap.vue
+++ b/src/components/GMap.vue
@@ -443,7 +443,7 @@
         <div class="osd flex-1">
           <a-row class="mr-20" align="middle">
             <a-col span="9"
-              :style="deviceInfo.device || deviceInfo.device?.mode_code !== EModeCode.Disconnected && deviceInfo.dock.basic_osd?.drone_in_dock === 1 ? 'color: rgb(25,190,107)' : 'color: red; font-weight: 700;' ">
+              :style="deviceInfo.device && deviceInfo.device?.mode_code !== EModeCode.Disconnected ? 'color: rgb(25,190,107)' : deviceInfo.dock.basic_osd?.drone_in_dock === 1? 'color: rgb(25,190,107)' : 'color: red; font-weight: 700;' ">
               <!-- DroneInDockEnum[deviceInfo.dock.basic_osd?.drone_in_dock] -->
               {{ deviceInfo.device ? EModeText[deviceInfo.device?.mode_code] : (deviceInfo.dock.basic_osd?.drone_in_dock === 1) ? '舱内关机' : EModeText[EModeCode.Disconnected]
               }}</a-col>
diff --git a/src/components/g-map/DroneControlPanel.vue b/src/components/g-map/DroneControlPanel.vue
index af3a107..24731e6 100644
--- a/src/components/g-map/DroneControlPanel.vue
+++ b/src/components/g-map/DroneControlPanel.vue
@@ -340,12 +340,11 @@
     cmd: cmdItem.cmdKey,
     action: cmdItem.action
   }, false)
-  if (result) {
-    message.success('返航成功')
-  }
-  // 退出飞行控制
   if (result && flightController.value) {
+    message.success('返航成功')
     exitFlightCOntrol()
+  } else {
+    message.warn('请先进入控制!')
   }
   cmdItem.loading = false
 }
diff --git a/src/components/g-map/use-drone-control-ws-event.ts b/src/components/g-map/use-drone-control-ws-event.ts
index 7651eef..794835d 100644
--- a/src/components/g-map/use-drone-control-ws-event.ts
+++ b/src/components/g-map/use-drone-control-ws-event.ts
@@ -23,7 +23,7 @@
     if (data.type === ControlSourceChangeType.Flight && data.sn === sn) {
       droneControlSource.value = data.control_source
       store.commit('SET_DRONE_CONTROL_SOURCE', droneControlSource.value)
-      // message.info(`飞行控制改为 ${droneControlSource.value}`)
+      message.info(`飞行控制改为 ${droneControlSource.value}`)
       return
     }
     if (data.type === ControlSourceChangeType.Payload && data.sn === payloadSn) {

--
Gitblit v1.9.3