From 1d72d29dffaec4a6bf287080198b63eca746b182 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 2 Aug 2021 11:00:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newDraw/edit.vue | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/views/newDraw/edit.vue b/src/views/newDraw/edit.vue index eee974267..11752620e 100644 --- a/src/views/newDraw/edit.vue +++ b/src/views/newDraw/edit.vue @@ -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);