diff --git a/src/components/menu/menu.js b/src/components/menu/menu.js index 1a7b06dd9e05d108fcda80e0df6184e9712ce8a8..961cc8990e5096dd56a0d2a19a1b1a743bfc59db 100644 --- a/src/components/menu/menu.js +++ b/src/components/menu/menu.js @@ -188,18 +188,16 @@ export default { updateMenu() { this.selectedKeys = this.getSelectedKey(); // 混合模式 不管 - if (this.layout !== 'mix') this.sOpenKeys = this.getOpenKeysByPath(this.$route.path); + if (this.mode !== 'horizontal') this.sOpenKeys = this.getOpenKeysByPath(this.$route.path); }, getSelectedKey() { const { path } = this.$route; let routeToMenu = this.menuData.find(m => m.menuUrl === path); - - if (this.layout !== 'mix') return [routeToMenu.menuId]; + let parentMenuId = routeToMenu.parentMenuId; // 说明这是头部菜单 if (this.mode === 'horizontal') { - let parentMenuId = routeToMenu.parentMenuId; while (parentMenuId !== 0) { routeToMenu = this.allMenuList.find(m => m.menuId === parentMenuId); parentMenuId = routeToMenu.parentMenuId; @@ -207,7 +205,7 @@ export default { return [routeToMenu.menuId]; } - return []; + return [routeToMenu.menuId]; }, getOpenKeysByPath(path) { diff --git a/src/pages/frame/layouts/AdminLayout.vue b/src/pages/frame/layouts/AdminLayout.vue index e572ecbae2921825b44b15baadc640b3a76c09ec..eeea074f32236495aa16e025d5ab333db3ac5868 100644 --- a/src/pages/frame/layouts/AdminLayout.vue +++ b/src/pages/frame/layouts/AdminLayout.vue @@ -128,12 +128,10 @@ export default { }, headMenuData() { const { layout, menuData, firstMenu } = this; - console.log('first', firstMenu); return layout === 'mix' ? firstMenu : menuData; }, sideMenuData() { const { layout, menuData, subMenu } = this; - console.log('sub', subMenu); return layout === 'mix' ? subMenu : menuData; }, }, @@ -161,7 +159,6 @@ export default { }, menuSelect(obj) { - console.log('切换', obj); // 拿到 菜单id const menuId = obj.key; const currentMenu = this.menuList.find(i => i.menuId === menuId); @@ -177,7 +174,6 @@ export default { created() { this.correctPageMinHeight(this.minHeight - 24); const { menuList } = getUserInfo(); - console.log(menuList); const menuData = convertListToTree(menuList || [], false, true); this.menuData = menuData; this.menuList = menuList; @@ -185,6 +181,7 @@ export default { delete i.children; return i; }); + this.updateSildeMenu(this.layout); }, beforeDestroy() { this.correctPageMinHeight(-this.minHeight + 24); diff --git a/src/pages/frame/store/settingModule.js b/src/pages/frame/store/settingModule.js index 691998fa21e1202e802478ab21020036c7a96eb3..6f6a90239c461ebfaf9069a13fc02465ce784825 100644 --- a/src/pages/frame/store/settingModule.js +++ b/src/pages/frame/store/settingModule.js @@ -51,7 +51,6 @@ export default { state.theme = theme; }, setLayout(state, layout) { - console.log(layout); state.layout = layout; }, setMultiPage(state, multiPage) { diff --git a/src/pages/frame/view/template/TabsTemplateView.vue b/src/pages/frame/view/template/TabsTemplateView.vue index 630631ee7989e79196078056d1b46b4ad9f0dccd..8515d1c009d0a0f2c503e8cfd580bffca3faacde 100644 --- a/src/pages/frame/view/template/TabsTemplateView.vue +++ b/src/pages/frame/view/template/TabsTemplateView.vue @@ -85,11 +85,6 @@ export default { $route: function(newRoute) { this.activePage = newRoute.fullPath; - console.log('#################################'); - console.log(this.pageList); - console.log(newRoute); - console.log('#################################'); - if (this.pageList.findIndex(item => item.fullPath === newRoute.fullPath) === -1) { if (!this.multiPage) { this.pageList = [this.createPage(newRoute)];