接口代码

This commit is contained in:
fan 2021-07-20 11:19:11 +08:00
parent 90a539c4b7
commit c9ce398e4c
2 changed files with 5 additions and 7 deletions

View File

@ -18,7 +18,7 @@
},
"dependencies": {
"axios": "^0.21.1",
"bjjl-engine-2d": "^1.0.19",
"bjjl-engine-2d": "^1.0.20",
"echarts": "^4.7.0",
"element-ui": "^2.12.0",
"file-saver": "^1.3.3",

View File

@ -34,7 +34,7 @@ export default {
modelList: []
};
},
async created() {
async mounted() {
const res = await getCircuitryDraftDataById(this.$route.params.id);
const resp = await getModelListUnpage();
this.modelList = resp.data;
@ -45,16 +45,14 @@ export default {
const compose = this.modelList.find(elem => elem.code === item);
this.composeMap[item] = compose;
});
this.$refs.jlPictureBuilder.setMap(this.model, this.composeMap);
}
},
mounted() {
},
methods: {
test() {
this.$refs.jlPictureBuilder.update([]);
},
save(model) {
console.log(JSON.stringify(model));
const data = {
id: this.$route.params.id,
drawData: JSON.stringify({ model:this.model, compose: Object.keys(this.composeMap) })
@ -76,7 +74,7 @@ export default {
name: model.name,
rotation: 0,
scale: [1, 1],
shapeList: this.composeMap[model.code].shapeList
shapeList: JSON.parse(this.composeMap[model.code].jsonData).shapeList
};
this.model.push(addModel);
this.$refs.jlPictureBuilder.update([{model: addModel, action:{order:'&Add', shapeType: 'Compose'}}]);
@ -89,7 +87,7 @@ export default {
name: model.name,
rotation: model.rotation,
scale: model.scale,
shapeList: this.composeMap[model.type].shapeList
shapeList: JSON.parse(this.composeMap[model.type].jsonData).shapeList
};
const index = this.model.findIndex(item => item.code === model.code);
this.model.splice(index, 1, updateModel);