diff --git a/src/iscs_new/controller.js b/src/iscs_new/controller.js index 0da85f409..7af1a09b4 100644 --- a/src/iscs_new/controller.js +++ b/src/iscs_new/controller.js @@ -197,6 +197,7 @@ export default class Controller extends Eventful { mousemove(e) { const oldX = this._x; const oldY = this._y; + const target = this._target||{} const dx = Math.round(e.offsetX - this._x); const dy = Math.round(e.offsetY - this._y); @@ -218,7 +219,7 @@ export default class Controller extends Eventful { if (this.limitDrag({dx, dy})) { this.trigger(this.events.__Dragging, { dx, dy }); if (this._reflectEnable) { - this.trigger(events.Reflect, {dx, dy}); + this.trigger(events.Reflect, {dx, dy, code: target.code}); } } else { this._x = oldX; diff --git a/src/iscs_new/core/form/elementConst.js b/src/iscs_new/core/form/elementConst.js index 8ab9ba0a9..a546c88c0 100644 --- a/src/iscs_new/core/form/elementConst.js +++ b/src/iscs_new/core/form/elementConst.js @@ -152,7 +152,7 @@ export const elementConst = { rules:[ { required: true, message:'请输入圆角矩形半径', trigger: 'blur' } ], - value: [5, 5, 5, 5], + value: [0, 0, 0, 0], description: '用于创建圆角矩形。左上、右上、右下、左下角的半径依次为 r1、 r2、 r3、 r4。[1, 1, 1, 1]' }] } diff --git a/src/iscs_new/core/form/form2Base.js b/src/iscs_new/core/form/form2Base.js index 70ee4a997..80216eaf6 100644 --- a/src/iscs_new/core/form/form2Base.js +++ b/src/iscs_new/core/form/form2Base.js @@ -30,7 +30,7 @@ export default [ }, { prop: 'sightless', - label: '图形是否不可见', + label: '是否隐藏', type: types.Boolean, rules:[ { required: true, message:'请选择图形是否不可见', trigger: 'blur' } diff --git a/src/iscs_new/core/form/form2ShapeStyle.js b/src/iscs_new/core/form/form2ShapeStyle.js index 8707101f7..0989454dd 100644 --- a/src/iscs_new/core/form/form2ShapeStyle.js +++ b/src/iscs_new/core/form/form2ShapeStyle.js @@ -101,7 +101,7 @@ export default [ }, { prop: 'strokeNoScale', - label: '描边粗细不随缩放而改变', + label: '描边不缩放', type: types.Boolean, value: false, description: '描边粗细不随缩放而改变,不选中时则会根据缩放同比例缩放描边粗细。' diff --git a/src/iscs_new/factory/index.js b/src/iscs_new/factory/index.js index 9dee4e51d..07bed7656 100644 --- a/src/iscs_new/factory/index.js +++ b/src/iscs_new/factory/index.js @@ -56,7 +56,7 @@ function update2List(source, model, action, name='') { i >= 0 && list.splice(i, 1); break; case orders.UPDATE: - Object.assign(list[i]||{}, model) + updateModel = Object.assign(list[i]||{}, model) break; } diff --git a/src/iscs_new/map.js b/src/iscs_new/map.js index 925588ec8..49ea3c234 100644 --- a/src/iscs_new/map.js +++ b/src/iscs_new/map.js @@ -180,6 +180,7 @@ class JMap { if (updateModel) { curShape = this.$shapeFactory.getShapeByCode(updateModel.code); oldShape = this.$shapeFactory.removeShape(curShape); + this.$painter.removeFromLayer(oldShape.type, oldShape.instanceHightLight); this.$painter.remove(oldShape); } }); @@ -188,9 +189,11 @@ class JMap { updateModel = this.isDrawing() ? this.$shapeFactory.updateSource(model, action): model; oldShape = this.$shapeFactory.removeShape(curShape); newShape = this.$shapeFactory.createShape(updateModel, action.shapeType); + this.$painter.removeFromLayer(oldShape.type, oldShape.instanceHightLight); this.$painter.remove(oldShape); this.$shapeFactory.storageShape(newShape) this.$painter.add(newShape); + this.$painter.addToLayer(newShape.type, newShape.instanceHightLight); break; case orders.UNBINDING: oldShape = this.$shapeFactory.removeShape(curShape); diff --git a/src/views/iscs_new/iscsDraw/index.vue b/src/views/iscs_new/iscsDraw/index.vue index a36ef19a9..5bca0e01c 100644 --- a/src/views/iscs_new/iscsDraw/index.vue +++ b/src/views/iscs_new/iscsDraw/index.vue @@ -85,9 +85,13 @@ export default { }, onSelectTab() { }, - onSelected(val) { - if (val) { - this.selected = JSON.parse(JSON.stringify(val)); + onSelected(em) { + if (em.model) { + this.selected = JSON.parse(JSON.stringify(em.model)); + const elem = this.elementList.find(el => el.code == this.selected.type); + if (elem) { + elem.model = this.selected; + } } else { this.selected = null; } diff --git a/src/views/iscs_new/iscsDraw/iscsCanvas.vue b/src/views/iscs_new/iscsDraw/iscsCanvas.vue index ceb6b26a0..b8c3a600d 100644 --- a/src/views/iscs_new/iscsDraw/iscsCanvas.vue +++ b/src/views/iscs_new/iscsDraw/iscsCanvas.vue @@ -96,6 +96,7 @@ export default { this.$iscs.on('viewLoaded', this.onViewLoaded, this); this.$iscs.on('contextmenu', this.onContextMenu, this); this.$iscs.on('selected', this.onSelected, this); + this.$iscs.on('reflect', this.onReflect, this); this.$iscs.on('keyboard', this.onKeyboard, this); window.document.oncontextmenu = function () { return false; @@ -110,8 +111,11 @@ export default { }, // 点击选择事件 onSelected(em={}) { - this.$emit('selected', em.model); + this.$emit('selected', em); }, + onReflect(em={}) { + this.$emit('selected', this.$iscs.getShapeByCode(em.code)); + }, // 右键点击事件 onContextMenu(em={}) { this.$emit('contextMenu', em.model);