diff --git a/core/core-frontend/src/views/mobile/directory/index.vue b/core/core-frontend/src/views/mobile/directory/index.vue index bb4dddb99c..b82a9e7e8f 100644 --- a/core/core-frontend/src/views/mobile/directory/index.vue +++ b/core/core-frontend/src/views/mobile/directory/index.vue @@ -2,6 +2,7 @@ import { ref, computed, onMounted } from 'vue' import { storeToRefs } from 'pinia' import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' +import { useCache } from '@/hooks/web/useCache' import { BusiTreeRequest } from '@/models/tree/TreeNode' import { interactiveStoreWithOut } from '@/store/modules/interactive' import DashboardCell from '@/views/mobile/components/DashboardCell.vue' @@ -19,6 +20,7 @@ const activeDirectName = ref('') const interactiveStore = interactiveStoreWithOut() const dvMainStore = dvMainStoreWithOut() const { dvInfo } = storeToRefs(dvMainStore) +const { wsCache } = useCache('sessionStorage') const dfsTree = (ids, arr) => { const id = ids.shift() @@ -50,6 +52,10 @@ const onClickLeft = () => { const router = useRouter() const handleCellClick = ele => { + wsCache.set('directName', directName.value) + wsCache.set('activeDirectName', activeDirectName.value) + wsCache.set('activeTabbar', 'direct') + wsCache.set('directId', directId.value) router.push({ path: '/panel/mobile', query: { @@ -59,13 +65,14 @@ const handleCellClick = ele => { } const dataClick = val => { - directName.value.push(val.name) - activeDirectName.value = val.name - directId.value.push(val.id) if (val.leaf) { emits('hiddenTabbar', true) handleCellClick(val) + return } + directName.value.push(val.name) + activeDirectName.value = val.name + directId.value.push(val.id) } const getTree = async () => { @@ -87,6 +94,14 @@ const getTree = async () => { onMounted(() => { getTree() + activeDirectName.value = wsCache.get('activeDirectName') + if (wsCache.get('activeTabbar') !== 'direct' || !activeDirectName.value) return + directName.value = wsCache.get('directName') + directId.value = wsCache.get('directId') + wsCache.set('directName', []) + wsCache.set('activeDirectName', '') + wsCache.set('directId', []) + wsCache.set('activeTabbar', '') }) diff --git a/core/core-frontend/src/views/mobile/home/index.vue b/core/core-frontend/src/views/mobile/home/index.vue index 6f390850de..fef9a79e19 100644 --- a/core/core-frontend/src/views/mobile/home/index.vue +++ b/core/core-frontend/src/views/mobile/home/index.vue @@ -4,6 +4,7 @@ import { interactiveStoreWithOut } from '@/store/modules/interactive' import { useI18n } from '@/hooks/web/useI18n' import { shortcutOption } from '@/views/workbranch/ShortcutOption' import { useRouter } from 'vue-router' +import { useCache } from '@/hooks/web/useCache' import Workbranch from '@/views/mobile/components/Workbranch.vue' import request from '@/config/axios' import nothingNone from '@/assets/img/none.png' @@ -18,6 +19,7 @@ import 'vant/es/tabs/style' const router = useRouter() const { t } = useI18n() +const { wsCache } = useCache('sessionStorage') const activeTab = ref('recent') const emptyTips = ref('') @@ -104,14 +106,17 @@ const handleClick = ({ name, disabled }) => { } } onMounted(() => { + activeTab.value = wsCache.get('activeTab') || 'recent' + wsCache.set('activeTab', '') !!busiAuthList.length && handleClick({ - name: 'recent', + name: activeTab.value, disabled: false }) }) const handleCellClick = ele => { + wsCache.set('activeTab', activeTab.value) router.push({ path: '/panel/mobile', query: { diff --git a/core/core-frontend/src/views/mobile/index.vue b/core/core-frontend/src/views/mobile/index.vue index dfd5789dea..6f79f9c989 100644 --- a/core/core-frontend/src/views/mobile/index.vue +++ b/core/core-frontend/src/views/mobile/index.vue @@ -1,7 +1,8 @@