| | |
| | | methods: { |
| | | checkCurVideo(index){ |
| | | if(this.relativeVideos[index]){ |
| | | this.curVideo = this.relativeVideos[index] |
| | | this.curVideo = this.relativeVideos[index]; |
| | | this.refreshCurVideoLabel(this.curVideo); |
| | | } |
| | | }, |
| | | getVideos (video) { |
| | | let _this = this; |
| | | getRelatedVideoInfo({ UniqeID: video.UniqeID }).then(res => { |
| | | console.log(res) |
| | | |
| | | res.data.forEach(element => { |
| | | element.marks = _this.mergeMarks(element) |
| | | console.log(element.marks) |
| | |
| | | _this.labelOptions = res.data |
| | | }) |
| | | }, |
| | | refreshCurVideoLabel (video) { |
| | | getRelatedVideoInfo({ UniqeID: video.UniqeID }).then(res => { |
| | | res.data.forEach(d => { |
| | | if(d.ID === video.ID){ |
| | | video.LableLst = d.LableLst |
| | | } |
| | | // let someVideo = _this.videoArrs.find(video => video.ID === d.ID); |
| | | // someVideo.LableLst = d.LableLst |
| | | }) |
| | | }) |
| | | }, |
| | | checkVideo (video, index) { |
| | | this.refreshCurVideoLabel(video); |
| | | this.curVideo = video; |
| | | this.$nextTick(()=>{ |
| | | this.$refs[`player_${this.curVideo.ID}`][0].init(); |
| | | }) |
| | | |
| | | if (index > 0 && this.guid == 1) { |
| | | //this.videoWrapArr = |
| | | } |
| | | }, |
| | | |
| | | setGuid (guid) { |
| | |
| | | // } |
| | | // } |
| | | this.videoWrapArr = Math.pow(guid, 2); |
| | | |
| | | this.$nextTick(() => { |
| | | for (var i = 0; i < Math.pow(guid, 2); i++) { |
| | | this.$refs[`gridVideoItem_${i}`][0].style.width = this.$refs['playerWrap'].offsetWidth / guid + 'px'; |
| | | this.$refs[`gridVideoItem_${i}`][0].style.height = this.$refs['playerWrap'].offsetHeight / guid + 'px'; |
| | | |
| | | } |
| | | }) |
| | | }, |
| | |
| | | ParentID: this.isCheckAllVideo ? tempArr.join(',') : this.curVideo.ID + '', |
| | | Time: Math.round(this.setLabelTime) + '', |
| | | Codes: this.labelCheckedList.join(','), |
| | | Desc: desc.join(',') |
| | | Desc: desc.join(',') |
| | | }; |
| | | editLabel(query).then(rsp => { |
| | | if (rsp && rsp.success) { |
| | | _this.labelDialogVisible = false; |
| | | |
| | | _this.videoArrs.forEach(video=>{ |
| | | video.LableLst = [] |
| | | }); |
| | | this.$set(_this.curVideo,'LableLst',[]); |
| | | //_this.curVideo.LableLst = []; |
| | | rsp.data.forEach(label=>{ |
| | | let someVideo = _this.videoArrs.find(video=>video.ID === label.ParentID); |
| | | someVideo.LableLst.push(label); |
| | | if(label.ParentID == _this.curVideo.ID){ |
| | | _this.curVideo.LableLst.push(label) |
| | | } |
| | | }) |
| | | //_this.curVideo.LableLst = rsp.data; |
| | | this.$message.success("添加成功") |
| | | // getRelatedVideoInfo({ UniqeID: _this.videoDetails.UniqeID }).then(res => { |
| | | // res.data.forEach(d => { |
| | | // let someVideo = _this.videoArrs.find(video => video.ID === d.ID); |
| | | // someVideo.LableLst = d.LableLst |
| | | // }) |
| | | // }) |
| | | |
| | | this.$message.success("添加成功") |
| | | // 标注 |
| | | _this.setMarks(this.curVideo) |
| | | } else { |
| | |
| | | this.labelDialogVisible = true; |
| | | }, |
| | | removeCurLabel (mark) { |
| | | let _this = this; |
| | | delLabel({ ID: mark.ID, ParentID: this.curVideo.ID }).then(rsp => { |
| | | if (rsp && rsp.success) { |
| | | this.curVideo.LableLst = rsp.data; |
| | | _this.curVideo.LableLst = rsp.data; |
| | | this.$message.success("删除成功") |
| | | // 标注 |
| | | this.setMarks(this.curVideo) |
| | | debugger |
| | | _this.setMarks(_this.curVideo) |
| | | } else { |
| | | this.$message.warning(rsp.msg) |
| | | } |