This commit is contained in:
zyy 2020-02-06 13:17:40 +08:00
commit f219fe98bd
3 changed files with 15 additions and 2 deletions

View File

@ -17,6 +17,10 @@ export default class BrakeMachine extends Group {
position: [this.model.point.x, this.model.point.y]
});
this.path = createPathSvg(this.model);
if (this.model.isRight) {
this.grouper.origin = [this.model.width / 2, this.model.width / 2 ];
this.grouper.rotation = Math.PI;
}
this.add(this.grouper);
this.grouper.add(this.path);
}

View File

@ -7,6 +7,9 @@
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="addModel.width" />
</el-form-item>
<el-form-item label="闸机朝右" prop="isRight">
<el-checkbox v-model="addModel.isRight" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="addModel.x" />
</el-form-item>
@ -33,7 +36,8 @@ export default {
code: '',
width: 25,
x: 10,
y: 10
y: 10,
isRight:false
},
rules: {
width:[{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }],
@ -61,6 +65,7 @@ export default {
this.addModel.width = model.width;
this.addModel.x = model.point.x;
this.addModel.y = model.point.y;
this.addModel.isRight = model.isRight;
}
}
},
@ -73,6 +78,7 @@ export default {
x: this.addModel.x,
y: this.addModel.y
},
isRight: this.addModel.isRight,
code: this.isUpdate ? this.form.code : getUID('BrakeMachine', this.iscs.brakeMachineList),
_type: 'BrakeMachine',
width: this.addModel.width
@ -91,6 +97,7 @@ export default {
y: this.addModel.y
},
code: this.addModel.code,
isRight: this.addModel.isRight,
_type: 'BrakeMachine',
width: this.addModel.width
};
@ -105,7 +112,8 @@ export default {
code: '',
width: 25,
x: 10,
y: 10
y: 10,
isRight:false
};
}
}

View File

@ -64,6 +64,7 @@ export default {
this.addModel.height = model.height;
this.addModel.x = model.point.x;
this.addModel.y = model.point.y;
this.addModel.right = model.right;
}
}
},