| | |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { ElMessage } from 'element-plus' |
| | | import { showNotify } from 'vant'; |
| | | import { Refresh } from '@element-plus/icons-vue'; |
| | | import { ControlSource, EModeCode } from '@/types/device' |
| | | import { CameraMode } from '@/types/live-stream' |
| | |
| | | import { useDroneControlWsEvent } from '@/utils/websocket/drone-ws-control' |
| | | import cesiumOperation from '@/utils/cesium-tsa.js'; |
| | | import { useMyStore } from '@/store' |
| | | import { fa } from 'element-plus/es/locale'; |
| | | |
| | | const { loadLAYER } = cesiumOperation() |
| | | |
| | |
| | | } |
| | | |
| | | if (isActionComplete.value) { |
| | | ElMessage.warning('当前相机动作暂未完成,请勿点击!!') |
| | | showNotify({ type: 'warning', message: '当前相机动作暂未完成,请勿点击!' }) |
| | | return |
| | | } |
| | | if (payloadSelectInfo.camera?.recording_state) { |
| | | ElMessage.warning('当前摄像头正在录制视频,请先结束视频录制!!') |
| | | showNotify({ type: 'warning', message: '当前摄像头正在录制视频,请先结束视频录制' }) |
| | | return |
| | | } |
| | | |
| | |
| | | const curTaskCameraPhoto = (time:any) => { |
| | | isActionComplete.value = true |
| | | |
| | | ElMessage({ |
| | | showNotify({ |
| | | message: '请稍后,正在拍摄中。。。', |
| | | duration: 2000, |
| | | }) |
| | |
| | | authPayload(props.osdVisible.dockSn, payloadSelectInfo.payloadIndex).then( |
| | | (payloadRes:any) => { |
| | | if (payloadRes.code !== 0) |
| | | return ElMessage.error('获得有效载荷控制失败,请稍后重试!!') |
| | | return showNotify({ type: 'danger', message: '获得有效载荷控制失败,请稍后重试!' }) |
| | | payloadControlSource.value = ControlSource.A |
| | | ElMessage.success('成功获得有效载荷控制') |
| | | showNotify({ type: 'success', message: '成功获得有效载荷控制' }) |
| | | }, |
| | | ) |
| | | } |
| | |
| | | return |
| | | } |
| | | if (isActionComplete.value) { |
| | | ElMessage.warning('当前相机动作暂未完成,请勿点击!!') |
| | | showNotify({ type: 'warning', message: '当前相机动作暂未完成,请勿点击!' }) |
| | | return |
| | | } |
| | | |
| | | if (payloadSelectInfo.camera?.recording_state) { |
| | | return ElMessage.warning( |
| | | '当前摄像头正在录制视频,请勿重复点击!!', |
| | | ) |
| | | return showNotify({ type: 'warning', message: '当前摄像头正在录制视频,请勿重复点击!' }) |
| | | } |
| | | |
| | | if (payloadSelectInfo.camera?.camera_mode !== CameraMode.Video) { |
| | |
| | | const curStartCameraRecording = (time:any) => { |
| | | isActionComplete.value = true |
| | | |
| | | ElMessage({ |
| | | showNotify({ |
| | | message: '请稍后,正在开启视频录制。。。', |
| | | duration: 2000, |
| | | }) |
| | |
| | | startCameraRecording(props.osdVisible.dockSn, payloadSelectInfo.payloadIndex) |
| | | .then((res) => { |
| | | if (res.code !== 0) |
| | | return ElMessage.warning('开始录制失败,请稍后重试!!') |
| | | ElMessage.success('开始录制成功') |
| | | return showNotify({ type: 'warning', message: '开始录制失败,请稍后重试!' }) |
| | | showNotify({ type: 'success', message: '开始录制成功!' }) |
| | | // 开始录像 |
| | | isCameraRecording.value = true |
| | | isActionComplete.value = false |
| | |
| | | return |
| | | } |
| | | if (isActionComplete.value) { |
| | | ElMessage.warning('当前相机动作暂未完成,请勿点击!!') |
| | | showNotify({ type: 'warning', message: '当前相机动作暂未完成,请勿点击!' }) |
| | | return |
| | | } |
| | | isActionComplete.value = true |
| | | stopCameraRecording(props.osdVisible.dockSn, payloadSelectInfo.payloadIndex) |
| | | .then((res) => { |
| | | if (res.code !== 0) |
| | | return ElMessage.warning('停止录制失败,请稍后重试!!') |
| | | ElMessage.success('停止录制成功') |
| | | return showNotify({ type: 'warning', message: '停止录制失败,请稍后重试!' }) |
| | | showNotify({ type: 'success', message: '停止录制成功' }) |
| | | // 停止录像 |
| | | isCameraRecording.value = false |
| | | isActionComplete.value = false |
| | |
| | | if (zoom_factor.value <= 2) { |
| | | zoom_factor.value = 2 |
| | | } |
| | | console.log('9999', zoom_factor.value) |
| | | } |
| | | switchLivestream({ |
| | | video_id: `${props.osdVisible.dockSn}/${payloadSelectInfo.payloadIndex}/normal-0`, |