diff --git a/PC/UI.WinIn.FasterZ.Store/src/store/modules/permission.js b/PC/UI.WinIn.FasterZ.Store/src/store/modules/permission.js index d550b8a..1cbd7af 100644 --- a/PC/UI.WinIn.FasterZ.Store/src/store/modules/permission.js +++ b/PC/UI.WinIn.FasterZ.Store/src/store/modules/permission.js @@ -88,11 +88,13 @@ const mutations = { * @param data 后端返回的菜单数据 */ export function generaMenu(routes, data, first) { + // 不显示的菜单配置隐藏 + let _noShowMenus = localStorage.getItem('menuHiddenConfig').split(',') data.forEach(item => { let _item = { path: '/'+item.name, component: loadView(item.name), - // hidden: item.status === 0, // 状态为0的隐藏 + hidden: _noShowMenus.indexOf(item.name) >= 0, // 状态为0的隐藏 name: item.name, // meta: item.meta meta: { @@ -180,11 +182,6 @@ const actions = { } // 存储所有的表名 commit('SET_TABLESNAME', _menuList) - // todo-new:接口获取 接口没有走配置文件 - let _noShowMenus = null//不显示的菜单 - _noShowMenus = localStorage.getItem('menuHiddenConfig').split(',') - // 去掉不显示的菜单后全部显示的菜单 - let _showMenus = _noShowMenus && _noShowMenus.length > 0 ? _menuList.filter(item1 => !_noShowMenus.some(item2 => item2 === item1)) : _menuList // 数据模拟,todo-new:接口获取 let _treeMenusAll = null//树形菜单 // _treeMenusAll = [ @@ -237,13 +234,13 @@ const actions = { let _initTreeMenus = [] if(_treeMenusAll && _treeMenusAll.length > 0){ - _initTreeMenus = initTreeMenusHandle(_treeMenusAll,_showMenus,true) + _initTreeMenus = initTreeMenusHandle(_treeMenusAll,_menuList,true) }else{ let _data = [] - for(let i in _showMenus){ - _data.push({name:_showMenus[i]}) + for(let i in _menuList){ + _data.push({name:_menuList[i]}) } - _initTreeMenus = initTreeMenusHandle(_data,_showMenus,true) + _initTreeMenus = initTreeMenusHandle(_data,_menuList,true) } // 最后查重+层级查重后的菜单 let _initEndMenus = generaMenu(asyncRoutes, _initTreeMenus,true) diff --git a/PC/UI.WinIn.FasterZ.Store/src/views/menuAll/index.vue b/PC/UI.WinIn.FasterZ.Store/src/views/menuAll/index.vue new file mode 100644 index 0000000..72f061e --- /dev/null +++ b/PC/UI.WinIn.FasterZ.Store/src/views/menuAll/index.vue @@ -0,0 +1,60 @@ + + + + \ No newline at end of file