| | |
| | | MenuID: PropTypes.string, |
| | | MenuName: PropTypes.string, |
| | | permAction: PropTypes.object, |
| | | permRoles: PropTypes.array, |
| | | userConfig: PropTypes.object, |
| | | columns: PropTypes.array, |
| | | config: PropTypes.object, // 页面配置 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { MenuID, MenuName, permAction, permRoles, config, userConfig, columns } = this.props |
| | | const { MenuID, MenuName, permAction, config, userConfig, columns } = this.props |
| | | let menuParam = [] |
| | | |
| | | this.setState({ |
| | |
| | | return |
| | | } |
| | | |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | result.forEach(res => { |
| | | if (!res.LongParam) return |
| | | |
| | |
| | | |
| | | subconfig.columns = subconfig.columns.filter(col => { |
| | | if (!col.field || !col.blacklist || col.blacklist.length === 0) return true |
| | | |
| | | let _black = col.blacklist.filter(v => { |
| | | return permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | return col.blacklist.filter(v => roleId.indexOf(v) > -1).length === 0 |
| | | }) |
| | | |
| | | if (subUserConfig) { |