mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 修改预览的存储方式为 sessionStorage
This commit is contained in:
@@ -16,14 +16,13 @@ import { onUnmounted, ref, nextTick, computed } from 'vue'
|
||||
import { usePreviewScale } from '@/hooks/index'
|
||||
import { RenderList } from './components/RenderList/index'
|
||||
import { ChartEditStorageType } from './index.d'
|
||||
import { getLocalStorageInfo } from './utils/index'
|
||||
import { useEditCanvasConfigStyle } from './utils'
|
||||
import { useEditCanvasConfigStyle, getSessionStorageInfo } from './utils'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { fetchChartComponent } from '@/packages/index'
|
||||
|
||||
const previewRef = ref()
|
||||
|
||||
const localStorageInfo: ChartEditStorageType = getLocalStorageInfo() as ChartEditStorageType
|
||||
const localStorageInfo: ChartEditStorageType = getSessionStorageInfo() as ChartEditStorageType
|
||||
|
||||
const width = ref(localStorageInfo?.editCanvasConfig.width)
|
||||
const height = ref(localStorageInfo?.editCanvasConfig.height)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export * from './style'
|
||||
import { getLocalStorage } from '@/utils'
|
||||
import { getSessionStorage } from '@/utils'
|
||||
import { StorageEnum } from '@/enums/storageEnum'
|
||||
import { ChartEditStorage } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||
|
||||
@@ -8,12 +8,12 @@ export interface ChartEditStorageType extends ChartEditStorage {
|
||||
}
|
||||
|
||||
// 根据路由 id 获取存储数据的信息
|
||||
export const getLocalStorageInfo = () => {
|
||||
export const getSessionStorageInfo = () => {
|
||||
const urlHash = document.location.hash
|
||||
const toPathArray = urlHash.split('/')
|
||||
const id = toPathArray && toPathArray[toPathArray.length - 1]
|
||||
|
||||
const storageList: ChartEditStorageType[] = getLocalStorage(
|
||||
const storageList: ChartEditStorageType[] = getSessionStorage(
|
||||
StorageEnum.GO_CHART_STORAGE_LIST
|
||||
)
|
||||
|
||||
@@ -24,4 +24,4 @@ export const getLocalStorageInfo = () => {
|
||||
return storageList[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user