forked from drone/command-center-dashboard

罗广辉
2025-04-19 b03d7720b3207e71d4d22ec3037b2b07a34e1a3d
feat: 红外
6 files modified
54 ■■■■ changed files
src/api/payload.js 4 ●●●● patch | view | raw | blame | history
src/components/CurrentTaskDetails/ControlPanel/BaseControl.vue 4 ●●●● patch | view | raw | blame | history
src/components/CurrentTaskDetails/ControlPanel/ControlPanel.vue 5 ●●●● patch | view | raw | blame | history
src/components/CurrentTaskDetails/CurrentTaskDetails.vue 19 ●●●● patch | view | raw | blame | history
src/components/CurrentTaskDetails/TaskDetailsLeft.vue 16 ●●●●● patch | view | raw | blame | history
src/components/CurrentTaskDetails/TaskDetailsRight.vue 6 ●●●● patch | view | raw | blame | history
src/api/payload.js
@@ -59,9 +59,9 @@
  })
}
export function getLiveCapacityApi(workspace_id,params) {
export function getLiveCapacityApi(params) {
  return request({
    url:`/drone-device-core/manage/api/v1/live/capacity${workspace_id}`,
    url:`/drone-device-core/manage/api/v1/live/capacity`,
    method:'get',
    params
  })
src/components/CurrentTaskDetails/ControlPanel/BaseControl.vue
@@ -34,6 +34,8 @@
const list3 = computed(() => [
    { name: '自动控制', svg: 'autoControl', style: { top: '-70%' }, active: isAutoControl.value, handle: autoControl },
    //如果是返航, 继续任务 就是自动任务
    //如果是取消返航, 继续任务 就是自动任务
    { name: '继续任务', svg: 'continueTask', style: { left: '70%' }, active: false, handle: autoControl },
    {
        name: '手动控制',
@@ -46,7 +48,6 @@
])
function autoControl() {
    isAutoControl.value = true
    EventBus.emit('controlPanel-cancelControl')
}
@@ -55,7 +56,6 @@
}
function turnBack() {
    isAutoControl.value = true
    EventBus.emit('controlPanel-returnOrCancelReturn')
}
</script>
src/components/CurrentTaskDetails/ControlPanel/ControlPanel.vue
@@ -324,9 +324,10 @@
function cancelControl() {
    exitController({ client_id: client_id.value, dock_sn: dockSn.value })
        .then(res => {
            flightController.value = false
            deviceTopicInfo.value.subTopic = ''
            deviceTopicInfo.value.pubTopic = ''
            flightController.value = false
            isAutoControl.value = true
            ElMessage.success('退出飞行控制成功')
        })
        .catch(e => {})
@@ -365,6 +366,7 @@
    await returnHome(dockSn?.value)
    ElMessage.success('返航操作成功')
    isBackDock.value = true
    isAutoControl.value = true
}
// 取消返航
@@ -372,6 +374,7 @@
    await returnHomeCancel({ dock_sn: dockSn?.value, client_id: client_id.value })
    ElMessage.success('取消返航成功')
    isBackDock.value = false
    isAutoControl.value = false
}
// 创建mqtt连接
src/components/CurrentTaskDetails/CurrentTaskDetails.vue
@@ -79,12 +79,25 @@
    currentLiveUrl.value = res.data.data.rtcs_url
}
const hasIr = ref(false)
provide('hasIr', hasIr)
//获取相机能力
async function getLiveCapacity() {
    const res = await getLiveCapacityApi(workspace_id.value,{ sn: dockSn.value})
    const res = await getLiveCapacityApi({ sn: droneSn.value})
    res?.data?.data?.forEach((item) => {
        item?.cameras_list?.forEach((item1) => {
            item1?.videos_list?.forEach((item2) => {
                item2?.switch_video_types?.forEach(item3 =>{
                      if (item3 === 'ir'){
                            hasIr.value = true
                        }
                })
            })
        })
    })
}
const useTaskDetailsCallBack = () => {
    console.log(workspace_id.value,66666666)
    getDeviceLiveUrl()
}
@@ -109,7 +122,7 @@
let once = true
watch(deviceOsdInfo,()=>{
    if (once){
        // getLiveCapacity()
        getLiveCapacity()
        once =false
    }
})
src/components/CurrentTaskDetails/TaskDetailsLeft.vue
@@ -3,7 +3,7 @@
        <div class="title">负载控制</div>
        <div
            class="singleCol"
            v-for="item in list1"
            v-for="item in list1.filter(i => i.show)"
            @click="cameraType(item)"
            :key="item.key"
            :class="{ active: item.key === cameraParams.camera_type }"
@@ -106,12 +106,14 @@
// 初始化喊话
let globalShout = null
const isRecording = ref(false)
const list1 = ref([
    { name: '广角', key: 'wide' },
    { name: '变焦', key: 'zoom' },
    { name: '红外', key: 'ir' },
])
const hasIr = inject('hasIr')
const list1 = computed(() => {
    return [
        { name: '广角', key: 'wide',show:true },
        { name: '变焦', key: 'zoom', show: true },
        { name: '红外', key: 'ir',show: hasIr.value },
    ]
})
const cameraParams = ref({
    zoom_factor: 0,
    camera_type: 'wide',
src/components/CurrentTaskDetails/TaskDetailsRight.vue
@@ -32,7 +32,7 @@
    { name: '关联算法', value: '', field: 'ai_type_str' },
    { name: '任务描述', value: '', field: 'remark' },
])
// takePhoto,hover
watch(
    taskDetails,
    () => {
@@ -42,6 +42,10 @@
                const { rep_rule_type = '', rep_rule_val = '' } = taskDetails?.value || {}
                item.value = rep_rule_type + ' -- ' + rep_rule_val
            }
            if (item.name === '飞行事件') {
                const { action_modes = [] } = taskDetails?.value || {}
                // todo item.value = action_modes.
            }
        })
    },
    {