forked from drone/command-center-dashboard

罗广辉
2025-04-19 f713b336e30b5154f9a4a680ab136cbd97263e28
src/components/CurrentTaskDetails/CurrentTaskDetails.vue
@@ -4,9 +4,9 @@
 * @LastEditors: shuishen 1109946754@qq.com
 * @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'
@@ -79,7 +79,16 @@
   currentLiveUrl.value = res.data.data.rtcs_url
}
let { taskDetails, workspace_id, getTaskDetails } = useTaskDetails(getDeviceLiveUrl)
//获取相机能力
async function getLiveCapacity() {
   const res = await getLiveCapacityApi(workspace_id.value,{ sn: dockSn.value})
   console.log(res.data.data,66666666)
}
const useTaskDetailsCallBack = () => {
   getDeviceLiveUrl()
}
let { taskDetails, workspace_id, getTaskDetails } = useTaskDetails(useTaskDetailsCallBack)
let { wsInfo, removeWS } = useDroneWS(workspace_id) //ws信息,是一个ref对象
provide('wsInfo', wsInfo)
@@ -95,6 +104,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,
@@ -201,6 +218,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%;