husq
2023-09-25 e06e048e3b6e61ca8d1a8f44b7728d3b4a9819d9
src/components/g-map/DroneControlPanel.vue
@@ -1,6 +1,11 @@
<template>
  <div class="drone-control-wrapper">
    <div class="drone-control-header">无人机飞行控制</div>
  <div class="drone-control-wrapper" v-if="modelValue">
    <div class="drone-control-header width-100 flex-display flex-align-center flex-justify-between">
      <span>无人机飞行控制</span>
      <span @click="closeDrone">
    <CloseOutlined />
    </span>
    </div>
    <div class="drone-control-box">
      <div class="box">
        <div class="row">
@@ -238,13 +243,13 @@
</template>
<script setup lang="ts">
import { defineProps, reactive, ref, watch, computed, onMounted, watchEffect } from 'vue'
import { defineProps, reactive, ref, watch, computed, onMounted, watchEffect, defineEmits } from 'vue'
import { Select, message, Button } from 'ant-design-vue'
import { PayloadInfo, DeviceInfoType, ControlSource, DeviceOsdCamera, DrcStateEnum } from '/@/types/device'
import { useMyStore } from '/@/store'
import { postDrcEnter, postDrcExit } from '/@/api/drc'
import { useMqtt, DeviceTopicInfo } from './use-mqtt'
import { DownOutlined, UpOutlined, LeftOutlined, RightOutlined, PauseCircleOutlined, UndoOutlined, RedoOutlined, ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons-vue'
import { DownOutlined, UpOutlined, LeftOutlined, RightOutlined, PauseCircleOutlined, UndoOutlined, RedoOutlined, ArrowUpOutlined, ArrowDownOutlined, CloseOutlined } from '@ant-design/icons-vue'
import { useManualControl, KeyCode } from './use-manual-control'
import { usePayloadControl } from './use-payload-control'
import { CameraMode, CameraType, CameraTypeOptions, ZoomCameraTypeOptions, CameraListItem } from '/@/types/live-stream'
@@ -261,7 +266,8 @@
const props = defineProps<{
  sn: string,
  deviceInfo: DeviceInfoType,
  payloads: null | PayloadInfo[]
  payloads: null | PayloadInfo[],
  modelValue: Boolean,
}>()
const store = useMyStore()
@@ -291,7 +297,11 @@
  }
  cmdItem.loading = false
}
const emits = defineEmits(['update:modelValue'])
// 关闭弹窗
const closeDrone = () => {
  emits('update:modelValue', false)
}
const { flyToPoint, stopFlyToPoint, takeoffToPoint } = useDroneControl()
const MAX_SPEED = 14
@@ -411,7 +421,6 @@
  }
  enterFlightControl()
}
// 进入飞行控制
async function enterFlightControl () {
  try {
@@ -706,7 +715,12 @@
<style lang='scss' scoped>
.drone-control-wrapper{
  // border-bottom: 1px solid #515151;
  position: absolute;
    background: #000;
    color: #fff;
    left: calc( 100% + 10px);
    width: 480px;
    top: 0;
  .drone-control-header{
    font-size: 14px;