mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-25 00:33:00 +08:00
fix: 修改导入id重复的问题
This commit is contained in:
parent
2460fe4e86
commit
15fc418fc4
@ -6,7 +6,7 @@ import { CreateComponentType } from '@/packages/index.d'
|
|||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||||
import { ChartEditStoreEnum } from '@/store/modules/chartEditStore/chartEditStore.d'
|
import { ChartEditStoreEnum } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||||
import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore'
|
import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore'
|
||||||
import { readFile, goDialog } from '@/utils'
|
import { getUUID, readFile, goDialog } from '@/utils'
|
||||||
import { createComponent } from '@/packages'
|
import { createComponent } from '@/packages'
|
||||||
|
|
||||||
// 更新函数
|
// 更新函数
|
||||||
@ -40,14 +40,14 @@ const updateComponent = async (fileData: any, isSplace = false) => {
|
|||||||
)
|
)
|
||||||
// 不保存到记录
|
// 不保存到记录
|
||||||
chartEditStore.addComponentList(
|
chartEditStore.addComponentList(
|
||||||
Object.assign(newComponent, comItem),
|
Object.assign(newComponent, { ...comItem, id: getUUID() }),
|
||||||
false,
|
false,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 非组件(顺便排除脏数据)
|
// 非组件(顺便排除脏数据)
|
||||||
if(key !== 'editCanvasConfig' && key !== 'requestGlobalConfig') return
|
if (key !== 'editCanvasConfig' && key !== 'requestGlobalConfig') return
|
||||||
Object.assign((chartEditStore as any)[key], fileData[key])
|
Object.assign((chartEditStore as any)[key], fileData[key])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user