| | |
| | | <template> |
| | | <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 /> |
| | | <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"> |
| | | <div class="drone-control"><Button :ghost="!flightController" size="small" @click="onClickFightControl">{{ flightController ? '退出控制' : '进入控制'}}</Button></div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="drone-control-direction"> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_Q)" @onmouseup="onMouseUp"> |
| | | <template #icon><UndoOutlined /></template><span class="word">Q</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_W)" @onmouseup="onMouseUp"> |
| | | <template #icon><UpOutlined/></template><span class="word">W</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_E)" @onmouseup="onMouseUp"> |
| | | <template #icon><RedoOutlined /></template><span class="word">E</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.ARROW_UP)" @onmouseup="onMouseUp"> |
| | | <template #icon><ArrowUpOutlined /></template> |
| | | </Button> |
| | | <br /> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_A)" @onmouseup="onMouseUp"> |
| | | <template #icon><LeftOutlined/></template><span class="word">A</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_S)" @onmouseup="onMouseUp"> |
| | | <template #icon><DownOutlined/></template><span class="word">S</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_D)" @onmouseup="onMouseUp"> |
| | | <template #icon><RightOutlined/></template><span class="word">D</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.ARROW_DOWN)" @onmouseup="onMouseUp"> |
| | | <template #icon><ArrowDownOutlined /></template> |
| | | </Button> |
| | | </div> |
| | | <Button type="primary" size="small" danger ghost @click="handleEmergencyStop" > |
| | | <template #icon><PauseCircleOutlined/></template><span>结束</span> |
| | | </Button> |
| | | </div> |
| | | <div class="row"> |
| | | <DroneControlPopover |
| | | :visible="flyToPointPopoverData.visible" |
| | | :loading="flyToPointPopoverData.loading" |
| | | @confirm="($event) => onFlyToConfirm(true)" |
| | | @cancel="($event) =>onFlyToConfirm(false)" |
| | | > |
| | | <template #formContent> |
| | | <div class="form-content"> |
| | | <div> |
| | | <span class="form-label">纬度:</span> |
| | | <a-input-number v-model:value="flyToPointPopoverData.latitude"/> |
| | | <div class="drone-control-box"> |
| | | <div class="box"> |
| | | <div class="row"> |
| | | <div class="drone-control"> |
| | | <Button :ghost="!flightController" size="small" @click="onClickFightControl"> |
| | | {{ flightController ? '退出控制' : '进入控制' }} |
| | | </Button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">经度:</span> |
| | | <a-input-number v-model:value="flyToPointPopoverData.longitude"/> |
| | | <div class="row"> |
| | | <div class="drone-control-direction"> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_Q)" @onmouseup="onMouseUp"> |
| | | <template #icon> |
| | | <UndoOutlined/> |
| | | </template> |
| | | <span class="word">Q</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_W)" @onmouseup="onMouseUp"> |
| | | <template #icon> |
| | | <UpOutlined/> |
| | | </template> |
| | | <span class="word">W</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_E)" @onmouseup="onMouseUp"> |
| | | <template #icon> |
| | | <RedoOutlined/> |
| | | </template> |
| | | <span class="word">E</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.ARROW_UP)" @onmouseup="onMouseUp"> |
| | | <template #icon> |
| | | <ArrowUpOutlined/> |
| | | </template> |
| | | </Button> |
| | | <br/> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_A)" @onmouseup="onMouseUp"> |
| | | <template #icon> |
| | | <LeftOutlined/> |
| | | </template> |
| | | <span class="word">A</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_S)" @onmouseup="onMouseUp"> |
| | | <template #icon> |
| | | <DownOutlined/> |
| | | </template> |
| | | <span class="word">S</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.KEY_D)" @onmouseup="onMouseUp"> |
| | | <template #icon> |
| | | <RightOutlined/> |
| | | </template> |
| | | <span class="word">D</span> |
| | | </Button> |
| | | <Button size="small" ghost @mousedown="onMouseDown(KeyCode.ARROW_DOWN)" @onmouseup="onMouseUp"> |
| | | <template #icon> |
| | | <ArrowDownOutlined/> |
| | | </template> |
| | | </Button> |
| | | </div> |
| | | <Button type="primary" size="small" danger ghost @click="handleEmergencyStop"> |
| | | <template #icon> |
| | | <PauseCircleOutlined/> |
| | | </template> |
| | | <span>结束</span> |
| | | </Button> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">高度(m):</span> |
| | | <a-input-number v-model:value="flyToPointPopoverData.height"/> |
| | | <div class="row"> |
| | | <DroneControlPopover |
| | | :visible="flyToPointPopoverData.visible" |
| | | :loading="flyToPointPopoverData.loading" |
| | | @confirm="($event) => onFlyToConfirm(true)" |
| | | @cancel="($event) =>onFlyToConfirm(false)" |
| | | > |
| | | <template #formContent> |
| | | <div class="form-content"> |
| | | <div> |
| | | <span class="form-label">纬度:</span> |
| | | <a-input-number v-model:value="flyToPointPopoverData.latitude"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">经度:</span> |
| | | <a-input-number v-model:value="flyToPointPopoverData.longitude"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">高度(m):</span> |
| | | <a-input-number v-model:value="flyToPointPopoverData.height"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <Button size="small" ghost @click="onShowFlyToPopover"> |
| | | <span>起飞</span> |
| | | </Button> |
| | | </DroneControlPopover> |
| | | <Button size="small" ghost @click="onStopFlyToPoint"> |
| | | <span>停止起飞</span> |
| | | </Button> |
| | | <DroneControlPopover |
| | | :visible="takeoffToPointPopoverData.visible" |
| | | :loading="takeoffToPointPopoverData.loading" |
| | | @confirm="($event) => onTakeoffToPointConfirm(true)" |
| | | @cancel="($event) =>onTakeoffToPointConfirm(false)" |
| | | > |
| | | <template #formContent> |
| | | <div class="form-content"> |
| | | <div> |
| | | <span class="form-label">纬度:</span> |
| | | <a-input-number v-model:value="takeoffToPointPopoverData.latitude"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">经度:</span> |
| | | <a-input-number v-model:value="takeoffToPointPopoverData.longitude"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">高度(m):</span> |
| | | <a-input-number v-model:value="takeoffToPointPopoverData.height"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">安全起飞高度(m):</span> |
| | | <a-input-number v-model:value="takeoffToPointPopoverData.securityTakeoffHeight"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">返回原点高度(m):</span> |
| | | <a-input-number v-model:value="takeoffToPointPopoverData.rthAltitude"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">失控操作:</span> |
| | | <a-select |
| | | v-model:value="takeoffToPointPopoverData.rcLostAction" |
| | | style="width: 120px" |
| | | :options="LostControlActionInCommandFLightOptions" |
| | | ></a-select> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">线路丢失操作:</span> |
| | | <a-select |
| | | v-model:value="takeoffToPointPopoverData.exitWaylineWhenRcLost" |
| | | style="width: 120px" |
| | | :options="WaylineLostControlActionInCommandFlightOptions" |
| | | ></a-select> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <Button size="small" ghost @click="onShowTakeoffToPointPopover"> |
| | | <span>一键起飞</span> |
| | | </Button> |
| | | </DroneControlPopover> |
| | | <Button :loading="cmdItem.loading" size="small" ghost @click="sendControlCmd(cmdItem, 0)"> |
| | | {{ cmdItem.operateText }} |
| | | </Button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <Button size="small" ghost @click="onShowFlyToPopover" > |
| | | <span>起飞</span> |
| | | </Button> |
| | | </DroneControlPopover> |
| | | <Button size="small" ghost @click="onStopFlyToPoint" > |
| | | <span>停止起飞</span> |
| | | </Button> |
| | | <DroneControlPopover |
| | | :visible="takeoffToPointPopoverData.visible" |
| | | :loading="takeoffToPointPopoverData.loading" |
| | | @confirm="($event) => onTakeoffToPointConfirm(true)" |
| | | @cancel="($event) =>onTakeoffToPointConfirm(false)" |
| | | > |
| | | <template #formContent> |
| | | <div class="form-content"> |
| | | <div> |
| | | <span class="form-label">纬度:</span> |
| | | <a-input-number v-model:value="takeoffToPointPopoverData.latitude"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">经度:</span> |
| | | <a-input-number v-model:value="takeoffToPointPopoverData.longitude"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">高度(m):</span> |
| | | <a-input-number v-model:value="takeoffToPointPopoverData.height"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">安全起飞高度(m):</span> |
| | | <a-input-number v-model:value="takeoffToPointPopoverData.securityTakeoffHeight"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">返回原点高度(m):</span> |
| | | <a-input-number v-model:value="takeoffToPointPopoverData.rthAltitude"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">失控操作:</span> |
| | | <a-select |
| | | v-model:value="takeoffToPointPopoverData.rcLostAction" |
| | | style="width: 120px" |
| | | :options="LostControlActionInCommandFLightOptions" |
| | | ></a-select> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">线路丢失操作:</span> |
| | | <a-select |
| | | v-model:value="takeoffToPointPopoverData.exitWaylineWhenRcLost" |
| | | style="width: 120px" |
| | | :options="WaylineLostControlActionInCommandFlightOptions" |
| | | ></a-select> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <Button size="small" ghost @click="onShowTakeoffToPointPopover" > |
| | | <span>一键起飞</span> |
| | | </Button> |
| | | </DroneControlPopover> |
| | | <Button :loading="cmdItem.loading" size="small" ghost @click="sendControlCmd(cmdItem, 0)"> |
| | | {{ cmdItem.operateText }} |
| | | </Button> |
| | | </div> |
| | | </div> |
| | | <div class="box"> |
| | | <div class="row"> |
| | | <Select v-model:value="payloadSelectInfo.value" style="width: 110px; marginRight: 5px" :options="payloadSelectInfo.options" @change="handlePayloadChange"/> |
| | | <div class="drone-control"> |
| | | <Button type="primary" size="small" @click="onAuthPayload">负载控制</Button> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <DroneControlPopover |
| | | :visible="gimbalResetPopoverData.visible" |
| | | :loading="gimbalResetPopoverData.loading" |
| | | @confirm="($event) => onGimbalResetConfirm(true)" |
| | | @cancel="($event) =>onGimbalResetConfirm(false)" |
| | | > |
| | | <template #formContent> |
| | | <div class="form-content"> |
| | | <div> |
| | | <span class="form-label">重置模式:</span> |
| | | <a-select |
| | | v-model:value="gimbalResetPopoverData.resetMode" |
| | | style="width: 180px" |
| | | :options="GimbalResetModeOptions" |
| | | ></a-select> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <Button size="small" ghost @click="onShowGimbalResetPopover"> |
| | | <span>复位</span> |
| | | </Button> |
| | | </DroneControlPopover> |
| | | <Button size="small" ghost @click="onSwitchCameraMode"> |
| | | <span>相机模式开关</span> |
| | | </Button> |
| | | </div> |
| | | <div class="row"> |
| | | <Button size="small" ghost @click="onStartCameraRecording"> |
| | | <span>开始录制</span> |
| | | </Button> |
| | | <Button size="small" ghost @click="onStopCameraRecording"> |
| | | <span>停止录制</span> |
| | | </Button> |
| | | </div> |
| | | <div class="row"> |
| | | <Button size="small" ghost @click="onTakeCameraPhoto"> |
| | | <span>拍照</span> |
| | | </Button> |
| | | <DroneControlPopover |
| | | :visible="zoomFactorPopoverData.visible" |
| | | :loading="zoomFactorPopoverData.loading" |
| | | @confirm="($event) => onZoomFactorConfirm(true)" |
| | | @cancel="($event) =>onZoomFactorConfirm(false)" |
| | | > |
| | | <template #formContent> |
| | | <div class="form-content"> |
| | | <div> |
| | | <span class="form-label">相机类型:</span> |
| | | <a-select |
| | | v-model:value="zoomFactorPopoverData.cameraType" |
| | | style="width: 120px" |
| | | :options="ZoomCameraTypeOptions" |
| | | ></a-select> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">缩放:</span> |
| | | <a-input-number v-model:value="zoomFactorPopoverData.zoomFactor" :min="2" :max="200" /> |
| | | </div> |
| | | <div class="box"> |
| | | <div class="row"> |
| | | <Select v-model:value="payloadSelectInfo.value" style="width: 110px; marginRight: 5px" |
| | | :options="payloadSelectInfo.options" @change="handlePayloadChange"/> |
| | | <div class="drone-control"> |
| | | <Button type="primary" size="small" @click="onAuthPayload">负载控制</Button> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <DroneControlPopover |
| | | :visible="gimbalResetPopoverData.visible" |
| | | :loading="gimbalResetPopoverData.loading" |
| | | @confirm="($event) => onGimbalResetConfirm(true)" |
| | | @cancel="($event) =>onGimbalResetConfirm(false)" |
| | | > |
| | | <template #formContent> |
| | | <div class="form-content"> |
| | | <div> |
| | | <span class="form-label">重置模式:</span> |
| | | <a-select |
| | | v-model:value="gimbalResetPopoverData.resetMode" |
| | | style="width: 180px" |
| | | :options="GimbalResetModeOptions" |
| | | ></a-select> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <Button size="small" ghost @click="onShowGimbalResetPopover"> |
| | | <span>复位</span> |
| | | </Button> |
| | | </DroneControlPopover> |
| | | <Button size="small" ghost @click="onSwitchCameraMode"> |
| | | <span>相机模式开关</span> |
| | | </Button> |
| | | </div> |
| | | <div class="row"> |
| | | <Button size="small" ghost @click="onStartCameraRecording"> |
| | | <span>开始录制</span> |
| | | </Button> |
| | | <Button size="small" ghost @click="onStopCameraRecording"> |
| | | <span>停止录制</span> |
| | | </Button> |
| | | </div> |
| | | <div class="row"> |
| | | <Button size="small" ghost @click="onTakeCameraPhoto"> |
| | | <span>拍照</span> |
| | | </Button> |
| | | <DroneControlPopover |
| | | :visible="zoomFactorPopoverData.visible" |
| | | :loading="zoomFactorPopoverData.loading" |
| | | @confirm="($event) => onZoomFactorConfirm(true)" |
| | | @cancel="($event) =>onZoomFactorConfirm(false)" |
| | | > |
| | | <template #formContent> |
| | | <div class="form-content"> |
| | | <div> |
| | | <span class="form-label">相机类型:</span> |
| | | <a-select |
| | | v-model:value="zoomFactorPopoverData.cameraType" |
| | | style="width: 120px" |
| | | :options="ZoomCameraTypeOptions" |
| | | ></a-select> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">缩放:</span> |
| | | <a-input-number v-model:value="zoomFactorPopoverData.zoomFactor" :min="2" |
| | | :max="200"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <Button size="small" ghost @click="($event) => onShowZoomFactorPopover()"> |
| | | <span class="word" @click=";">聚焦</span> |
| | | </Button> |
| | | </DroneControlPopover> |
| | | <DroneControlPopover |
| | | :visible="cameraAimPopoverData.visible" |
| | | :loading="cameraAimPopoverData.loading" |
| | | @confirm="($event) => onCameraAimConfirm(true)" |
| | | @cancel="($event) =>onCameraAimConfirm(false)" |
| | | > |
| | | <template #formContent> |
| | | <div class="form-content"> |
| | | <div> |
| | | <span class="form-label">相机类型:</span> |
| | | <a-select |
| | | v-model:value="cameraAimPopoverData.cameraType" |
| | | style="width: 120px" |
| | | :options="CameraTypeOptions" |
| | | ></a-select> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">锁定:</span> |
| | | <a-switch v-model:checked="cameraAimPopoverData.locked"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">x:</span> |
| | | <a-input-number v-model:value="cameraAimPopoverData.x" :min="0" :max="1"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">y:</span> |
| | | <a-input-number v-model:value="cameraAimPopoverData.y" :min="0" :max="1"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <Button size="small" ghost @click="($event) => onShowCameraAimPopover()"> |
| | | <span class="word" @click=";">目标</span> |
| | | </Button> |
| | | </DroneControlPopover> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <Button size="small" ghost @click="($event) => onShowZoomFactorPopover()"> |
| | | <span class="word" @click=";">聚焦</span> |
| | | </Button> |
| | | </DroneControlPopover> |
| | | <DroneControlPopover |
| | | :visible="cameraAimPopoverData.visible" |
| | | :loading="cameraAimPopoverData.loading" |
| | | @confirm="($event) => onCameraAimConfirm(true)" |
| | | @cancel="($event) =>onCameraAimConfirm(false)" |
| | | > |
| | | <template #formContent> |
| | | <div class="form-content"> |
| | | <div> |
| | | <span class="form-label">相机类型:</span> |
| | | <a-select |
| | | v-model:value="cameraAimPopoverData.cameraType" |
| | | style="width: 120px" |
| | | :options="CameraTypeOptions" |
| | | ></a-select> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">锁定:</span> |
| | | <a-switch v-model:checked="cameraAimPopoverData.locked"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">x:</span> |
| | | <a-input-number v-model:value="cameraAimPopoverData.x" :min="0" :max="1"/> |
| | | </div> |
| | | <div> |
| | | <span class="form-label">y:</span> |
| | | <a-input-number v-model:value="cameraAimPopoverData.y" :min="0" :max="1"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <Button size="small" ghost @click="($event) => onShowCameraAimPopover()"> |
| | | <span class="word" @click=";">目标</span> |
| | | </Button> |
| | | </DroneControlPopover> |
| | | </div> |
| | | </div> |
| | | <!-- 信息提示 --> |
| | | <!-- <DroneControlInfoPanel :message="drcInfo"></DroneControlInfoPanel> --> |
| | | </div> |
| | | </div> |
| | | <!-- 信息提示 --> |
| | | <!-- <DroneControlInfoPanel :message="drcInfo"></DroneControlInfoPanel> --> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | |
| | | 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, CloseOutlined } 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' |
| | | import { useDroneControlWsEvent } from './use-drone-control-ws-event' |
| | | import { useDroneControlMqttEvent } from './use-drone-control-mqtt-event' |
| | | import { postFlightAuth, LostControlActionInCommandFLight, WaylineLostControlActionInCommandFlight } from '/@/api/drone-control/drone' |
| | | import { |
| | | postFlightAuth, |
| | | LostControlActionInCommandFLight, |
| | | WaylineLostControlActionInCommandFlight |
| | | } from '/@/api/drone-control/drone' |
| | | import { useDroneControl } from './use-drone-control' |
| | | import { GimbalResetMode, GimbalResetModeOptions, LostControlActionInCommandFLightOptions, WaylineLostControlActionInCommandFlightOptions } from '/@/types/drone-control' |
| | | import { |
| | | GimbalResetMode, |
| | | GimbalResetModeOptions, |
| | | LostControlActionInCommandFLightOptions, |
| | | WaylineLostControlActionInCommandFlightOptions |
| | | } from '/@/types/drone-control' |
| | | import DroneControlPopover from './DroneControlPopover.vue' |
| | | import DroneControlInfoPanel from './DroneControlInfoPanel.vue' |
| | | import { noDebugCmdList as baseCmdList, DeviceCmdItem, DeviceCmd } from '/@/types/device-cmd' |
| | | import { useDockControl } from './use-dock-control' |
| | | |
| | | const props = defineProps<{ |
| | | sn: string, |
| | | deviceInfo: DeviceInfoType, |
| | | payloads: null | PayloadInfo[], |
| | | modelValue: Boolean, |
| | | sn: string, |
| | | deviceInfo: DeviceInfoType, |
| | | payloads: null | PayloadInfo[], |
| | | modelValue: Boolean, |
| | | }>() |
| | | |
| | | const store = useMyStore() |
| | |
| | | } |
| | | cmdItem.loading = false |
| | | } |
| | | |
| | | const emits = defineEmits(['update:modelValue']) |
| | | // 关闭弹窗 |
| | | const closeDrone = () => { |
| | |
| | | async function onTakeoffToPointConfirm (confirm: boolean) { |
| | | if (confirm) { |
| | | if (!takeoffToPointPopoverData.height || |
| | | !takeoffToPointPopoverData.latitude || |
| | | !takeoffToPointPopoverData.longitude || |
| | | !takeoffToPointPopoverData.securityTakeoffHeight || |
| | | !takeoffToPointPopoverData.rthAltitude) { |
| | | !takeoffToPointPopoverData.latitude || |
| | | !takeoffToPointPopoverData.longitude || |
| | | !takeoffToPointPopoverData.securityTakeoffHeight || |
| | | !takeoffToPointPopoverData.rthAltitude) { |
| | | message.error('输入错误') |
| | | return |
| | | } |
| | |
| | | } |
| | | enterFlightControl() |
| | | } |
| | | |
| | | // 进入飞行控制 |
| | | async function enterFlightControl () { |
| | | if (!clientId.value) { |
| | | message.error('无人机不在空中,不能进入指挥飞行模式。') |
| | | return |
| | | } |
| | | try { |
| | | const { code, data } = await postDrcEnter({ |
| | | client_id: clientId.value, |
| | |
| | | </script> |
| | | |
| | | <style lang='scss' scoped> |
| | | .drone-control-wrapper{ |
| | | position: absolute; |
| | | .drone-control-wrapper { |
| | | position: absolute; |
| | | background: #000; |
| | | color: #fff; |
| | | left: calc( 100% + 10px); |
| | | left: calc(100% + 10px); |
| | | width: 480px; |
| | | top: 0; |
| | | |
| | | .drone-control-header{ |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | padding: 10px 10px 0px; |
| | | } |
| | | |
| | | .drone-control-box { |
| | | display: flex; |
| | | flex-wrap: 1; |
| | | .box { |
| | | width: 50%; |
| | | padding: 5px; |
| | | border: 0.5px solid rgba(255,255,255,0.3); |
| | | |
| | | .row { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | padding: 2px; |
| | | |
| | | + .row{ |
| | | margin-bottom: 6px; |
| | | } |
| | | |
| | | &::v-deep{ |
| | | .ant-btn{ |
| | | font-size: 12px; |
| | | padding: 0px 4px; |
| | | margin-right: 5px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .drone-control{ |
| | | &::v-deep{ |
| | | |
| | | .ant-select-single:not(.ant-select-customize-input) .ant-select-selector{ |
| | | padding: 0 2px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .drone-control-direction{ |
| | | margin-right: 10px; |
| | | |
| | | .ant-btn { |
| | | // padding: 0px 1px; |
| | | margin-right: 0; |
| | | } |
| | | |
| | | .word{ |
| | | width: 12px; |
| | | margin-left: 2px; |
| | | font-size: 12px; |
| | | color: #aaa; |
| | | } |
| | | } |
| | | .drone-control-header { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | padding: 10px 10px 0px; |
| | | } |
| | | } |
| | | |
| | | .drone-control-box { |
| | | display: flex; |
| | | flex-wrap: 1; |
| | | |
| | | .box { |
| | | width: 50%; |
| | | padding: 5px; |
| | | border: 0.5px solid rgba(255, 255, 255, 0.3); |
| | | |
| | | .row { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | padding: 2px; |
| | | |
| | | + .row { |
| | | margin-bottom: 6px; |
| | | } |
| | | |
| | | &::v-deep { |
| | | .ant-btn { |
| | | font-size: 12px; |
| | | padding: 0px 4px; |
| | | margin-right: 5px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .drone-control { |
| | | &::v-deep { |
| | | |
| | | .ant-select-single:not(.ant-select-customize-input) .ant-select-selector { |
| | | padding: 0 2px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .drone-control-direction { |
| | | margin-right: 10px; |
| | | |
| | | .ant-btn { |
| | | // padding: 0px 1px; |
| | | margin-right: 0; |
| | | } |
| | | |
| | | .word { |
| | | width: 12px; |
| | | margin-left: 2px; |
| | | font-size: 12px; |
| | | color: #aaa; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |