修复顶部供应商与报告导航路由
This commit is contained in:
parent
71437dfa25
commit
f04aad9a59
@ -15,6 +15,14 @@ const router = useRouter();
|
|||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const navigation = ["对话", "看板", "供应商", "标准库", "报告", "管理"];
|
const navigation = ["对话", "看板", "供应商", "标准库", "报告", "管理"];
|
||||||
|
const navigationRoutes: Record<string, string> = {
|
||||||
|
对话: "assessment",
|
||||||
|
看板: "overview",
|
||||||
|
供应商: "supplier",
|
||||||
|
标准库: "standards",
|
||||||
|
报告: "report",
|
||||||
|
管理: "review",
|
||||||
|
};
|
||||||
const visibleNavigation = computed(() =>
|
const visibleNavigation = computed(() =>
|
||||||
navigation.filter(
|
navigation.filter(
|
||||||
(item) => item !== "管理" || auth.hasPermission("risk_item.review"),
|
(item) => item !== "管理" || auth.hasPermission("risk_item.review"),
|
||||||
@ -52,19 +60,14 @@ function prefetch(item: string) {
|
|||||||
v-for="item in visibleNavigation"
|
v-for="item in visibleNavigation"
|
||||||
:key="item"
|
:key="item"
|
||||||
:to="{
|
:to="{
|
||||||
name:
|
name: navigationRoutes[item] || 'assessment',
|
||||||
item === '看板'
|
|
||||||
? 'overview'
|
|
||||||
: item === '标准库'
|
|
||||||
? 'standards'
|
|
||||||
: item === '管理'
|
|
||||||
? 'review'
|
|
||||||
: 'assessment',
|
|
||||||
}"
|
}"
|
||||||
:class="{
|
:class="{
|
||||||
active:
|
active:
|
||||||
(item === '看板' && route.name === 'overview') ||
|
(item === '看板' && route.name === 'overview') ||
|
||||||
|
(item === '供应商' && route.name === 'supplier') ||
|
||||||
(item === '标准库' && route.name === 'standards') ||
|
(item === '标准库' && route.name === 'standards') ||
|
||||||
|
(item === '报告' && route.name === 'report') ||
|
||||||
(item === '管理' && route.name === 'review') ||
|
(item === '管理' && route.name === 'review') ||
|
||||||
(item === '对话' && route.name === 'assessment'),
|
(item === '对话' && route.name === 'assessment'),
|
||||||
}"
|
}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user