fix: 修改导入id重复的问题

This commit is contained in:
奔跑的面条 2022-05-25 23:04:39 +08:00
parent 2460fe4e86
commit 15fc418fc4

View File

@ -6,7 +6,7 @@ import { CreateComponentType } from '@/packages/index.d'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { ChartEditStoreEnum } from '@/store/modules/chartEditStore/chartEditStore.d'
import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore'
import { readFile, goDialog } from '@/utils'
import { getUUID, readFile, goDialog } from '@/utils'
import { createComponent } from '@/packages'
// 更新函数
@ -40,7 +40,7 @@ const updateComponent = async (fileData: any, isSplace = false) => {
)
// 不保存到记录
chartEditStore.addComponentList(
Object.assign(newComponent, comItem),
Object.assign(newComponent, { ...comItem, id: getUUID() }),
false,
true
)