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             |    9 +++++----
 src/pages/page-web/projects/tsa.vue |    9 +++++++--
 src/types/device.ts                 |    6 ++++++
 src/store/index.ts                  |    5 ++++-
 4 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/src/components/GMap.vue b/src/components/GMap.vue
index aeb70e9..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'
@@ -1400,6 +1400,7 @@
       str,
       EDockModeCode,
       EDockModeText,
+      DEVICE_NAME,
       EModeText,
       dockControlPanelVisible,
       setDockControlPanelVisible,
diff --git a/src/pages/page-web/projects/tsa.vue b/src/pages/page-web/projects/tsa.vue
index 8f93d2d..c5cba3e 100644
--- a/src/pages/page-web/projects/tsa.vue
+++ b/src/pages/page-web/projects/tsa.vue
@@ -414,7 +414,10 @@
           model: gateway?.device_name,
           callsign: gateway?.nickname,
           sn: gateway?.device_sn,
-          domain: gateway?.domain
+          domain: gateway?.domain,
+          device_domain: child.domain,
+          device_type: child.type,
+          device_sub_type: child.sub_type
         },
         payload: []
       }
@@ -460,8 +463,10 @@
     osdVisible.value.is_dock = isDock
     osdVisible.value.gateway_callsign = device.gateway.callsign
     osdVisible.value.payloads = device.payload
+    osdVisible.value.device_domain = device.gateway.device_domain
+    osdVisible.value.device_sub_type = device.gateway.device_sub_type
+    osdVisible.value.device_type = device.gateway.device_type
   }
-  console.log(osdVisible.value, 'value')
   store.commit('SET_OSD_VISIBLE_INFO', osdVisible.value)
   store.commit('SET_HMSInfo_DetailSn', sn)
 }
diff --git a/src/store/index.ts b/src/store/index.ts
index 024d468..0c1c5d0 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -77,7 +77,10 @@
     visible: false,
     gateway_sn: '',
     is_dock: false,
-    payloads: null
+    payloads: null,
+    device_domain: '',
+    device_sub_type: '',
+    device_type: ''
   } as OSDVisible,
   waylineInfo: {
 
diff --git a/src/types/device.ts b/src/types/device.ts
index 0e782dc..7edb980 100644
--- a/src/types/device.ts
+++ b/src/types/device.ts
@@ -162,6 +162,9 @@
     callsign: string,
     sn: string,
     domain: string,
+    device_domain: string,
+    device_type: string,
+    device_sub_type: string
   },
   payload: PayloadInfo[],
   selected?:boolean,
@@ -232,6 +235,9 @@
   gateway_sn: string,
   gateway_callsign: string,
   payloads: null | PayloadInfo [],
+  device_type: string,
+  device_sub_type: string,
+  device_domain: string
 }
 
 export interface GatewayOsd {

--
Gitblit v1.9.3