| | |
| | | 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)); |
| | |
| | | }, |
| | | // 删除元素 |
| | | del() { |
| | | debugger |
| | | let delEle = {}; |
| | | switch (this.delCursor.type) { |
| | | case "1": |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | 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() { |