forked from drone/command-center-dashboard

罗广辉
2025-04-18 853fcbb7f34daa481e8141df8adb72cfaba6f144
feat: 控制台ai直播功能
3 files modified
25 ■■■■■ changed files
src/api/payload.js 9 ●●●● patch | view | raw | blame | history
src/components/CurrentTaskDetails/CurrentTaskDetails.vue 2 ●●● patch | view | raw | blame | history
src/components/CurrentTaskDetails/TaskDetailsHead.vue 14 ●●●●● patch | view | raw | blame | history
src/api/payload.js
@@ -83,18 +83,11 @@
// 无人机开启ai
export const getLiveAiLinkApi = (data) => {
  return request({
    url:`${API_PREFIX}/live/streams/start/ai`,
    url:`/drone-device-core/manage/api/v1/live/streams/start/ai`,
    method: 'post',
    data,
  });
};
// original_stream_url
//   :
//   "rtmp://139.196.74.78/live/1581F6Q8D247200GGSWB-81-0-0-normal-0"
// video_id
//   :
//   "1581F6Q8D247200GGSWB/81-0-0/normal-0"
src/components/CurrentTaskDetails/CurrentTaskDetails.vue
@@ -87,7 +87,7 @@
}
const getAiLiveUrl = ()=>{
    const res = getLiveAiLinkApi({ original_stream_url: `${CURRENT_CONFIG.rtmpURL}${video_id}`, video_id })
    const res = getLiveAiLinkApi({ original_stream_url: `${CURRENT_CONFIG.rtmpURL}${video_id.value}`, video_id:video_id.value })
    currentLiveUrl.value = res.data.data.rtcs_url
    isAiLive.value = true
}
src/components/CurrentTaskDetails/TaskDetailsHead.vue
@@ -3,7 +3,7 @@
        <div class="droneName" :title="taskDetails.name">{{ taskDetails.name }}</div>
        <div class="infoListBox">
            <div v-for="item in infoList">
                <div class="infoValue">{{ item.value }}{{ item.unit }}</div>
                <div class="infoValue" :title="item.value">{{ item.value }}{{ item.unit }}</div>
                <div class="infoTitle">{{ item.title }}</div>
            </div>
        </div>
@@ -62,7 +62,7 @@
}
function refreshLive(){
    EventBus.emit('CurrentTaskDetails-getAiLiveUrl')
    EventBus.emit('CurrentTaskDetails-getDroneLiveUrl')
}
function getFlightStatisticsFun() {
@@ -105,8 +105,8 @@
    infoList.value[4].value = _.round(longitude || 0, 2)
    infoList.value[5].value = _.round(latitude || 0, 2)
    infoList.value[6].value = _.round(wind_speed || 0, 0)
    if (newFourG !== undefined) infoList.value[7].value = newFourG
    if (newSdr !== undefined) infoList.value[8].value = newSdr
    if (newFourG !== undefined) infoList.value[7].value = fourGQuality[newFourG]
    if (newSdr !== undefined) infoList.value[8].value = SDRQuality[newSdr]
    if (newGPSNum !== undefined) infoList.value[9].value = newGPSNum
    if (newRTKNum !== undefined) infoList.value[10].value = newRTKNum
    infoList.value[11].value = dist
@@ -180,10 +180,14 @@
            width: 90px;
            .infoValue {
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                font-size: 20px;
                color: #ffffff;
                line-height: 15px;
                line-height: 18px;
                margin-bottom: 10px;
            }
            .infoTitle {