| | |
| | | if (menu.path === '/' && menu.children) { |
| | | topMenus.push(menu.children[0]) |
| | | } else { |
| | | topMenus.push(menu) |
| | | menu.children.forEach(item => { |
| | | topMenus.push(item) |
| | | |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | |
| | | const tmpPath = path.substring(1, path.length) |
| | | if (!route.meta.link) { |
| | | activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/")) |
| | | appStore.toggleSideBarHide(false) |
| | | // appStore.toggleSideBarHide(false) |
| | | } |
| | | } else if(!route.children) { |
| | | activePath = path |
| | | appStore.toggleSideBarHide(true) |
| | | // appStore.toggleSideBarHide(true) |
| | | } |
| | | activeRoutes(activePath) |
| | | // activeRoutes(activePath) |
| | | return activePath |
| | | }) |
| | | |
| | |
| | | } else { |
| | | router.push({ path: key }) |
| | | } |
| | | appStore.toggleSideBarHide(true) |
| | | // appStore.toggleSideBarHide(true) |
| | | } else { |
| | | // 显示左侧联动菜单 |
| | | activeRoutes(key) |
| | | appStore.toggleSideBarHide(false) |
| | | // activeRoutes(key) |
| | | // appStore.toggleSideBarHide(false) |
| | | } |
| | | } |
| | | |
| | |
| | | if(routes.length > 0) { |
| | | permissionStore.setSidebarRouters(routes) |
| | | } else { |
| | | appStore.toggleSideBarHide(true) |
| | | // appStore.toggleSideBarHide(true) |
| | | } |
| | | return routes |
| | | } |