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 {
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) {
......
......@@ -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);
......
......@@ -51,7 +51,6 @@ export default {
state.theme = theme;
},
setLayout(state, layout) {
console.log(layout);
state.layout = layout;
},
setMultiPage(state, multiPage) {
......
......@@ -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)];
......
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