| | |
| | | |
| | | <!-- 控制面板,里面有方法需要立即执行,不可用v-if --> |
| | | <ControlPanel v-show="!isAutoControl" /> |
| | | <img alt="" :src="amplifyImg" class="amplify" @click="amplify" /> |
| | | <img alt="" :src="amplifyImg" class="amplify" @click="isMaxMap = !isMaxMap" /> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | |
| | | import amplifyImg from '@/assets/images/taskManagement/taskIntermediateContent/amplifyImg.png' |
| | | import { ElMessage } from 'element-plus' |
| | | import EventBus from '@/event-bus' |
| | | import { updateDroneQualityApi } from '@/api/drc' |
| | | |
| | | const isAutoControl = ref(true) |
| | | const lineQuality = ref(1) //1流畅,2标清 |
| | | provide('isAutoControl', isAutoControl) |
| | | provide('lineQuality', lineQuality) |
| | | |
| | | const isShow = defineModel('show') |
| | | const props = defineProps(['id']) |
| | | const currentLiveUrl = ref('') |
| | | const taskDetailsViewer = ref(null) |
| | | provide('taskDetailsViewer', taskDetailsViewer) |
| | | |
| | | let taskDetails = ref({}) |
| | | const deviceOsdInfo = ref({}) |
| | | provide('taskDetails', taskDetails) |
| | |
| | | provide('dockSn', dockSn) |
| | | provide('droneSn', droneSn) |
| | | |
| | | const isShow = defineModel('show') |
| | | const props = defineProps(['id']) |
| | | const currentLiveUrl = ref('') |
| | | const isTakeOff = ref(false) |
| | | const isMaxMap = ref(false) |
| | | const amplify = () => { |
| | | isMaxMap.value = !isMaxMap.value |
| | | } |
| | | let droneWebSocket //WS实例 |
| | | |
| | | // 机巢直播 |
| | | const getDeviceLiveUrl = async () => { |
| | |
| | | currentLiveUrl.value = res.data.data.rtcs_url |
| | | } |
| | | |
| | | // 无人机直播画质切换 |
| | | const changeLineQuality = async () => { |
| | | const video_id = ref('') |
| | | |
| | | // 获取无人机直播url |
| | | async function getDroneLiveUrl() { |
| | | const res = await liveStart(droneSn.value, lineQuality.value) |
| | | currentLiveUrl.value = res.data.data.rtcs_url |
| | | video_id.value = res.data.data.video_id |
| | | } |
| | | |
| | | const isTakeOff = ref(false) |
| | | // 无人机直播画质切换 |
| | | const changeLineQuality = async () => { |
| | | const res = await updateDroneQualityApi({ video_id: video_id.value, video_quality: lineQuality.value }) |
| | | ElMessage.success('切换画质成功') |
| | | } |
| | | |
| | | // 设置当前直播地址 |
| | | const setCurrentLiveUrl = async () => { |
| | |
| | | // 如果还是之前的状态,不切换 |
| | | if (isTakeOff.value === currentIsTakeOff) return |
| | | isTakeOff.value = currentIsTakeOff |
| | | isTakeOff.value ? await changeLineQuality() : await getDeviceLiveUrl() |
| | | isTakeOff.value ? await getDroneLiveUrl() : await getDeviceLiveUrl() |
| | | } |
| | | |
| | | // 获取任务详情获取航线文件 |
| | |
| | | case EBizCode.DeviceOsd: { |
| | | deviceOsdInfo.value = payload |
| | | setCurrentLiveUrl() |
| | | console.log(deviceOsdInfo.value, 'device_osd信息') |
| | | console.log(payload, 'DeviceOsd--信息') |
| | | break |
| | | } |
| | | case EBizCode.GatewayOsd: { |
| | | console.log(payload, 'GatewayOsd--信息') |
| | | break |
| | | } |
| | | case EBizCode.DockOsd: { |
| | | console.log(payload, 'GatewayOsd--信息') |
| | | break |
| | | } |
| | | default: |
| | |
| | | } |
| | | } |
| | | |
| | | let droneWebSocket |
| | | // 创建ws连接 |
| | | const createWsConnect = () => { |
| | | const workspaceId = taskDetails.value.workspace_id |