diff --git a/src/ibp/ibpPan.js b/src/ibp/ibpPan.js index 47cde4ac2..8aa714191 100644 --- a/src/ibp/ibpPan.js +++ b/src/ibp/ibpPan.js @@ -152,14 +152,13 @@ class IbpPan { updateIbpData(elem); const oDevice = this.ibpDevice[code] || deviceFactory(type, elem); const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, elem)); - delete this.mapDevice[code]; + delete this.ibpDevice[code]; this.$painter.delete(oDevice); if (!elem._dispose) { this.ibpDevice[code] = nDevice; this.$painter.add(nDevice); } }); - if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); } } diff --git a/src/ibp/mouseController.js b/src/ibp/mouseController.js index 581f6ccfb..39801a24b 100644 --- a/src/ibp/mouseController.js +++ b/src/ibp/mouseController.js @@ -28,7 +28,6 @@ class MouseController extends Eventful { this.$zr = ibp.getZr(); this.isAllowDragging=ibp.isAllowDragging||false; this.events = ibp.getEvents(); - this._draggingTarget=null; this._dragging = false; this.initHandler(this.$zr); } @@ -94,7 +93,7 @@ class MouseController extends Eventful { } const em = new EventModel(e); this.eventTarget = em.eventTarget; - if (this.eventTarget._type === deviceType.Background) { + if (this.eventTarget && this.eventTarget._type === deviceType.Background) { this.eventTarget.setCursor('pointer'); } this._offsetX=e.offsetX; @@ -121,7 +120,7 @@ class MouseController extends Eventful { this._x = e.offsetX; this._y = e.offsetY; if (this._dragging) { - if (this.eventTarget._type === deviceType.Background || !this.isAllowDragging) { + if ((this.eventTarget && this.eventTarget._type === deviceType.Background) || !this.isAllowDragging) { this._preventDefaultMouseMove && eventTool.stop(e.event); this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); return true; @@ -135,12 +134,12 @@ class MouseController extends Eventful { } mouseup(e) { - if (!eventTool.notLeftMouse(e)&&this.isAllowDragging) { + if (!eventTool.notLeftMouse(e)&&this.isAllowDragging && this.eventTarget) { this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY); this.eventTarget.dirty(); this.eventTarget = ''; } - if (this.eventTarget._type === deviceType.Background) { + if (this.eventTarget && this.eventTarget._type === deviceType.Background) { this.eventTarget.setCursor('default'); } this._dragging = false; diff --git a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpBg.vue b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpBg.vue index 7f5be58bc..024d06f76 100644 --- a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpBg.vue +++ b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpBg.vue @@ -41,7 +41,13 @@ }, watch: { - + '$store.state.ibp.rightClickCount': function (val) { + const model = this.$store.getters['ibp/updateDeviceData']; + if (model._type === 'Background' ){ + this.form.bgWidth = model.width; + this.form.bgHeight = model.height; + } + } }, mounted() { },