From f04aad9a59363f747b82dd11d556b3c2a54fcd9e Mon Sep 17 00:00:00 2001 From: kx_guo Date: Thu, 10 Sep 2026 11:43:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B6=E9=83=A8=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86=E4=B8=8E=E6=8A=A5=E5=91=8A=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/AppHeader.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/layout/AppHeader.vue b/src/components/layout/AppHeader.vue index 09d1c6a..d7bb544 100644 --- a/src/components/layout/AppHeader.vue +++ b/src/components/layout/AppHeader.vue @@ -15,6 +15,14 @@ const router = useRouter(); const route = useRoute(); const navigation = ["对话", "看板", "供应商", "标准库", "报告", "管理"]; +const navigationRoutes: Record = { + 对话: "assessment", + 看板: "overview", + 供应商: "supplier", + 标准库: "standards", + 报告: "report", + 管理: "review", +}; const visibleNavigation = computed(() => navigation.filter( (item) => item !== "管理" || auth.hasPermission("risk_item.review"), @@ -52,19 +60,14 @@ function prefetch(item: string) { v-for="item in visibleNavigation" :key="item" :to="{ - name: - item === '看板' - ? 'overview' - : item === '标准库' - ? 'standards' - : item === '管理' - ? 'review' - : 'assessment', + name: navigationRoutes[item] || 'assessment', }" :class="{ active: (item === '看板' && route.name === 'overview') || + (item === '供应商' && route.name === 'supplier') || (item === '标准库' && route.name === 'standards') || + (item === '报告' && route.name === 'report') || (item === '管理' && route.name === 'review') || (item === '对话' && route.name === 'assessment'), }"