| | |
| | | instance.interceptors.response.use( |
| | | response => { |
| | | // console.info('URL: ' + response.config.baseURL + response.config.url, '\nData: ', response.data, '\nResponse:', response) |
| | | |
| | | const whiteList = ['/manage/api/v1/live/streams/stop'] |
| | | if (whiteList.includes(response.config.url)) { |
| | | return Promise.reject(response.data) |
| | | } |
| | | // 处理消息返回 |
| | | // if (response.data.code && !response.data.success) { |
| | | // message.error(response.data.message) |
| | |
| | | } |
| | | // 飞行设备关闭 |
| | | const closeFly = async () => { |
| | | const videoId = deviceInfo.dock.basic_osd?.sub_device?.device_sn + '/' + aircraSelected.value + '/' + 'normal-0' |
| | | aircraftList.value.forEach(item => { |
| | | const videoId = deviceInfo.dock.basic_osd?.sub_device?.device_sn + '/' + item.value + '/' + 'normal-0' |
| | | stopLivestream({ |
| | | video_id: videoId |
| | | }).then(res => { |
| | | console.log(res, 'res') |
| | | if (res.code === 0) { |
| | | aircraftUrl.value = '' |
| | | } |
| | | }).catch(e => { |
| | | console.log(e, 'errrrrrrrrrrrrrr') |
| | | }) |
| | | }) |
| | | // const videoId = deviceInfo.dock.basic_osd?.sub_device?.device_sn + '/' + aircraSelected.value + '/' + 'normal-0' |
| | | aircraftList.value = [] |
| | | aircraSelected.value = '' |
| | | stopLivestream({ |
| | | video_id: videoId |
| | | }).then(res => { |
| | | if (res.code === 0) { |
| | | aircraftUrl.value = '' |
| | | } |
| | | }) |
| | | } |
| | | watch(() => store.state.deviceStatusEvent, |
| | | data => { |
| | |
| | | </div> |
| | | </template> |
| | | <Button size="small" ghost @click="onShowTakeoffToPointPopover" > |
| | | <span>起飞</span> |
| | | <span>一键起飞</span> |
| | | </Button> |
| | | </DroneControlPopover> |
| | | <Button :loading="cmdItem.loading" size="small" ghost @click="sendControlCmd(cmdItem, 0)"> |
| | |
| | | marker: markers, |
| | | initMarker, |
| | | removeMarker, |
| | | moveTo |
| | | moveTo, |
| | | } |
| | | } |
| | |
| | | }).then((AMap) => { |
| | | state.aMap = AMap |
| | | state.map = new AMap.Map(container, { |
| | | center: [113.943225499, 22.577673716], |
| | | center: [115.85666327144976, 28.62452712442823], |
| | | zoom: 15 |
| | | }) |
| | | state.mouseTool = new AMap.MouseTool(state.map) |
| | | |
| | | // 挂在到全局 |
| | | app.config.globalProperties.$aMap = state.aMap |
| | | app.config.globalProperties.$map = state.map |
| | |
| | | function globalPropertiesConfig (app:App) { |
| | | initMap('g-container', app) |
| | | } |
| | | |
| | | async function setCenter (position: any) { |
| | | state.map?.setCenter(position) |
| | | } |
| | | function getCenter () { |
| | | const center = state.map?.getCenter() |
| | | } |
| | | return { |
| | | globalPropertiesConfig, |
| | | setCenter, |
| | | getCenter |
| | | } |
| | | } |
| | |
| | | <script lang="ts" setup> |
| | | import { computed, onMounted, reactive, ref, watch, WritableComputedRef } from 'vue' |
| | | import { EDeviceTypeName, ELocalStorageKey } from '/@/types' |
| | | import JessibucaVideo from '/@/components/Jessibuca/Jessibuca.vue' |
| | | import noData from '/@/assets/icons/no-data.png' |
| | | import rc from '/@/assets/icons/rc.png' |
| | | import { OnlineDevice, EModeCode, OSDVisible, EDockModeCode, DeviceOsd, EDockModeText, EModeText } from '/@/types/device' |