From 765634224f211737244b9f49636ed3413e8ae1c1 Mon Sep 17 00:00:00 2001 From: Ming <739803697@qq.com> Date: Mon, 17 Jul 2023 18:53:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=B2=98=E8=B4=B4=E5=9D=90=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/chartEditStore/chartEditStore.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/store/modules/chartEditStore/chartEditStore.ts b/src/store/modules/chartEditStore/chartEditStore.ts index ec9c3be9..88179263 100644 --- a/src/store/modules/chartEditStore/chartEditStore.ts +++ b/src/store/modules/chartEditStore/chartEditStore.ts @@ -500,8 +500,8 @@ export const useChartEditStore = defineStore({ } const parseHandle = (e: CreateComponentType | CreateComponentGroupType) => { e = cloneDeep(e) - e.attr.x = this.getMousePosition.x + 30 - e.attr.y = this.getMousePosition.y + 30 + e.attr.x = this.getMousePosition.startX + e.attr.y = this.getMousePosition.startY // 外层生成新 id e.id = getUUID() // 分组列表生成新 id @@ -510,11 +510,11 @@ export const useChartEditStore = defineStore({ item.id = getUUID() }) } - + return e } const isCut = recordCharts.type === HistoryActionTypeEnum.CUT - const targetList = Array.isArray(recordCharts.charts) ? recordCharts.charts : [ recordCharts.charts ] + const targetList = Array.isArray(recordCharts.charts) ? recordCharts.charts : [recordCharts.charts] // 多项 targetList.forEach((e: CreateComponentType | CreateComponentGroupType) => { this.addComponentList(parseHandle(e), undefined, true)