!102 fix:修复状态变更时(如切换语言等),useSync.hook.ts 中 dataSyncFetch 反复执行导致 chartEditStore.componentList 重复

Merge pull request !102 from fankeke007/N/A
This commit is contained in:
奔跑的面条 2022-11-22 11:18:28 +00:00 committed by Gitee
commit 8230757bd1

View File

@ -224,6 +224,9 @@ export const useSync = () => {
// * 数据获取 // * 数据获取
const dataSyncFetch = async () => { const dataSyncFetch = async () => {
// FIX:重新执行dataSyncFetch需清空chartEditStore.componentList,否则会导致图层重复
// 切换语言等操作会导致重新执行 dataSyncFetch,此时pinia中并未清空chartEditStore.componentList导致图层重复
chartEditStore.componentList = []
chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.START) chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.START)
try { try {
const res = await fetchProjectApi({ projectId: fetchRouteParamsLocation() }) as unknown as MyResponseType const res = await fetchProjectApi({ projectId: fetchRouteParamsLocation() }) as unknown as MyResponseType