|
|
@@ -26,15 +26,22 @@ const appStore = useAppStore();
|
|
|
const settingsStore = useSettingsStore();
|
|
|
const permissionStore = usePermissionStore();
|
|
|
// 只显示当前一级菜单下的二级菜单
|
|
|
-const topMenus = computed(() => permissionStore.getTopbarRoutes().filter(menu => menu.hidden !== true));
|
|
|
+const topMenus = computed(() => permissionStore.getTopbarRoutes().filter((menu) => menu.hidden !== true));
|
|
|
const currentTopMenuPath = computed(() => {
|
|
|
+ // console.log("[Sidebar] route.path", route.path);
|
|
|
+ // 特例
|
|
|
+ if (route.path === '/source/push/approval' || route.path.startsWith('/source/split/edit')) {
|
|
|
+ return '/source';
|
|
|
+ }
|
|
|
// 取当前路由的一级菜单 path
|
|
|
const matched = route.matched?.[0];
|
|
|
- return matched && matched.path !== '/' ? matched.path : (topMenus.value[0]?.path || '/');
|
|
|
+ // console.log("[Sidebar] matched", matched);
|
|
|
+ // console.log("[Sidebar] ret", matched && matched.path !== '/' ? matched.path : (topMenus.value[0]?.path || '/'));
|
|
|
+ return matched && matched.path !== '/' ? matched.path : topMenus.value[0]?.path || '/';
|
|
|
});
|
|
|
const sidebarRouters = computed<RouteRecordRaw[]>(() => {
|
|
|
- const topMenu = topMenus.value.find(menu => menu.path === currentTopMenuPath.value);
|
|
|
- return topMenu && topMenu.children ? topMenu.children.filter(item => item.hidden !== true) : [];
|
|
|
+ const topMenu = topMenus.value.find((menu) => menu.path === currentTopMenuPath.value);
|
|
|
+ return topMenu && topMenu.children ? topMenu.children.filter((item) => item.hidden !== true) : [];
|
|
|
});
|
|
|
const showLogo = computed(() => settingsStore.sidebarLogo);
|
|
|
const sideTheme = computed(() => settingsStore.sideTheme);
|