guoshilong
2023-11-13 54849757852f6ab40eb17afbd03d1d839b60a38d
src/components/g-map/use-drone-control-ws-event.ts
@@ -17,13 +17,13 @@
const store = useMyStore()
export function useDroneControlWsEvent (sn: string, payloadSn: string, funcs?: UseDroneControlWsEventParams) {
  const droneControlSource = ref('')
  const droneControlSource = ref(ControlSource.A)
  const payloadControlSource = ref(ControlSource.B)
  function onControlSourceChange (data: ControlSourceChangeInfo) {
    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) {