This commit is contained in:
fan 2021-08-02 11:00:42 +08:00
parent ce6512ef83
commit 1d72d29dff

View File

@ -74,11 +74,31 @@ export default {
name: model.name,
rotation: 0,
scale: [1, 1],
shapeList: JSON.parse(this.composeMap[model.code].jsonData).shapeList
shapeList: this.composeMap[model.code].shapeList
};
this.model.push(addModel);
this.$refs.jlPictureBuilder.update([{model: addModel, action:{order:'&Add', shapeType: 'Compose'}}]);
},
// addModel(model) {
// this.addModelData = model;
// this.$refs.jlPictureBuilder.addingModel();
// },
// selectPoint(point) {
// if (!this.composeMap[this.addModelData.code]) {
// this.composeMap[this.addModelData.code] = JSON.parse(this.addModelData.jsonData);
// }
// const addModel = {
// code: this.getUID(this.addModelData.code),
// position: [point.x, point.y],
// type: this.addModelData.code,
// name: this.addModelData.name,
// rotation: 0,
// scale: [1, 1],
// shapeList: this.composeMap[model.code].shapeList
// };
// this.model.push(addModel);
// this.$refs.jlPictureBuilder.update([{model: addModel, action:{order:'&Add', shapeType: 'Compose'}}]);
// },
updateCompose(model) {
const updateModel = {
code: model.code,
@ -87,7 +107,7 @@ export default {
name: model.name,
rotation: model.rotation,
scale: model.scale,
shapeList: JSON.parse(this.composeMap[model.type].jsonData).shapeList
shapeList: this.composeMap[model.code].shapeList
};
const index = this.model.findIndex(item => item.code === model.code);
this.model.splice(index, 1, updateModel);