From cb6590fc1a8e800f951645db3a20b5dd5d7fca17 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Wed, 3 Apr 2024 11:40:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=A7=BB=E5=8A=A8=E7=AB=AF):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=A7=BB=E5=8A=A8=E7=AB=AF=E8=AE=BF=E9=97=AE=E6=9C=89?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E7=9A=84=E5=85=AC=E5=85=B1=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E6=97=A0=E9=9C=80=E8=BE=93=E5=AF=86=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E7=9B=B4=E6=8E=A5=E8=AE=BF=E9=97=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/router/mobile.ts | 7 +++++++ .../src/views/mobile/directory/index.vue | 13 +++++++++++-- core/core-frontend/src/views/mobile/home/index.vue | 4 ++-- core/core-frontend/src/views/share/link/mobile.vue | 10 ++++++++-- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/router/mobile.ts b/core/core-frontend/src/router/mobile.ts index 7d2e5981a1..187efe98b7 100644 --- a/core/core-frontend/src/router/mobile.ts +++ b/core/core-frontend/src/router/mobile.ts @@ -38,6 +38,13 @@ export const routes: AppRouteRecordRaw[] = [ meta: {}, component: () => import('@/views/share/link/mobile.vue') }, + { + path: '/pc/de-link/:uuid', + name: 'linkPc', + hidden: true, + meta: {}, + component: () => import('@/views/share/link/index.vue') + }, { path: '/panel/mobile', name: 'mobile', diff --git a/core/core-frontend/src/views/mobile/directory/index.vue b/core/core-frontend/src/views/mobile/directory/index.vue index bb465b1b78..816d4134a1 100644 --- a/core/core-frontend/src/views/mobile/directory/index.vue +++ b/core/core-frontend/src/views/mobile/directory/index.vue @@ -88,6 +88,15 @@ const handleDir = index => { activeDirectName.value = directName.value[directName.value.length - 1] } +const dfsTableData = arr => { + return arr.filter(ele => { + if (!!ele.children?.length) { + ele.children = dfsTableData(ele.children) + } + return ele.extraFlag === 1 || ele.children?.length + }) +} + const getTree = async () => { const request = { busiFlag: 'dashboard' } as BusiTreeRequest await interactiveStore.setInteractive(request) @@ -99,10 +108,10 @@ const getTree = async () => { dvMainStore.resetDvInfo() } if (nodeData.length && nodeData[0]['id'] === '0' && nodeData[0]['name'] === 'root') { - tableData.value = nodeData[0]['children'] || [] + tableData.value = dfsTableData(nodeData[0]['children'] || []) return } - tableData.value = nodeData + tableData.value = dfsTableData(nodeData) } onMounted(() => { diff --git a/core/core-frontend/src/views/mobile/home/index.vue b/core/core-frontend/src/views/mobile/home/index.vue index 87380b07ac..ab641864a7 100644 --- a/core/core-frontend/src/views/mobile/home/index.vue +++ b/core/core-frontend/src/views/mobile/home/index.vue @@ -35,7 +35,7 @@ const loadTableData = () => { shortcutOption .loadData({ type: 'panel', keyword: '', asc: false }) .then(res => { - state.tableData = res.data + state.tableData = (res.data || []).filter(ele => ele.extraFlag === 1) }) .finally(() => { emits('setLoading', false) @@ -63,7 +63,7 @@ const loadShareTableData = () => { data: { type: 'panel', keyword: '', asc: false } }) .then(res => { - state.tableData = res.data + state.tableData = (res.data || []).filter(ele => ele.extraFlag === 1) }) .finally(() => { emits('setLoading', false) diff --git a/core/core-frontend/src/views/share/link/mobile.vue b/core/core-frontend/src/views/share/link/mobile.vue index 7a95efecd1..d039fcbb3b 100644 --- a/core/core-frontend/src/views/share/link/mobile.vue +++ b/core/core-frontend/src/views/share/link/mobile.vue @@ -5,7 +5,7 @@ { state.dvInfo = dvInfo state.curPreviewGap = curPreviewGap dataInitState.value = true + if (!state.dvInfo.mobileLayout) { + const href = window.location.href.replace('/de-link', '/pc/de-link') + window.location.href = href + return + } nextTick(() => { document.title = dvInfo.name dashboardPreview.value.restore()