diff --git a/src/jmapNew/mouseController.js b/src/jmapNew/mouseController.js index 2ca7e4804..360f9286f 100644 --- a/src/jmapNew/mouseController.js +++ b/src/jmapNew/mouseController.js @@ -97,23 +97,24 @@ class MouseController extends Eventful { } mousemove(e) { - if (this._dragging) { - const oldX = this._x; - const oldY = this._y; + if (this._dragging) { + const oldX = this._x; + const oldY = this._y; - const dx = e.offsetX - oldX; - const dy = e.offsetY - oldY; + const dx = e.offsetX - oldX; + const dy = e.offsetY - oldY; - this._x = e.offsetX; - this._y = e.offsetY; + this._x = e.offsetX; + this._y = e.offsetY; - if (e.which == 1) { - this._preventDefaultMouseMove && eventTool.stop(e.event); - this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); - } else if (e.which === 3 && this._zoomOnMouseWheel && this._previewOrMapDraw) { - this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY}); - } - } + if (e.which == 1) { + this._preventDefaultMouseMove && eventTool.stop(e.event); + this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); + } else if (e.which === 3 && this._zoomOnMouseWheel && this._previewOrMapDraw) { + this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY}); + this.isMoveRight = true; + } + } } mouseup(e) { @@ -121,10 +122,23 @@ class MouseController extends Eventful { this._dragging = false; } if (this._zoomOnMouseWheel && this.$jmap.mapDevice['check_box'] && this._previewOrMapDraw ) { + console.log(this.isMoveRight, 'mouseup'); this.eventTarget = this.$jmap.mapDevice['check_box'].instance; this.handleBoundingRect(this.eventTarget); - var em = this.checkEvent(e); + let em; + if (!this.isMoveRight) { + em = this.checkEvent(e); + } else { + em = { + clientX:e.offsetX, + clientY:e.offsetY, + eventTarget:this.eventTarget, + deviceCode:'check_box', + deviceType:'CheckBox' + }; + } this.trigger(this.events.Selected, em); + } } @@ -157,8 +171,13 @@ class MouseController extends Eventful { } contextmenu(e) { - var em = this.checkEvent(e); - this.trigger(this.events.Contextmenu, em); + // 判断是否正在右键拖选 若不是则弹出右键菜单 + if (!this.isMoveRight) { + var em = this.checkEvent(e); + this.trigger(this.events.Contextmenu, em); + } else { + this.isMoveRight = false; + } } moveEvent(e) { diff --git a/src/views/newMap/newMapdraft/mapoperate/config/list.vue b/src/views/newMap/newMapdraft/mapoperate/config/list.vue index 48f18b520..f49ad6a5c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/config/list.vue +++ b/src/views/newMap/newMapdraft/mapoperate/config/list.vue @@ -294,6 +294,30 @@ + diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index b64de62cd..1664d54cd 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -196,11 +196,19 @@ export default { } else if (controlLampTypeList.includes(type)) { this.enabledTab = 'ControlLamp'; } else { - this.enabledTab = type; + if (this.$refs['ZcControl'] && this.$refs['ZcControl'][0].field == 'checkZcSection') { + this.enabledTab = 'ZcControl'; + } else { + this.enabledTab = type; + } } }, deviceSelect(type) { + // if (this.$refs['ZcControl'].field != 'checkZcSection') { this.selectDevice = type; + // } else { + // this.selectDevice = 'ZcControl'; + // } }, saveMapEvent() { this.$emit('saveMapEvent'); diff --git a/src/views/newMap/newMapdraft/mapoperate/zcControl.vue b/src/views/newMap/newMapdraft/mapoperate/zcControl.vue index 0bf3f5b50..0f5c7a72f 100644 --- a/src/views/newMap/newMapdraft/mapoperate/zcControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/zcControl.vue @@ -1,5 +1,5 @@