Browse Source

Merge branch 'develop' of http://192.168.11.14:51037/gitadmin/tuoheng_lc_web into zhangtao

tags/v1.0.0^2
zhangtao 2 years ago
parent
commit
ae9f4348ad
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

:class="videoShow == 'back' ? 'video_show' : 'video_hidden'" :class="videoShow == 'back' ? 'video_show' : 'video_hidden'"
> >
<VideoPlayer :ref="videoRef" :options="getVideoOptions" @time-update="handleOriginTime" @video-status="handleOriginStatus" /> <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>
</div> </div>
// 视频组件 // 视频组件
import VideoPlayer from '@/components/VideoPlayer/index.vue' import VideoPlayer from '@/components/VideoPlayer/index.vue'
export default defineComponent({ export default defineComponent({
name: 'LiveDrawer',
name: 'DemandDrawer',
components: { VideoPlayer }, components: { VideoPlayer },
props: { props: {
/* 可见 */ /* 可见 */
}, },
setup(props, { emit }) { setup(props, { emit }) {
const data = reactive({ const data = reactive({
show: props.visible,
mapData: null, mapData: null,
view: null, view: null,
trackLayer: null, trackLayer: null,
source: data.detailData.aiVideoUrl 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.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.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.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)
} }
} }
/* 播放视频 */ /* 播放视频 */


watch(() => data.videoStatus, (value) => { watch(() => data.videoStatus, (value) => {
if (value.status === 'ready' && value.aiStatus === 'ready') { if (value.status === 'ready' && value.aiStatus === 'ready') {
console.log(value, '===================')
startAllVideo() startAllVideo()
} }
}) })
onMounted(() => { onMounted(() => {
initMap() initMap()
// 加载航线 // 加载航线
initTrack(formatTradeList(data.trackList), 'trackLayer', 'route')
initTrack(formatTradeList(data.trackList), 'route')
}) })


/* 初始化地图 */ /* 初始化地图 */
} }


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


function moveFeature(event) { function moveFeature(event) {
/* 计算飞行的百分比 */ /* 计算飞行的百分比 */
emit('update:visible', false) emit('update:visible', false)
} }


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

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

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

<!-- 直播抽屉 --> <!-- 直播抽屉 -->
<LiveDrawer v-if="liveDrawer" v-model:visible="liveDrawer" :data="rowData" /> <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" /> <VerifyDrawer v-model:visible="verifyDrawer" :data="rowData" />



Loading…
Cancel
Save