Showing
4 changed files
with
23 additions
and
20 deletions
| @@ -251,10 +251,8 @@ export const useSync = () => { | @@ -251,10 +251,8 @@ export const useSync = () => { | ||
| 251 | updateStoreInfo(res) | 251 | updateStoreInfo(res) |
| 252 | // 更新全局数据 | 252 | // 更新全局数据 |
| 253 | await updateComponent(JSONParse(res.dataViewContent.content)) | 253 | await updateComponent(JSONParse(res.dataViewContent.content)) |
| 254 | - return | ||
| 255 | - // else { | ||
| 256 | - // chartEditStore.setProjectInfo(ProjectInfoEnum.PROJECT_ID, fetchRouteParamsLocation()) | ||
| 257 | - // } | 254 | + |
| 255 | + chartEditStore.setProjectInfo(ProjectInfoEnum.PROJECT_ID, res.dataViewId) | ||
| 258 | setTimeout(() => { | 256 | setTimeout(() => { |
| 259 | chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.SUCCESS) | 257 | chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.SUCCESS) |
| 260 | }, 1000) | 258 | }, 1000) |
| @@ -322,9 +320,10 @@ export const useSync = () => { | @@ -322,9 +320,10 @@ export const useSync = () => { | ||
| 322 | content: JSONStringify(chartEditStore.getStorageInfo || {}) | 320 | content: JSONStringify(chartEditStore.getStorageInfo || {}) |
| 323 | }, | 321 | }, |
| 324 | dataViewName, | 322 | dataViewName, |
| 325 | - dataViewId: projectId | 323 | + dataViewId: projectId, |
| 324 | + projectId | ||
| 326 | } | 325 | } |
| 327 | - const res = await contentUpdateApi(saveContent) | 326 | + await contentUpdateApi(saveContent) |
| 328 | window['$message'].success('保存成功!') | 327 | window['$message'].success('保存成功!') |
| 329 | // 成功状态 | 328 | // 成功状态 |
| 330 | setTimeout(() => { | 329 | setTimeout(() => { |
| 1 | import { ChartEditStorage } from '@/store/modules/chartEditStore/chartEditStore.d' | 1 | import { ChartEditStorage } from '@/store/modules/chartEditStore/chartEditStore.d' |
| 2 | 2 | ||
| 3 | export interface ChartEditStorageType extends ChartEditStorage { | 3 | export interface ChartEditStorageType extends ChartEditStorage { |
| 4 | + // THINGS_KIT | ||
| 4 | id: string | 5 | id: string |
| 5 | -} | ||
| 6 | + isRelease?: boolean | ||
| 7 | +} |
| @@ -43,13 +43,12 @@ import type { ChartEditStorageType } from './index.d' | @@ -43,13 +43,12 @@ import type { ChartEditStorageType } from './index.d' | ||
| 43 | const storageList: ChartEditStorageType[] = getSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST) | 43 | const storageList: ChartEditStorageType[] = getSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST) |
| 44 | // THINGS_KIT | 44 | // THINGS_KIT |
| 45 | const localStorageInfo = (await getSessionStorageInfo()) as unknown as ChartEditStorageType | 45 | const localStorageInfo = (await getSessionStorageInfo()) as unknown as ChartEditStorageType |
| 46 | -console.log(localStorageInfo) | ||
| 47 | setTitle(`预览-${localStorageInfo?.projectName}`) | 46 | setTitle(`预览-${localStorageInfo?.projectName}`) |
| 48 | // THINGS_KIT | 47 | // THINGS_KIT |
| 49 | // @ts-ignore | 48 | // @ts-ignore |
| 50 | -if (localStorageInfo.isRelease === false) { | ||
| 51 | - // routerTurnByName(PageEnum.REDIRECT_UN_PUBLISH_NAME, true, false) | ||
| 52 | -} | 49 | +// if (localStorageInfo.isRelease === false) { |
| 50 | +// routerTurnByName(PageEnum.REDIRECT_UN_PUBLISH_NAME, true, false) | ||
| 51 | +// } | ||
| 53 | 52 | ||
| 54 | const previewRefStyle = computed(() => { | 53 | const previewRefStyle = computed(() => { |
| 55 | return { | 54 | return { |
| @@ -11,8 +11,10 @@ export interface ChartEditStorageType extends ChartEditStorage { | @@ -11,8 +11,10 @@ export interface ChartEditStorageType extends ChartEditStorage { | ||
| 11 | export const getSessionStorageInfo = async () => { | 11 | export const getSessionStorageInfo = async () => { |
| 12 | const id = fetchRouteParamsLocation() | 12 | const id = fetchRouteParamsLocation() |
| 13 | const storageList: ChartEditStorageType[] = getSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST) | 13 | const storageList: ChartEditStorageType[] = getSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST) |
| 14 | + console.log(id) | ||
| 15 | + console.log(storageList) | ||
| 14 | // 是否本地预览 | 16 | // 是否本地预览 |
| 15 | - if (!storageList || storageList.findIndex(e => e.id === id.toString()) === -1) { | 17 | + // if (!storageList || storageList.findIndex(e => e.id === id.toString()) === -1) { |
| 16 | // 接口调用 | 18 | // 接口调用 |
| 17 | const res = await getDataView(id) | 19 | const res = await getDataView(id) |
| 18 | if (res) { | 20 | if (res) { |
| @@ -22,13 +24,14 @@ export const getSessionStorageInfo = async () => { | @@ -22,13 +24,14 @@ export const getSessionStorageInfo = async () => { | ||
| 22 | // return { isRelease: false } | 24 | // return { isRelease: false } |
| 23 | // } | 25 | // } |
| 24 | return { ...JSONParse(dataViewContent?.content), id: dataViewId, projectName: dataViewName } | 26 | return { ...JSONParse(dataViewContent?.content), id: dataViewId, projectName: dataViewName } |
| 25 | - } else { | ||
| 26 | - // 本地读取 | ||
| 27 | - for (let i = 0; i < storageList.length; i++) { | ||
| 28 | - if (id.toString() === storageList[i]['id']) { | ||
| 29 | - return storageList[i] | ||
| 30 | - } | ||
| 31 | - } | ||
| 32 | - } | 27 | + // } else { |
| 28 | + // console.log('本地读取') | ||
| 29 | + // // 本地读取 | ||
| 30 | + // for (let i = 0; i < storageList.length; i++) { | ||
| 31 | + // if (id.toString() === storageList[i]['id']) { | ||
| 32 | + // return storageList[i] | ||
| 33 | + // } | ||
| 34 | + // } | ||
| 35 | + // } | ||
| 33 | } | 36 | } |
| 34 | } | 37 | } |