|
@@ -51,9 +51,9 @@ export default {
|
|
point: {}, //右侧列表传来的位置标签
|
|
point: {}, //右侧列表传来的位置标签
|
|
canvasLoading: false, //loading
|
|
canvasLoading: false, //loading
|
|
markItem: null, // 当前选中的标签item
|
|
markItem: null, // 当前选中的标签item
|
|
- config:{
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ config: {
|
|
|
|
+ isEdit: false
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -103,7 +103,9 @@ export default {
|
|
that.view.maxScale = that.view.scale * 10;
|
|
that.view.maxScale = that.view.scale * 10;
|
|
that.view.minScale = that.view.scale;
|
|
that.view.minScale = that.view.scale;
|
|
// that.view.minScale = 0.000001;
|
|
// 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();
|
|
this.disableRightButton();
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -161,9 +163,22 @@ export default {
|
|
},
|
|
},
|
|
//点击按钮
|
|
//点击按钮
|
|
addPoint(point) {
|
|
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) {
|
|
showRightClick(e) {
|
|
@@ -174,6 +189,7 @@ export default {
|
|
},
|
|
},
|
|
//插旗 item - 点击的空间item
|
|
//插旗 item - 点击的空间item
|
|
spaceClick(item, event) {
|
|
spaceClick(item, event) {
|
|
|
|
+ console.log("click sapce")
|
|
this.menuShow = false;
|
|
this.menuShow = false;
|
|
if (this.setFlag) {
|
|
if (this.setFlag) {
|
|
this.scene.addMarker({
|
|
this.scene.addMarker({
|
|
@@ -183,16 +199,16 @@ export default {
|
|
Y: event[0].y
|
|
Y: event[0].y
|
|
})
|
|
})
|
|
this.scene.markerClick(this, this.markClick);
|
|
this.scene.markerClick(this, this.markClick);
|
|
- this.view.canvasView.style.cursor = `default`;
|
|
|
|
-
|
|
|
|
this.point.X = event[0].x
|
|
this.point.X = event[0].x
|
|
this.point.Y = -event[0].y
|
|
this.point.Y = -event[0].y
|
|
this.updatePoint('setFlag')
|
|
this.updatePoint('setFlag')
|
|
|
|
+ this.cancelSetFlag()
|
|
}
|
|
}
|
|
this.setFlag = false
|
|
this.setFlag = false
|
|
},
|
|
},
|
|
//标签点击事件(包含左键,右键)
|
|
//标签点击事件(包含左键,右键)
|
|
markClick(item, event) {
|
|
markClick(item, event) {
|
|
|
|
+ console.log("click mark")
|
|
if (event[0].type == 'contextmenu') {
|
|
if (event[0].type == 'contextmenu') {
|
|
this.markItem = item;
|
|
this.markItem = item;
|
|
this.point = item.data;
|
|
this.point = item.data;
|
|
@@ -280,7 +296,7 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
let scale = this.view.scale;
|
|
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: {
|
|
watch: {
|