diff --git a/frontend/src/components/dataease/DeAsideContainer.vue b/frontend/src/components/dataease/DeAsideContainer.vue index 32a90322fd..7b53d3a455 100644 --- a/frontend/src/components/dataease/DeAsideContainer.vue +++ b/frontend/src/components/dataease/DeAsideContainer.vue @@ -1,16 +1,17 @@ diff --git a/frontend/src/components/dataease/dragbar/DeLeft2RightDragBar.vue b/frontend/src/components/dataease/dragbar/DeLeft2RightDragBar.vue index 9d26739bae..9a11e677d1 100644 --- a/frontend/src/components/dataease/dragbar/DeLeft2RightDragBar.vue +++ b/frontend/src/components/dataease/dragbar/DeLeft2RightDragBar.vue @@ -1,10 +1,16 @@ diff --git a/frontend/src/directive/index.js b/frontend/src/directive/index.js index f26cb177cf..1273bd4c9e 100644 --- a/frontend/src/directive/index.js +++ b/frontend/src/directive/index.js @@ -1,8 +1,9 @@ import permission from '@/directive/Permission' -// import dataPermission from '@/directive/DataPermission' +import { setLayout } from '@/utils/LayoutUtil' export const left2RightDrag = { inserted(el, binding) { + const value = binding.value el.onmousedown = function(e) { const init = e.clientX const parent = el.parentNode @@ -15,6 +16,8 @@ export const left2RightDrag = { } } document.onmouseup = function() { + value && setLayout(value, parent.style.width) + document.onmousemove = document.onmouseup = null } } diff --git a/frontend/src/layout/index.vue b/frontend/src/layout/index.vue index 2d609a192b..763b188d4c 100644 --- a/frontend/src/layout/index.vue +++ b/frontend/src/layout/index.vue @@ -4,7 +4,7 @@ - + diff --git a/frontend/src/utils/LayoutUtil.js b/frontend/src/utils/LayoutUtil.js new file mode 100644 index 0000000000..5ffce3e9c6 --- /dev/null +++ b/frontend/src/utils/LayoutUtil.js @@ -0,0 +1,17 @@ +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]) +} diff --git a/frontend/src/views/dataset/index.vue b/frontend/src/views/dataset/index.vue index 328d47a505..46eb2fa035 100644 --- a/frontend/src/views/dataset/index.vue +++ b/frontend/src/views/dataset/index.vue @@ -1,7 +1,7 @@