Commit 742d0162 authored by 陈浩玮's avatar 陈浩玮

Merge branch 'feature/shuiluo' into 'master'

feat: 修复部分bug

See merge request product/kim3-web-vue/starter-web-vue!30
parents e2f99216 6e53962f
...@@ -188,18 +188,16 @@ export default { ...@@ -188,18 +188,16 @@ export default {
updateMenu() { updateMenu() {
this.selectedKeys = this.getSelectedKey(); 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() { getSelectedKey() {
const { path } = this.$route; const { path } = this.$route;
let routeToMenu = this.menuData.find(m => m.menuUrl === path); let routeToMenu = this.menuData.find(m => m.menuUrl === path);
let parentMenuId = routeToMenu.parentMenuId;
if (this.layout !== 'mix') return [routeToMenu.menuId];
// 说明这是头部菜单 // 说明这是头部菜单
if (this.mode === 'horizontal') { if (this.mode === 'horizontal') {
let parentMenuId = routeToMenu.parentMenuId;
while (parentMenuId !== 0) { while (parentMenuId !== 0) {
routeToMenu = this.allMenuList.find(m => m.menuId === parentMenuId); routeToMenu = this.allMenuList.find(m => m.menuId === parentMenuId);
parentMenuId = routeToMenu.parentMenuId; parentMenuId = routeToMenu.parentMenuId;
...@@ -207,7 +205,7 @@ export default { ...@@ -207,7 +205,7 @@ export default {
return [routeToMenu.menuId]; return [routeToMenu.menuId];
} }
return []; return [routeToMenu.menuId];
}, },
getOpenKeysByPath(path) { getOpenKeysByPath(path) {
......
...@@ -128,12 +128,10 @@ export default { ...@@ -128,12 +128,10 @@ export default {
}, },
headMenuData() { headMenuData() {
const { layout, menuData, firstMenu } = this; const { layout, menuData, firstMenu } = this;
console.log('first', firstMenu);
return layout === 'mix' ? firstMenu : menuData; return layout === 'mix' ? firstMenu : menuData;
}, },
sideMenuData() { sideMenuData() {
const { layout, menuData, subMenu } = this; const { layout, menuData, subMenu } = this;
console.log('sub', subMenu);
return layout === 'mix' ? subMenu : menuData; return layout === 'mix' ? subMenu : menuData;
}, },
}, },
...@@ -161,7 +159,6 @@ export default { ...@@ -161,7 +159,6 @@ export default {
}, },
menuSelect(obj) { menuSelect(obj) {
console.log('切换', obj);
// 拿到 菜单id // 拿到 菜单id
const menuId = obj.key; const menuId = obj.key;
const currentMenu = this.menuList.find(i => i.menuId === menuId); const currentMenu = this.menuList.find(i => i.menuId === menuId);
...@@ -177,7 +174,6 @@ export default { ...@@ -177,7 +174,6 @@ export default {
created() { created() {
this.correctPageMinHeight(this.minHeight - 24); this.correctPageMinHeight(this.minHeight - 24);
const { menuList } = getUserInfo(); const { menuList } = getUserInfo();
console.log(menuList);
const menuData = convertListToTree(menuList || [], false, true); const menuData = convertListToTree(menuList || [], false, true);
this.menuData = menuData; this.menuData = menuData;
this.menuList = menuList; this.menuList = menuList;
...@@ -185,6 +181,7 @@ export default { ...@@ -185,6 +181,7 @@ export default {
delete i.children; delete i.children;
return i; return i;
}); });
this.updateSildeMenu(this.layout);
}, },
beforeDestroy() { beforeDestroy() {
this.correctPageMinHeight(-this.minHeight + 24); this.correctPageMinHeight(-this.minHeight + 24);
......
...@@ -51,7 +51,6 @@ export default { ...@@ -51,7 +51,6 @@ export default {
state.theme = theme; state.theme = theme;
}, },
setLayout(state, layout) { setLayout(state, layout) {
console.log(layout);
state.layout = layout; state.layout = layout;
}, },
setMultiPage(state, multiPage) { setMultiPage(state, multiPage) {
......
...@@ -85,11 +85,6 @@ export default { ...@@ -85,11 +85,6 @@ export default {
$route: function(newRoute) { $route: function(newRoute) {
this.activePage = newRoute.fullPath; 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.pageList.findIndex(item => item.fullPath === newRoute.fullPath) === -1) {
if (!this.multiPage) { if (!this.multiPage) {
this.pageList = [this.createPage(newRoute)]; this.pageList = [this.createPage(newRoute)];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment