From 333158160c33ecaf16a74534bd87ab3ec0c88ecf Mon Sep 17 00:00:00 2001 From: hanbaoshan <hanbaoshan@aiotlink.com> Date: 星期一, 25 一月 2021 18:36:09 +0800 Subject: [PATCH] 朔黄视频播放栅格添加点击事件,修复aliplayer组件标注点污染的问题 --- src/pages/shuohuangMonitorAnalyze/components/videoAnalyze.vue | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/pages/shuohuangMonitorAnalyze/components/videoAnalyze.vue b/src/pages/shuohuangMonitorAnalyze/components/videoAnalyze.vue index 33cca4f..f4955fe 100644 --- a/src/pages/shuohuangMonitorAnalyze/components/videoAnalyze.vue +++ b/src/pages/shuohuangMonitorAnalyze/components/videoAnalyze.vue @@ -58,6 +58,7 @@ :ref="`gridVideoItem_${index}`" v-for="(item,index) in videoWrapArr" :key="index" + @click="checkCurVideo(index)" > <template v-if="index<=videoArrs.length-1"> <div :class="{'currentPlayer':curVideo.ID==videoArrs[index].ID}"> @@ -221,11 +222,17 @@ }, }, mounted () { + console.log('analyze mount') this.renderLabelOpts(); this.setGuid(1); this.getVideos(this.videoDetails); }, methods: { + checkCurVideo(index){ + if(this.relativeVideos[index]){ + this.curVideo = this.relativeVideos[index] + } + }, getVideos (video) { let _this = this; getRelatedVideoInfo({ UniqeID: video.UniqeID }).then(res => { @@ -238,8 +245,10 @@ _this.curVideo = res.data[0]; _this.videoArrs = res.data; _this.relativeVideos = res.data; - debugger - + this.$nextTick(()=>{ + _this.$refs[`player_${_this.curVideo.ID}`][0].init(); + }) + }) }, renderLabelOpts () { @@ -250,6 +259,10 @@ }, checkVideo (video, index) { this.curVideo = video; + this.$nextTick(()=>{ + this.$refs[`player_${this.curVideo.ID}`][0].init(); + }) + if (index > 0 && this.guid == 1) { //this.videoWrapArr = } @@ -311,7 +324,7 @@ let someVideo = _this.videoArrs.find(video=>video.ID === label.ParentID); someVideo.LableLst.push(label); }) - _this.curVideo.LableLst = rsp.data; + //_this.curVideo.LableLst = rsp.data; this.$message.success("娣诲姞鎴愬姛") // 鏍囨敞 -- Gitblit v1.8.0