From 7dad8e1ab0078da2ed7490b6eaac5c3ec0c0fd2b Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Sat, 19 Apr 2025 21:34:19 +0800
Subject: [PATCH] feat: 事件跳转后台
---
src/components/CurrentTaskDetails/CurrentTaskDetails.vue | 61 +++++++++++++++++++++++++++---
1 files changed, 54 insertions(+), 7 deletions(-)
diff --git a/src/components/CurrentTaskDetails/CurrentTaskDetails.vue b/src/components/CurrentTaskDetails/CurrentTaskDetails.vue
index 97bfea0..74bb1b0 100644
--- a/src/components/CurrentTaskDetails/CurrentTaskDetails.vue
+++ b/src/components/CurrentTaskDetails/CurrentTaskDetails.vue
@@ -2,11 +2,11 @@
* @Author: shuishen 1109946754@qq.com
* @Date: 2025-04-19 13:13:15
* @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2025-04-19 15:04:15
+ * @LastEditTime: 2025-04-19 15:07:04
* @FilePath: \command-center-dashboard\src\components\CurrentTaskDetails\CurrentTaskDetails.vue
- * @Description:
- *
- * Copyright (c) 2025 by shuishen, All Rights Reserved.
+ * @Description:
+ *
+ * Copyright (c) 2025 by shuishen, All Rights Reserved.
-->
<!--当前任务详情-->
<template>
@@ -20,7 +20,7 @@
>
<div class="content-container" v-if="isShow">
<!-- 视频直播 -->
- <div :class="`${isMaxMap ? 'minBox' : 'maxBox'}`">
+ <div :class="`${isMaxMap ? 'minBox' : 'maxBox'} centerPoint`">
<LiveVideo :videoUrl="currentLiveUrl" :controls="false" />
</div>
<!-- 展示地图 -->
@@ -52,7 +52,7 @@
import { ElMessage } from 'element-plus'
import EventBus from '@/event-bus'
import { updateDroneQualityApi } from '@/api/drc'
-import { getLiveAiLinkApi } from '@/api/payload'
+import { getLiveAiLinkApi, getLiveCapacityApi } from '@/api/payload'
import { CURRENT_CONFIG } from '@/utils/http/config'
import { useDroneWS } from '@/hooks/useDroneWS'
import { useTaskDetails } from '@/hooks/useTaskDetails/useTaskDetails'
@@ -71,6 +71,7 @@
const currentLiveUrl = ref('') // 当前直播地址
const isTakeOff = ref(false) // 是在飞行中
const isMaxMap = ref(false) //是大地图
+const client_id = ref('') //是大地图
// 获取机巢直播
const getDeviceLiveUrl = async () => {
@@ -78,10 +79,33 @@
currentLiveUrl.value = res.data.data.rtcs_url
}
-let { taskDetails, workspace_id, getTaskDetails } = useTaskDetails(getDeviceLiveUrl)
+const hasIr = ref(false)
+provide('hasIr', hasIr)
+//获取相机能力
+async function getLiveCapacity() {
+ 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 = () => {
+ getDeviceLiveUrl()
+}
+
+let { taskDetails, workspace_id, getTaskDetails } = useTaskDetails(useTaskDetailsCallBack)
let { wsInfo, removeWS } = useDroneWS(workspace_id) //ws信息,是一个ref对象
provide('wsInfo', wsInfo)
+provide('workspace_id', workspace_id)
provide('deviceOsdInfo', deviceOsdInfo)
provide('dockOsdInfo', wsInfo?.value?.dock_osd)
provide('dockSn', dockSn)
@@ -94,6 +118,14 @@
provide('isAiLive', isAiLive)
provide('video_id', video_id)
provide('client_id', client_id)
+
+let once = true
+watch(deviceOsdInfo,()=>{
+ if (once){
+ getLiveCapacity()
+ once =false
+ }
+})
watch(
wsInfo,
@@ -200,6 +232,21 @@
border-radius: 4rem;
overflow: hidden;
+ .centerPoint {
+ &:before {
+ content: '+';
+ font-size: 30px;
+ color: white;
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ pointer-events: none;
+ font-weight: bold;
+ text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black; /* 四方向描边 */
+ }
+ }
+
.maxBox {
width: 100%;
height: 100%;
--
Gitblit v1.9.3