|
@@ -51,9 +51,9 @@ export default {
|
|
|
point: {}, //右侧列表传来的位置标签
|
|
|
canvasLoading: false, //loading
|
|
|
markItem: null, // 当前选中的标签item
|
|
|
- config:{
|
|
|
-
|
|
|
- }
|
|
|
+ config: {
|
|
|
+ isEdit: false
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -103,7 +103,9 @@ export default {
|
|
|
that.view.maxScale = that.view.scale * 10;
|
|
|
that.view.minScale = that.view.scale;
|
|
|
// that.view.minScale = 0.000001;
|
|
|
- that.$refs.canvasFun.everyScale = that.view.scale;
|
|
|
+ if (that.$refs.canvasFun) {
|
|
|
+ that.$refs.canvasFun.everyScale = that.view.scale;
|
|
|
+ }
|
|
|
this.disableRightButton();
|
|
|
})
|
|
|
},
|
|
@@ -161,9 +163,22 @@ export default {
|
|
|
},
|
|
|
//点击按钮
|
|
|
addPoint(point) {
|
|
|
- this.point = point;
|
|
|
- this.view.canvasView.style.cursor = `url(${this.imageUrl}) 14 33,auto`;
|
|
|
- this.setFlag = true
|
|
|
+
|
|
|
+ if (this.point.Id != point.Id) {
|
|
|
+ console.log(point)
|
|
|
+ this.point = point;
|
|
|
+ this.view.canvasView.style.cursor = `url(${this.imageUrl}) 14 33,auto`;
|
|
|
+ this.setFlag = true
|
|
|
+ }
|
|
|
+ else {//再次点击取消插旗
|
|
|
+ this.cancelSetFlag();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //取消插旗状态
|
|
|
+ cancelSetFlag() {
|
|
|
+ this.point = {};
|
|
|
+ this.view.canvasView.style.cursor = `Default`;
|
|
|
+ this.setFlag = false;
|
|
|
},
|
|
|
//右键菜单
|
|
|
showRightClick(e) {
|
|
@@ -174,6 +189,7 @@ export default {
|
|
|
},
|
|
|
//插旗 item - 点击的空间item
|
|
|
spaceClick(item, event) {
|
|
|
+ console.log("click sapce")
|
|
|
this.menuShow = false;
|
|
|
if (this.setFlag) {
|
|
|
this.scene.addMarker({
|
|
@@ -183,16 +199,16 @@ export default {
|
|
|
Y: event[0].y
|
|
|
})
|
|
|
this.scene.markerClick(this, this.markClick);
|
|
|
- this.view.canvasView.style.cursor = `default`;
|
|
|
-
|
|
|
this.point.X = event[0].x
|
|
|
this.point.Y = -event[0].y
|
|
|
this.updatePoint('setFlag')
|
|
|
+ this.cancelSetFlag()
|
|
|
}
|
|
|
this.setFlag = false
|
|
|
},
|
|
|
//标签点击事件(包含左键,右键)
|
|
|
markClick(item, event) {
|
|
|
+ console.log("click mark")
|
|
|
if (event[0].type == 'contextmenu') {
|
|
|
this.markItem = item;
|
|
|
this.point = item.data;
|
|
@@ -280,7 +296,7 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
let scale = this.view.scale;
|
|
|
- // this.view.scaleByPoint(val / scale, this.cadWidth / 2, this.cadHeight / 2)
|
|
|
+ this.view.scaleByPoint(val / scale, this.canvasW / 2, this.canvasH / 2)
|
|
|
},
|
|
|
},
|
|
|
watch: {
|