diff --git a/src/iscs_new/controller.js b/src/iscs_new/controller.js index 7af1a09b4..35ea580e6 100644 --- a/src/iscs_new/controller.js +++ b/src/iscs_new/controller.js @@ -326,6 +326,7 @@ export default class Controller extends Eventful { clear() { this.storage.clear(); this.storage.clearClipboard(); + this._target = null; this._pan = false; } diff --git a/src/iscs_new/core/abstractShape.js b/src/iscs_new/core/abstractShape.js index c97c31ef9..5aaada06d 100644 --- a/src/iscs_new/core/abstractShape.js +++ b/src/iscs_new/core/abstractShape.js @@ -44,7 +44,6 @@ class AbstractShape extends Group { this.model.base.position[1] = this.model.base.position[1] + dy; this.instance.origin = utils.createOrigin(this.instance); this.instance.transform = utils.createTransform({scale: this.model.base.scale, position: this.model.base.position, rotation: this.model.base.rotation*Math.PI/180}); - this.dirty(); } // 修改属性 diff --git a/src/iscs_new/core/form/form2Base.js b/src/iscs_new/core/form/form2Base.js index 80216eaf6..3a4ac96ce 100644 --- a/src/iscs_new/core/form/form2Base.js +++ b/src/iscs_new/core/form/form2Base.js @@ -1,7 +1,18 @@ import types from './types'; export default [ - { prop: 'z1', + { + prop: 'name', + label: '名称', + type: types.String, + rules:[ + { required: true, message:'请输入名称', trigger: 'blur' } + ], + value: '<名称>', + description: '控制图形的前后顺序。' + }, + { + prop: 'z1', label: '层级z1', type: types.Number, precision: 0, diff --git a/src/iscs_new/map.js b/src/iscs_new/map.js index 49ea3c234..6bac2816b 100644 --- a/src/iscs_new/map.js +++ b/src/iscs_new/map.js @@ -166,6 +166,7 @@ class JMap { let newShape = null; if (updateModel) { + this.$controller.clear() switch(action.order) { case orders.BINDING: case orders.ADD: @@ -190,13 +191,14 @@ class JMap { oldShape = this.$shapeFactory.removeShape(curShape); newShape = this.$shapeFactory.createShape(updateModel, action.shapeType); this.$painter.removeFromLayer(oldShape.type, oldShape.instanceHightLight); + this.$painter.removeFromLayer(oldShape.type, newShape.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); + this.$painter.removeFromLayer(oldShape.type, oldShape.instanceHightLight); this.$painter.remove(oldShape); break; } diff --git a/src/views/iscs_new/iscsDraw/index.vue b/src/views/iscs_new/iscsDraw/index.vue index ea17bd7b9..02e78b02f 100644 --- a/src/views/iscs_new/iscsDraw/index.vue +++ b/src/views/iscs_new/iscsDraw/index.vue @@ -84,6 +84,7 @@ export default { onSave(data) { }, onSelectTab() { + this.selected = null; }, onSelected(em) { if (em.model) { @@ -104,6 +105,7 @@ export default { newModel.type = this.enabledTab; newModel.code = utils.getUID(this.enabledTab); this.$refs.iscsCanvas.doAction([{model: newModel, action: {shapeType: shapeType.Element, order: orders.ADD}}]); + this.clear(this.enabledTab); } }); }, @@ -114,6 +116,7 @@ export default { model.code = this.selected.code; model.type = this.selected.type; this.$refs.iscsCanvas.doAction([{model, action: {shapeType: shapeType.Element, order: orders.UPDATE}}]); + this.clear(this.enabledTab); } }); }, @@ -124,11 +127,14 @@ export default { model.code = this.selected.code; model.type = this.selected.type; this.$refs.iscsCanvas.doAction([{model, action: {shapeType: shapeType.Element, order: orders.DELETE}}]); - this.$refs['dataform' + this.enabledTab][0].init(); - this.selected = null; + this.clear(this.enabledTab); } }); - } + }, + clear(enabledTab) { + this.$refs['dataform' + enabledTab][0].init(); + this.selected = null; + } } };