| | |
| | | export const flyByJobId = jobId => { |
| | | return request({ |
| | | url: '/drone-device-core/wayline/api/v1/workspaces/flyByJobId?jobId=' + jobId, |
| | | method: 'get', |
| | | method: 'post', |
| | | }) |
| | | } |
| | | // 再次执行 |
| | |
| | | }) |
| | | } |
| | | // 机巢直播/无人机直播 均可使用 |
| | | export const liveStart = deviceSn => { |
| | | export const liveStart = (deviceSn, quality) => { |
| | | return request({ |
| | | url: `/drone-device-core/manage/api/v1/live/streams/liveStart?deviceSn=${deviceSn}`, |
| | | url: `/drone-device-core/manage/api/v1/live/streams/liveStart?deviceSn=${deviceSn}&quality=${quality}`, |
| | | method: 'post', |
| | | data: {}, |
| | | headers: { |
| | |
| | | <div |
| | | :class="[index % 2 === 1 ? 'table-itemeven' : 'table-item']" |
| | | v-for="(item, index) in tableList" |
| | | :key="index" |
| | | :key="index" @click="signMachineNestClick(item)" |
| | | > |
| | | <img src="/src/assets/images/home/homeLeft/machinenestlist-sign.png" alt="" /> |
| | | <div class="middle"> |
| | | <div class="title">{{ item.nickname }}</div> |
| | | <div class="number"> |
| | | 飞行次数:<span>{{ item.fly_count }}</span |
| | | >次 飞行里程:<span>{{ item.flight_mileage }}</span |
| | | >km |
| | | 飞行次数: |
| | | <span>{{ item.fly_count }}</span> |
| | | 次 飞行里程: |
| | | <span>{{ item.flight_mileage }}</span> |
| | | km |
| | | </div> |
| | | <div class="result"> |
| | | 任务成果:<span>{{ item.accumulate_data }}</span |
| | | >个 飞行时长:<span>{{ item.hour }}</span |
| | | >h |
| | | 任务成果: |
| | | <span>{{ item.accumulate_data }}</span> |
| | | 个 飞行时长: |
| | | <span>{{ item.hour }}</span> |
| | | h |
| | | </div> |
| | | </div> |
| | | <div |
| | | class="right" |
| | | :class="item.status === 'WORKING' ? 'atcive' : item.status === 'OFFLINE' ? 'offine' : 'freetime'" |
| | | @click="signMachineNestClick(item)" |
| | | > |
| | | :class="item.status === 'WORKING' ? 'atcive' : item.status === 'OFFLINE' ? 'offine' : 'freetime'"> |
| | | {{ item.status === 'OFFLINE' ? '离线中' : item.status === 'WORKING' ? '作业中' : '空闲中' }} |
| | | </div> |
| | | </div> |
| | |
| | | let total = ref(0); |
| | | // 机巢统计 |
| | | let listNum = ref([ |
| | | { name: '空闲中', value: 89, color: '#FFA768' }, |
| | | { name: '作业中', value: 100, color: '#8EFFAC' }, |
| | | { name: '离线中', value: 66, color: '#FFFFFF' }, |
| | | { name: '空闲中', value: 0, color: '#FFA768' }, |
| | | { name: '作业中', value: 0, color: '#8EFFAC' }, |
| | | { name: '离线中', value: 0, color: '#FFFFFF' }, |
| | | // { name: '异常', value: 10, color: '#FF8E8E' }, |
| | | ]); |
| | | // 获取机巢列表 |
| | |
| | | <img src="../../../assets/images/signMachineNest/machineRight/name.png" alt="" />{{ item.creator_name || '' }} |
| | | </div> |
| | | </div> |
| | | <div class="right" v-if="tabIndex===1" @click="returnImmediately(item.id)"> |
| | | <div class="right" v-if="tabIndex===1" @click="reExecute(item.dock_sn)"> |
| | | <span>立即返航</span> |
| | | <img src="../../../assets/images/signMachineNest/machineRight/return-fly.png" alt=""> |
| | | </div> |
| | | <div class="right" v-else @click="reExecute(item.dock_sn)"> |
| | | <div class="right" v-else @click="returnImmediately(item.job_id)"> |
| | | <span>再次执行</span> |
| | | <img src="../../../assets/images/signMachineNest/machineRight/return-fly.png" alt=""> |
| | | </div> |
| | |
| | | |
| | | <script setup> |
| | | import { Search } from '@element-plus/icons-vue'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import CommonTitle from '@/components/CommonTitle.vue'; |
| | | import { getBeforeJob, getTodayJob, flyByJobId, returnHome } from '@/api/home'; |
| | | import { useStore } from 'vuex'; |
| | |
| | | const returnImmediately = (id) => { |
| | | flyByJobId(id).then(result => { |
| | | if (result.data.code === 0) { |
| | | ElMessage.success('返航成功'); |
| | | ElMessage.success('执行成功'); |
| | | } else { |
| | | ElMessage.error(result.data.message); |
| | | } |
| | |
| | | const reExecute = (dock_sn) => { |
| | | returnHome(dock_sn).then(result => { |
| | | if (result.data.code === 0) { |
| | | ElMessage.success('执行成功'); |
| | | ElMessage.success('返航成功'); |
| | | } else { |
| | | ElMessage.error(result.data.message); |
| | | } |
| | |
| | | <!-- 机巢监控 --> |
| | | <template> |
| | | <CommonTitle title="机巢监控" /> |
| | | <CommonTitle title="视频监控" /> |
| | | <div :style="{ marginLeft: pxToRem(14) }"> |
| | | <div class="machine-monitor"> |
| | | <LiveVideo :videoUrl="airPortUrl" /> |
| | |
| | | // 直播地址 |
| | | let airPortUrl = ref(''); |
| | | // 获取直播地址 |
| | | const getVideoUrl = () => { |
| | | liveStart(singleUavHome.value.device_sn).then(res => { |
| | | const getVideoUrl = (sn,quality) => { |
| | | liveStart(sn, quality).then(res => { |
| | | if (res.data.code !== 0) return; |
| | | airPortUrl.value = res.data.data.rtcs_url; |
| | | }); |
| | | }; |
| | | let isCurrentSn = ref(false); |
| | | let CurrentSn = ref(''); |
| | | // 监听ws消息 |
| | | watch( |
| | | () => store.state.home.deviceState.deviceInfo, |
| | | (newValue) => { |
| | | CurrentSn.value = Object.keys(newValue)[0]; |
| | | const currentDevice = newValue[CurrentSn.value]; |
| | | if (currentDevice.mode_code > 0) { |
| | | isCurrentSn.value = true; |
| | | } else if (currentDevice.mode_code === 14) { |
| | | isCurrentSn.value = false; |
| | | } else { |
| | | isCurrentSn.value = false; |
| | | } |
| | | }, |
| | | { |
| | | immediate: true, |
| | | deep: true, |
| | | } |
| | | ); |
| | | // 监听 isCurrentSn |
| | | watch(isCurrentSn, (newVal) => { |
| | | if (newVal) { |
| | | getVideoUrl(CurrentSn.value, 2); |
| | | } else { |
| | | getVideoUrl(singleUavHome.value.device_sn,1); |
| | | } |
| | | }, { immediate: true,deep: true }); |
| | | onMounted(() => { |
| | | getVideoUrl(); |
| | | getVideoUrl(singleUavHome.value.device_sn,1); |
| | | }); |
| | | </script> |
| | | |
| | |
| | | <div class="info"> |
| | | <img src="../../../../assets/images/signMachineNest/machineRight/wrj.png" alt=""> |
| | | <div class="info-right"> |
| | | <div class="name">{{ osdVisible?.callsign || '--' }}</div> |
| | | <!-- <div class="name">{{ osdVisible?.callsign || '--' }}</div> --> |
| | | <div class="name">{{ singleUavHome?.nickname || '--' }}</div> |
| | | <div class="wz"> |
| | | <span class="left">当前位置:</span> |
| | | <span class="right">{{ detailInfo.longitude }},{{ detailInfo.latitude }}</span> |
| | |
| | | const store = useStore(); |
| | | // 获取机巢信息 |
| | | let osdVisible = computed(() => store.state.home.osdVisible); |
| | | const singleUavHome = computed(() => store.state.home.singleUavHome); |
| | | // 单个机巢统计数据 |
| | | const singleTotal = computed(() => store.state.home.singleTotal); |
| | | // 是否展示机机巢状态详情 |
| | |
| | | (newValue) => { |
| | | if (newValue.mode_code === 14) return |
| | | if (Object.keys(newValue).length === 0) return |
| | | // console.log(newValue, '顶顶顶111') |
| | | detailInfo.value.longitude = newValue?.longitude.toFixed(6) || '--'; |
| | | detailInfo.value.latitude = newValue?.latitude.toFixed(6) || '--'; |
| | | getLnglatAltitude(Number(detailInfo.value.longitude), Number(detailInfo.value.latitude)).then((res) => { |
| | | console.log(res, '顶顶顶') |
| | | |
| | | getLnglatAltitude(Number(detailInfo.value.longitude), Number(detailInfo.value.latitude),window.$viewer).then((res) => { |
| | | // console.log('333333333', res); |
| | | const height = newValue?.height - res?.height; |
| | | //针对西安实时高度进行降低 |
| | | const wId = localStorage.getItem('bs_workspace_id'); |
| | |
| | | // 获取最新机场状态 |
| | | watch(store.state.home.deviceState, (newValue) => { |
| | | // if (data.currentSn !== osdVisible.gateway_sn) return; |
| | | if (newValue.currentType === EDeviceTypeName.Dock && newValue.dockInfo[newValue.currentSn]) { |
| | | if (newValue.currentType === EDeviceTypeName.Dock && newValue?.dockInfo[newValue.currentSn]) { |
| | | // 机场状态 |
| | | mode_code.value = EDockModeText[newValue.dockInfo[newValue.currentSn]?.basic_osd?.mode_code]; |
| | | mode_code.value = EDockModeText[newValue?.dockInfo[newValue.currentSn]?.basic_osd?.mode_code]; |
| | | // this.$emit('updateModeCode', mode_code.value); |
| | | // 舱内状态 |
| | | AircraftStatus.value = |
| | |
| | | ]?.mode_code |
| | | ]; |
| | | // 舱内关机时显示的电量 |
| | | let child_sn = newValue.dockInfo[newValue.currentSn].basic_osd.sub_device.device_sn; |
| | | let child_sn = newValue?.dockInfo[newValue.currentSn].basic_osd.sub_device.device_sn; |
| | | // 飞机在线时取飞机中的电量 |
| | | if(newValue.deviceInfo[child_sn]) { |
| | | drone_charge_state.value = { |
| | |
| | | font-size: 24px; |
| | | color: #0BE5F5; |
| | | line-height: 28px; |
| | | overflow: hidden; // 添加溢出隐藏 |
| | | text-overflow: ellipsis; // 显示省略号 |
| | | white-space: nowrap; // 不换行 |
| | | } |
| | | .wz { |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | |
| | | break |
| | | } |
| | | case EBizCode.DeviceOsd: { |
| | | // console.log(payload, 'DeviceOsd') |
| | | store.commit('setDeviceInfo', payload) |
| | | store.commit('setWsMessage', payload) |
| | | break |
| | |
| | | getFlightStatistics(singleUavHome.value.device_sn).then(res => { |
| | | if (res.data.code !== 0) return; |
| | | const result = res.data.data; |
| | | console.log(result); |
| | | console.log(result); |
| | | store.commit('setSingleTotal', result); |
| | | }) |
| | | }; |