| | |
| | | // 权限过滤 |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | let balMap = new Map() |
| | | config.components = this.filterComponent(config.components, roleId, permAction, permMenus, balMap) |
| | | let skip = config.permission === 'false' || this.props.menuType === 'HS' |
| | | config.components = this.filterComponent(config.components, roleId, permAction, permMenus, balMap, skip) |
| | | |
| | | // 获取主搜索条件 |
| | | let mainSearch = [] |
| | |
| | | }) |
| | | } |
| | | |
| | | filterComponent = (components, roleId, permAction, permMenus, balMap) => { |
| | | filterComponent = (components, roleId, permAction, permMenus, 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) |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus, balMap, skip) |
| | | return tab |
| | | }) |
| | | |
| | |
| | | return false |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap) |
| | | item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap, skip) |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter'].includes(item.type)) { |
| | | if ( |
| | | item.plot.blacklist && item.plot.blacklist.length > 0 && |
| | |
| | | } |
| | | |
| | | // 权限过滤 |
| | | let isHS = this.props.menuType === 'HS' |
| | | let tabId = this.props.Tab ? this.props.Tab.uuid : '' // 弹窗标签按钮Id |
| | | if (item.action && item.action.length > 0) { |
| | | item.action = item.action.filter(cell => { |
| | |
| | | cell.style = {...cell.style, ...cell.btnstyle} |
| | | } |
| | | |
| | | return isHS || permAction[cell.uuid] |
| | | return skip || permAction[cell.uuid] |
| | | }) |
| | | } |
| | | |
| | |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || isHS || permAction[cell.uuid] |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | | card.backElements = card.backElements.filter(cell => { |
| | | if (cell.eleType === 'button') { |
| | |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | return cell.eleType !== 'button' || isHS || permAction[cell.uuid] |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || isHS || permAction[cell.uuid] |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | | } else if ((item.type === 'table' && item.subtype === 'tablecard') || item.type === 'carousel') { |
| | | item.subcards && item.subcards.forEach(card => { |
| | |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | return cell.eleType !== 'button' || isHS || permAction[cell.uuid] |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | | }) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | |
| | | cell.style = {...cell.style, ...cell.btnstyle} |
| | | } |
| | | |
| | | return isHS || permAction[cell.uuid] |
| | | return skip || permAction[cell.uuid] |
| | | }) |
| | | return col.elements.length !== 0 |
| | | }) |