dataease-dm/frontend/src/utils/LayoutUtil.js

18 lines
418 B
JavaScript
Raw Normal View History

const defaultLayout = {
panel: '260px',
dataset: '260px',
datasource: '260px',
system: '260px'
}
const STORAGE_KEY = 'global_layout'
export const getLayout = (type) => {
const key = STORAGE_KEY + '_' + type
return localStorage.getItem(key) || defaultLayout[type]
}
export const setLayout = (type, val) => {
const key = STORAGE_KEY + '_' + type
localStorage.setItem(key, val || defaultLayout[type])
}