Merge remote-tracking branch 'origin/dev' into test

This commit is contained in:
fan 2019-09-06 18:46:54 +08:00
commit 6472afe009
5 changed files with 15 additions and 20 deletions

3
.gitignore vendored
View File

@ -6,8 +6,7 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
package-lock.json package-lock.json
tests/**/coverage/ tests/**/coverage/
/src/utils/baseUrl.js src/utils/baseUrl.js
/src/utils/
# Editor directories and files # Editor directories and files
.idea .idea

View File

@ -152,14 +152,13 @@ class IbpPan {
updateIbpData(elem); updateIbpData(elem);
const oDevice = this.ibpDevice[code] || deviceFactory(type, elem); const oDevice = this.ibpDevice[code] || deviceFactory(type, elem);
const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, elem)); const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, elem));
delete this.mapDevice[code]; delete this.ibpDevice[code];
this.$painter.delete(oDevice); this.$painter.delete(oDevice);
if (!elem._dispose) { if (!elem._dispose) {
this.ibpDevice[code] = nDevice; this.ibpDevice[code] = nDevice;
this.$painter.add(nDevice); this.$painter.add(nDevice);
} }
}); });
if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); } if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); }
} }

View File

@ -28,7 +28,6 @@ class MouseController extends Eventful {
this.$zr = ibp.getZr(); this.$zr = ibp.getZr();
this.isAllowDragging=ibp.isAllowDragging||false; this.isAllowDragging=ibp.isAllowDragging||false;
this.events = ibp.getEvents(); this.events = ibp.getEvents();
this._draggingTarget=null;
this._dragging = false; this._dragging = false;
this.initHandler(this.$zr); this.initHandler(this.$zr);
} }
@ -94,7 +93,7 @@ class MouseController extends Eventful {
} }
const em = new EventModel(e); const em = new EventModel(e);
this.eventTarget = em.eventTarget; this.eventTarget = em.eventTarget;
if (this.eventTarget._type === deviceType.Background) { if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
this.eventTarget.setCursor('pointer'); this.eventTarget.setCursor('pointer');
} }
this._offsetX=e.offsetX; this._offsetX=e.offsetX;
@ -121,7 +120,7 @@ class MouseController extends Eventful {
this._x = e.offsetX; this._x = e.offsetX;
this._y = e.offsetY; this._y = e.offsetY;
if (this._dragging) { 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._preventDefaultMouseMove && eventTool.stop(e.event);
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
return true; return true;
@ -135,12 +134,12 @@ class MouseController extends Eventful {
} }
mouseup(e) { 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.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
this.eventTarget.dirty(); this.eventTarget.dirty();
this.eventTarget = ''; this.eventTarget = '';
} }
if (this.eventTarget._type === deviceType.Background) { if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
this.eventTarget.setCursor('default'); this.eventTarget.setCursor('default');
} }
this._dragging = false; this._dragging = false;
@ -165,7 +164,7 @@ class MouseController extends Eventful {
scale = -1; scale = -1;
} }
this.trigger(this.events.__Zoom, {type: 'zoom', scale, originX, originY }); this.trigger(this.events.__Zoom, {type: this.events.__Zoom, scale, originX, originY });
} }
} }
@ -222,10 +221,6 @@ class MouseController extends Eventful {
return newEm; return newEm;
} }
updateDatazoom(zoom) {
this.trigger(this.events.Datazoom, zoom);
}
} }
export default MouseController; export default MouseController;

View File

@ -135,7 +135,7 @@ class MouseController extends Eventful {
scale = -1; scale = -1;
} }
this.trigger(this.events.__Zoom, {type: 'zoom', scale, originX, originY }); this.trigger(this.events.__Zoom, {type: this.events.__Zoom, scale, originX, originY });
} }
} }
@ -192,10 +192,6 @@ class MouseController extends Eventful {
return newEm; return newEm;
} }
updateDatazoom(zoom) {
this.trigger(this.events.Datazoom, zoom);
}
} }
export default MouseController; export default MouseController;

View File

@ -41,7 +41,13 @@
}, },
watch: { 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() { mounted() {
}, },