修改代码
This commit is contained in:
parent
1fb3c04c37
commit
cfed96504b
@ -326,6 +326,7 @@ export default class Controller extends Eventful {
|
||||
clear() {
|
||||
this.storage.clear();
|
||||
this.storage.clearClipboard();
|
||||
this._target = null;
|
||||
this._pan = false;
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
// 修改属性
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user