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

This commit is contained in:
奔跑的面条 2022-05-25 23:00:36 +08:00
parent b861587f01
commit fb2edeb7d2

View File

@ -1,5 +1,5 @@
import { onUnmounted } from 'vue';
import { httpErrorHandle, fetchRouteParamsByhistory } from '@/utils'
import { getUUID, httpErrorHandle, fetchRouteParamsByhistory } from '@/utils'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { EditCanvasTypeEnum, ChartEditStoreEnum } from '@/store/modules/chartEditStore/chartEditStore.d'
import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore'
@ -52,7 +52,7 @@ export const useSync = () => {
)
// 不保存到记录
chartEditStore.addComponentList(
Object.assign(newComponent, comItem),
Object.assign(newComponent, {...comItem, id: getUUID()}),
false,
true
)