From 4c7c5b721be0c61b7de5d19f0b0007b5aeb825c5 Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Mon, 16 Oct 2023 10:21:25 +0800
Subject: [PATCH] 无人机控制展示功能样式修改

---
 src/components/g-map/use-drone-control-ws-event.ts |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

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 4b7ffdd..355f981 100644
--- a/src/components/g-map/use-drone-control-ws-event.ts
+++ b/src/components/g-map/use-drone-control-ws-event.ts
@@ -1,8 +1,8 @@
-import {message, notification} from 'ant-design-vue'
-import {onBeforeUnmount, onMounted, ref} from 'vue'
+import { message, notification } from 'ant-design-vue'
+import { onBeforeUnmount, onMounted, ref } from 'vue'
 import EventBus from '/@/event-bus/'
-import {EBizCode, EBizCodeMessage} from '/@/types'
-import {ControlSource} from '/@/types/device'
+import { EBizCode, EBizCodeMessage } from '/@/types'
+import { ControlSource } from '/@/types/device'
 import {
   ControlSourceChangeInfo,
   ControlSourceChangeType,
@@ -11,9 +11,10 @@
   FlyToPointMessage,
   TakeoffToPointMessage
 } from '/@/types/drone-control'
-
+import { useMyStore } from '/@/store'
 export interface UseDroneControlWsEventParams {
 }
+const store = useMyStore()
 
 export function useDroneControlWsEvent (sn: string, payloadSn: string, funcs?: UseDroneControlWsEventParams) {
   const droneControlSource = ref(ControlSource.A)
@@ -21,7 +22,8 @@
   function onControlSourceChange (data: ControlSourceChangeInfo) {
     if (data.type === ControlSourceChangeType.Flight && data.sn === sn) {
       droneControlSource.value = data.control_source
-      message.info(`飞行控制改为 ${droneControlSource.value}`)
+      store.commit('SET_DRONE_CONTROL_SOURCE', droneControlSource.value)
+      // message.info(`飞行控制改为 ${droneControlSource.value}`)
       return
     }
     if (data.type === ControlSourceChangeType.Payload && data.sn === payloadSn) {
@@ -88,6 +90,7 @@
   }
 
   onMounted(() => {
+    console.log('弹窗初始化触发?')
     EventBus.on('droneControlWs', handleDroneControlWsEvent)
   })
 

--
Gitblit v1.9.3