From 1c1c03c83564640fcf714715720e2e8bccd1adbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Thu, 20 Jul 2023 09:47:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E9=85=8D=E7=BD=AE=E5=B0=81?= =?UTF-8?q?=E8=A3=85=E5=8F=8A=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code/Fe/public/config.js | 2 + Code/Fe/src/App.vue | 2 + Code/Fe/src/store/modules/permission.js | 109 +++++++++++++----------- 3 files changed, 62 insertions(+), 51 deletions(-) diff --git a/Code/Fe/public/config.js b/Code/Fe/public/config.js index 8a6e680..bce2a27 100644 --- a/Code/Fe/public/config.js +++ b/Code/Fe/public/config.js @@ -7,6 +7,8 @@ window.SITE_CONFIG['isAutoLogin'] = false window.SITE_CONFIG['isSinglePage'] = false window.SITE_CONFIG['userNameOrEmailAddress'] = 'admin' window.SITE_CONFIG['client_secret'] = '1q2w3E*' +window.SITE_CONFIG['menuHiddenConfig'] = ['AsnDet','PoDet','ReceiptDet','ReturnDet','SodDet'] + // window.SITE_CONFIG['user'] = 'http://dev.ccwin-in.com:60069/api' // // window.SITE_CONFIG['print'] = 'print'21384 // window.SITE_CONFIG['print'] = 'http://dev.ccwin-in.com:60074' diff --git a/Code/Fe/src/App.vue b/Code/Fe/src/App.vue index b84602c..a88e274 100644 --- a/Code/Fe/src/App.vue +++ b/Code/Fe/src/App.vue @@ -15,6 +15,8 @@ localStorage.setItem('isAutoLogin',window.SITE_CONFIG['isAutoLogin']) localStorage.setItem('isSinglePage',window.SITE_CONFIG['isSinglePage']) localStorage.setItem('userNameOrEmailAddress',window.SITE_CONFIG['userNameOrEmailAddress']) localStorage.setItem('client_secret',window.SITE_CONFIG['client_secret']) +localStorage.setItem('menuHiddenConfig',window.SITE_CONFIG['menuHiddenConfig']) + // localStorage.setItem('user',window.SITE_CONFIG['user']) // localStorage.setItem('print',window.SITE_CONFIG['print']) // localStorage.setItem('warehouseCode',window.SITE_CONFIG['warehouseCode']) diff --git a/Code/Fe/src/store/modules/permission.js b/Code/Fe/src/store/modules/permission.js index 90ca6f5..7f14117 100644 --- a/Code/Fe/src/store/modules/permission.js +++ b/Code/Fe/src/store/modules/permission.js @@ -178,63 +178,70 @@ const actions = { _menuList.push(item.substring(item.indexOf('.') + 1,item.length)) } } - let _noShowMenus = ['Z.AsnDet']//不显示的菜单 + // todo-new:接口获取 接口没有走配置文件 + let _noShowMenus = null//不显示的菜单 + _noShowMenus = localStorage.getItem('menuHiddenConfig').split(',') // 去掉不显示的菜单后全部显示的菜单 - let _showMenus = _menuList.filter(item1 => !_noShowMenus.some(item2 => item2 === item1)) - // 数据模拟,todo:接口获取 - let _treeMenusAll = [ - {name:"aaaaaaa"}, - {name:"ExportCustomUserSetting" - // ,children:[ - // {name:'OutgoingDataHistory',children:[ - // {name:'IncomingData',children:[ - // {name:'OutgoingDataHistory'}, - // {name:'IncomingData'}, - // {name:'333333'}, - // ]}, - // {name:'eee1111-bbb',children:[ - // {name:'ExportCustomUserSetting'}, - // {name:'MessageReceive'}, - // ]}, - // ]}, - // {name:'eee222'}, - // {name:'eee333'}, - // {name:'eee444'}, - // {name:'eee555'}, - // ] - }, - {name:"OutgoingDataHistory"}, - {name:"IncomingData"}, - {name:"IncomingDataHistory"}, - {name:"MesProductL7PartsNote"}, - {name:"MessageReceive"}, - {name:"OutgoingData"}, - {name:"AsnDet"}, - {name:"AsnMstr"}, - {name:"Bom"}, - {name:"CustPart"}, - {name:"Cust"}, - {name:"Inventory"}, - {name:"Loc"}, - {name:"Part"}, - {name:"PoDet"}, - {name:"PoMstr"}, - {name:"PrhHist"}, - {name:"ProdLine"}, - {name:"ReceiptDet"}, - {name:"ReceiptMstr"}, - {name:"ReturnDet"}, - {name:"ReturnMstr"}, - {name:"SodDet"}, - {name:"VendPart"}, - {name:"Vend"}, - ] + let _showMenus = _noShowMenus && _noShowMenus.length > 0 ? _menuList.filter(item1 => !_noShowMenus.some(item2 => item2 === item1)) : _menuList + // 数据模拟,todo-new:接口获取 + let _treeMenusAll = null//树形菜单 + // _treeMenusAll = [ + // {name:"aaaaaaa"}, + // {name:"ExportCustomUserSetting" + // // ,children:[ + // // {name:'OutgoingDataHistory',children:[ + // // {name:'IncomingData',children:[ + // // {name:'OutgoingDataHistory'}, + // // {name:'IncomingData'}, + // // {name:'333333'}, + // // ]}, + // // {name:'eee1111-bbb',children:[ + // // {name:'ExportCustomUserSetting'}, + // // {name:'MessageReceive'}, + // // ]}, + // // ]}, + // // {name:'eee222'}, + // // {name:'eee333'}, + // // {name:'eee444'}, + // // {name:'eee555'}, + // // ] + // }, + // {name:"OutgoingDataHistory"}, + // {name:"IncomingData"}, + // {name:"IncomingDataHistory"}, + // {name:"MesProductL7PartsNote"}, + // {name:"MessageReceive"}, + // {name:"OutgoingData"}, + // {name:"AsnDet"}, + // {name:"AsnMstr"}, + // {name:"Bom"}, + // {name:"CustPart"}, + // {name:"Cust"}, + // {name:"Inventory"}, + // {name:"Loc"}, + // {name:"Part"}, + // {name:"PoDet"}, + // {name:"PoMstr"}, + // {name:"PrhHist"}, + // {name:"ProdLine"}, + // {name:"ReceiptDet"}, + // {name:"ReceiptMstr"}, + // {name:"ReturnDet"}, + // {name:"ReturnMstr"}, + // {name:"SodDet"}, + // {name:"VendPart"}, + // {name:"Vend"}, + // ] let _initTreeMenus = [] if(_treeMenusAll && _treeMenusAll.length > 0){ _initTreeMenus = initTreeMenusHandle(_treeMenusAll,_showMenus,_zh,true) }else{ - _initTreeMenus = _showMenus + let _data = [] + for(let i in _showMenus){ + _data.push({name:_showMenus[i]}) + } + _initTreeMenus = initTreeMenusHandle(_data,_showMenus,_zh,true) } // 最后查重+层级查重后的菜单 let _initEndMenus = generaMenu(asyncRoutes, _initTreeMenus,true)