| | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | collapse: state.collapse, |
| | | mainMenu: state.mainMenu, |
| | | permAction: state.permAction, |
| | | mainMenu: state.mainMenu |
| | | } |
| | | } |
| | | |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction, permMenus, param } = this.props |
| | | const { permAction, param } = this.props |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | let balMap = new Map() |
| | | let skip = config.permission === 'false' || this.props.menuType === 'HS' |
| | | config.components = this.filterComponent(config.components, roleId, permAction, permMenus, balMap, skip) |
| | | config.components = this.filterComponent(config.components, roleId, permAction, balMap, skip) |
| | | |
| | | // 获取主搜索条件 |
| | | let mainSearch = [] |
| | |
| | | }) |
| | | } |
| | | |
| | | filterComponent = (components, roleId, permAction, permMenus, balMap, skip) => { |
| | | filterComponent = (components, roleId, permAction, balMap, skip) => { |
| | | return components.filter(item => { |
| | | |
| | | if (item.style && item.style.boxShadow) { |
| | |
| | | }) |
| | | |
| | | item.subtabs = item.subtabs.map(tab => { |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus, balMap, skip) |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip) |
| | | return tab |
| | | }) |
| | | |
| | |
| | | return false |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap, skip) |
| | | item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip) |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) { |
| | | if ( |
| | | item.plot.blacklist && item.plot.blacklist.length > 0 && |
| | |
| | | |
| | | if (col.linkmenu && col.linkmenu.length > 0) { |
| | | let menu_id = col.linkmenu.pop() |
| | | col.linkThdMenu = permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | col.linkThdMenu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | } else { |
| | | col.linkThdMenu = '' |
| | | } |