吉安感知网项目-前端
罗广辉
2026-01-26 beb95fb5fc166804056abafd70fc01ac27de7621
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<template>
    <el-dialog
        class="work-dialog-video playback-dialog"
        v-model="isShow"
        append-to-body
        :close-on-click-modal="false"
        :destroy-on-close="true"
        :show-close="false"
    >
        <template #header>
            <div class="title">视频回放</div>
 
            <div class="close" @click="isShow = false"></div>
        </template>
 
        <div v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.7)">
            <div class="mpa-container">
                <MapContainer ref="mapContainerEle" />
            </div>
 
            <div class="video-player-container">
                <VideoPlayer ref="videoPlayerEle" />
            </div>
 
            <div v-show="photoEleShow" class="photo-list-container">
                <PhotoList ref="photoListEle" />
            </div>
        </div>
    </el-dialog>
</template>
 
<script setup>
import PhotoList from '@/components/PlaybackVideo/components/PhotoList.vue'
import VideoPlayer from '@/components/PlaybackVideo/components/VideoPlayer.vue'
import MapContainer from '@/components/PlaybackVideo/components/MapContainer.vue'
import { getWaylinejobLiveRecordPage, findFlightLogInfoByJobId, aiImagesPage } from '@/api/playback/'
const isShow = defineModel('show', {
    type: Boolean,
    default: true,
})
 
const detailData = defineModel('detailData', {
    type: Object,
    default: () => ({}),
})
 
const props = defineProps(['detailsData'])
 
const loading = ref(true)
const photoEleShow = ref(false)
 
const positionData = ref(null)
const attachmentData = ref(null)
 
const mapContainerEle = ref(null)
const videoPlayerEle = ref(null)
const photoListEle = ref(null)
 
const jobId = inject('jobId')
 
provide('videoData', detailData)
provide('positionData', positionData)
provide('attachmentData', attachmentData)
 
watch(isShow, newVal => {
    if (newVal) {
        init()
    }
})
 
const init = async () => {
    loading.value = true
    await nextTick()
 
    Promise.all([
        findFlightLogInfoByJobId({ jobId: jobId.value }),
        aiImagesPage({ size: 30, current: 1 }, { size: 30, current: 1, wayLineJobId: jobId.value, resultTypes: [0, 2] }),
    ]).then(([positionDetails, attachmentDetails]) => {
        let arr = positionDetails.data.data.filter(item => {
            return item.create_time >= detailData.value.start_time && item.create_time <= detailData.value.end_time
        })
 
        positionData.value = arr.sort((a, b) => a.create_time - b.create_time)
 
        attachmentData.value =
            attachmentDetails.data.data.records
                .filter(item => {
                    return (
                        item.metadata.createdTime >= detailData.value.start_time &&
                        item.metadata.createdTime <= detailData.value.end_time
                    )
                })
                .map(item => ({
                    ...item,
                    metadata: {
                        ...item.metadata,
                        createdTime: item.metadata.createdTime,
                    },
                })) || []
 
        photoEleShow.value = attachmentData.value.length > 0
 
        videoPlayerEle.value.init(detailData.value, attachmentData.value)
        mapContainerEle.value.init(positionData.value, props.detailsData, props.taskData)
        photoListEle.value.init(detailData.value, attachmentData.value)
 
        loading.value = false
    })
}
</script>
 
<style lang="scss" scoped>
.mpa-container {
    position: absolute;
    top: 58px;
    left: 10px;
    width: 338px;
    height: 206px;
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
}
 
.video-player-container {
    width: 100%;
    height: 100%;
}
 
.photo-list-container {
    position: absolute;
    top: 58px;
    right: 10px;
    width: 338px;
    height: calc(100% - 116px);
    z-index: 1;
    border-radius: 8px;
    background: rgba(2, 2, 2, 0.6);
    overflow: hidden;
    backdrop-filter: blur(13.7px);
}
</style>