Browse Source

Merge branch 'yufei' of gitadmin/tuoheng_lc_web into develop

tags/v1.0.0^2
yufei111 2 years ago
parent
commit
c41795ad5b
4 changed files with 44 additions and 24 deletions
  1. BIN
      src/assets/img/back.png
  2. BIN
      src/assets/img/open.png
  3. +43
    -23
      src/views/task-manage/all-task/components/DemandDrawer.vue
  4. +1
    -1
      src/views/task-manage/all-task/index.vue

BIN
src/assets/img/back.png View File

Before After
Width: 26  |  Height: 26  |  Size: 266B

BIN
src/assets/img/open.png View File

Before After
Width: 26  |  Height: 26  |  Size: 284B

+ 43
- 23
src/views/task-manage/all-task/components/DemandDrawer.vue View File

@@ -32,7 +32,7 @@
:class="videoShow == 'back' ? 'video_show' : 'video_hidden'"
>
<VideoPlayer :ref="videoRef" :options="getVideoOptions" @time-update="handleOriginTime" @video-status="handleOriginStatus" />
<VideoPlayer :ref="aiVideoRef" :options="getVideoAiOptions" @time-update="handleAiTime" @video-status="(data)=>videoStatus.aiStatus = data.status" />
<VideoPlayer :ref="aiVideoRef" :options="getVideoAiOptions" @time-update="handleAiTime" @video-status="handleAiStatus" />

</div>
</div>
@@ -60,7 +60,7 @@ import { styleList } from '../tools/style.js'
// 视频组件
import VideoPlayer from '@/components/VideoPlayer/index.vue'
export default defineComponent({
name: 'LiveDrawer',
name: 'DemandDrawer',
components: { VideoPlayer },
props: {
/* 可见 */
@@ -79,6 +79,7 @@ export default defineComponent({
},
setup(props, { emit }) {
const data = reactive({
show: props.visible,
mapData: null,
view: null,
trackLayer: null,
@@ -142,30 +143,37 @@ export default defineComponent({
source: data.detailData.aiVideoUrl
}
})
const handleOriginStatus = function(data) {
data.videoStatus.status = data.status
const videoRef = ref(null)
const aiVideoRef = ref(null)

const handleOriginStatus = function(params) {
data.videoStatus.status = params.status
data.videoInfo = {
...data
...params
}
}
const videoRef = ref(null)
const aiVideoRef = ref(null)
const handleOriginTime = function(data) {
const handleAiStatus = function(params) {
data.videoStatus.aiStatus = params.status
data.aiVideoInfo = {
...params
}
}
const handleOriginTime = function(params) {
data.videoInfo = {
...data
...params
}
const len = Math.abs(data.currentTime - data.aiVideoInfo.currentTime)
if (data.status === 'skip' || len > 3) {
aiVideoRef.value.seekTime(data.currentTime)
const len = Math.abs(params.currentTime - data.aiVideoInfo.currentTime)
if (params.status === 'skip' || len > 3) {
aiVideoRef.value.seekTime(params.currentTime)
}
}
const handleAiTime = function(data) {
const handleAiTime = function(params) {
data.aiVideoInfo = {
...data
...params
}
const len = Math.abs(data.currentTime - data.videoInfo.currentTime)
if (data.status === 'skip' || len > 3) {
videoRef.value.seekTime(data.currentTime)
const len = Math.abs(params.currentTime - data.videoInfo.currentTime)
if (params.status === 'skip' || len > 3) {
videoRef.value.seekTime(params.currentTime)
}
}
/* 播放视频 */
@@ -176,6 +184,7 @@ export default defineComponent({

watch(() => data.videoStatus, (value) => {
if (value.status === 'ready' && value.aiStatus === 'ready') {
console.log(value, '===================')
startAllVideo()
}
})
@@ -183,7 +192,7 @@ export default defineComponent({
onMounted(() => {
initMap()
// 加载航线
initTrack(formatTradeList(data.trackList), 'trackLayer', 'route')
initTrack(formatTradeList(data.trackList), 'route')
})

/* 初始化地图 */
@@ -223,7 +232,7 @@ export default defineComponent({
}

/* 初始化轨迹 */
const initTrack = function(coordinate, layer, routeType) {
const initTrack = function(coordinate, routeType) {
let vectorLayer = null
const route = new LineString(coordinate)
const routeFeature = new Feature({
@@ -257,10 +266,9 @@ export default defineComponent({
}
})
}
data[layer] = vectorLayer
data.mapData.addLayer(data[layer])
data.mapData.addLayer(vectorLayer)
data.view.fit(route, { padding: [50, 50, 50, 50] })
data[layer].on('postrender', moveFeature.bind())
vectorLayer.on('postrender', moveFeature.bind())

function moveFeature(event) {
/* 计算飞行的百分比 */
@@ -279,17 +287,24 @@ export default defineComponent({
emit('update:visible', false)
}

/* 视频窗口展开收起 */
const showVideo = function(value) {
data.videoShow = value
}

return {
...toRefs(data),
videoRef,
aiVideoRef,
getDrawerOptions,
handleOriginStatus,
handleAiStatus,
handleOriginTime,
handleAiTime,
getVideoOptions,
getVideoAiOptions,
handleDrawerColse
handleDrawerColse,
showVideo
}
}
})
@@ -381,4 +396,9 @@ export default defineComponent({
opacity: 0;
}
}
.imageicon {
width: 16px;
height: 16px;
margin-right: 10px;
}
</style>

+ 1
- 1
src/views/task-manage/all-task/index.vue View File

@@ -31,7 +31,7 @@
<!-- 直播抽屉 -->
<LiveDrawer v-if="liveDrawer" v-model:visible="liveDrawer" :data="rowData" />
<!-- 轨迹回放 -->
<DemandDrawer v-if="demandDrawer" v-model:visible="demandDrawer" :data="rowData" />
<DemandDrawer v-model:visible="demandDrawer" :data="rowData" />
<!-- 问题核实 -->
<VerifyDrawer v-model:visible="verifyDrawer" :data="rowData" />


Loading…
Cancel
Save