hanbaoshan
2021-01-28 262119fd58357f1d930d65a6e3252176d29b2ce5
src/pages/shuohuangMonitorAnalyze/components/videoAnalyze.vue
@@ -230,14 +230,14 @@
  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)
@@ -257,15 +257,24 @@
        _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) {
@@ -279,12 +288,10 @@
      //     }
      // }
      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';
        }
      })
    },
@@ -311,22 +318,26 @@
        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 {
@@ -348,12 +359,14 @@
      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)
        }