From aae22f34e72b169df9b99696f45522dcd6963b2a Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Fri, 1 Mar 2024 18:57:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=A7=BB=E5=8A=A8=E7=AB=AF):=20=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=90=8E=EF=BC=8C=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=97=B6=E5=BB=BA=E8=AE=AE=E8=83=BD=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=88=B0=E6=9F=A5=E7=9C=8B=E6=93=8D=E4=BD=9C=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E7=9A=84=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/mobile/directory/index.vue | 21 ++++++++++++++++--- .../src/views/mobile/home/index.vue | 7 ++++++- core/core-frontend/src/views/mobile/index.vue | 8 ++++++- .../src/views/mobile/panel/Mobile.vue | 10 +++++++-- 4 files changed, 39 insertions(+), 7 deletions(-) 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 @@