hanbaoshan
2020-12-04 46183ba8c63b38ea3671e7923edc7ec2fd34a6c3
src/components/canvas/Dialog.vue
@@ -218,7 +218,8 @@
    cancel() {
      this.changeType('0')
      this.undisabled()
      this.delCursor = {}
      //this.delCursor = {}
      this.delCursor = { type: -1, index: -1, remarksName: "", id: "" };
      this.canvasHistory.length = 0;
      this.step = -1;
      this.canvasData = JSON.parse(JSON.stringify(this.canvasDataToChild));
@@ -393,6 +394,7 @@
    },
    // 删除元素
    del() {
      debugger
      let delEle = {};
      switch (this.delCursor.type) {
        case "1":
@@ -409,7 +411,7 @@
          break;
        case "5":
          delEle = this.canvasData.polygon[this.delCursor.index];
          this.canvasData.polygon.splice(this.delCursor.index, 1);
          this.canvasData.polygon.splice(this.delCursor.index+1, 1);
          break;
      }
      this.clickSelect();
@@ -852,6 +854,7 @@
      width = typeof width !== "undefined" ? width : 1;
      // color = typeof color !== 'undefined' ? color : 'yellow'
      // 计算各角度和对应的P2,P3坐标
      debugger
      let angle = (Math.atan2(fromY - toY, fromX - toX) * 180) / Math.PI;
      let angle1 = ((angle + theta) * Math.PI) / 180;
      let angle2 = ((angle - theta) * Math.PI) / 180;
@@ -1269,7 +1272,10 @@
      this.lineIndex = this.canvasData.line.length;
      this.rectIndex = this.canvasData.rect.length;
      this.arrowIndex = this.canvasData.arrow.length;
      this.polygonIndex = this.canvasData.polygon.length;
      //排除this.canvasData.polygon全部区域(全部区域的id就是摄像机的id)
      let filterPolygonArr = this.canvasData.polygon.filter(item=>item.id != this.TreeDataPool.selectedNode.id)
      this.polygonIndex = filterPolygonArr.length;
    },
    // 生成uuid
    getUuid() {