From b03d7720b3207e71d4d22ec3037b2b07a34e1a3d Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Sat, 19 Apr 2025 18:38:59 +0800
Subject: [PATCH] feat: 红外
---
src/components/CurrentTaskDetails/ControlPanel/ControlPanel.vue | 5 ++++-
src/components/CurrentTaskDetails/ControlPanel/BaseControl.vue | 4 ++--
src/api/payload.js | 4 ++--
src/components/CurrentTaskDetails/TaskDetailsLeft.vue | 16 +++++++++-------
src/components/CurrentTaskDetails/TaskDetailsRight.vue | 6 +++++-
src/components/CurrentTaskDetails/CurrentTaskDetails.vue | 19 ++++++++++++++++---
6 files changed, 38 insertions(+), 16 deletions(-)
diff --git a/src/api/payload.js b/src/api/payload.js
index 1d9d374..c85f540 100644
--- a/src/api/payload.js
+++ b/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
})
diff --git a/src/components/CurrentTaskDetails/ControlPanel/BaseControl.vue b/src/components/CurrentTaskDetails/ControlPanel/BaseControl.vue
index 37bc32a..c365f48 100644
--- a/src/components/CurrentTaskDetails/ControlPanel/BaseControl.vue
+++ b/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>
diff --git a/src/components/CurrentTaskDetails/ControlPanel/ControlPanel.vue b/src/components/CurrentTaskDetails/ControlPanel/ControlPanel.vue
index 36da55e..6873e0a 100644
--- a/src/components/CurrentTaskDetails/ControlPanel/ControlPanel.vue
+++ b/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连接
diff --git a/src/components/CurrentTaskDetails/CurrentTaskDetails.vue b/src/components/CurrentTaskDetails/CurrentTaskDetails.vue
index 66c13cd..74bb1b0 100644
--- a/src/components/CurrentTaskDetails/CurrentTaskDetails.vue
+++ b/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
}
})
diff --git a/src/components/CurrentTaskDetails/TaskDetailsLeft.vue b/src/components/CurrentTaskDetails/TaskDetailsLeft.vue
index f0745fb..336d9f1 100644
--- a/src/components/CurrentTaskDetails/TaskDetailsLeft.vue
+++ b/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',
diff --git a/src/components/CurrentTaskDetails/TaskDetailsRight.vue b/src/components/CurrentTaskDetails/TaskDetailsRight.vue
index 34a7ce1..d580a43 100644
--- a/src/components/CurrentTaskDetails/TaskDetailsRight.vue
+++ b/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.
+ }
})
},
{
--
Gitblit v1.9.3