| | |
| | | |
| | | // 权限过滤 |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | config.components = this.filterComponent(config.components, roleId, permAction, permMenus) |
| | | let balMap = new Map() |
| | | config.components = this.filterComponent(config.components, roleId, permAction, permMenus, balMap) |
| | | |
| | | // 获取主搜索条件 |
| | | let mainSearch = [] |
| | |
| | | }) |
| | | } |
| | | |
| | | config.components = this.formatSetting(config.components, params, mainSearch, inherit, regs) |
| | | config.components = this.formatSetting(config.components, params, mainSearch, inherit, regs, balMap) |
| | | |
| | | if ([...balMap.keys()].length > 0) { |
| | | config.components = this.filterBalcony(config.components, balMap) |
| | | } |
| | | |
| | | this.setState({ |
| | | BID: BID, |
| | |
| | | }) |
| | | } |
| | | |
| | | filterComponent = (components, roleId, permAction, permMenus) => { |
| | | filterComponent = (components, roleId, permAction, permMenus, balMap) => { |
| | | 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) |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus, balMap) |
| | | return tab |
| | | }) |
| | | |
| | |
| | | return false |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, permAction, permMenus) |
| | | item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap) |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter'].includes(item.type)) { |
| | | if ( |
| | | item.plot.blacklist && item.plot.blacklist.length > 0 && |
| | |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | if (item.wrap.linkType === 'sync') { |
| | | item.wrap.syncModuleId = item.wrap.syncModule.pop() |
| | | balMap.set(item.wrap.syncModuleId, true) |
| | | } |
| | | item.elements = item.elements.filter(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | |
| | | }) |
| | | } |
| | | |
| | | |
| | | filterBalcony = (components, balMap) => { |
| | | return components.filter(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs = item.subtabs.map(tab => { |
| | | tab.components = this.filterBalcony(tab.components, balMap) |
| | | return tab |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | item.components = this.filterBalcony(item.components, balMap) |
| | | } |
| | | |
| | | if (item.type === 'balcony' && item.wrap.linkType === 'sync') { |
| | | let conf = balMap.get(item.wrap.syncModuleId) |
| | | |
| | | if (!conf || conf === true) { |
| | | return false |
| | | } |
| | | |
| | | item.syncConfig = { |
| | | uuid: conf.uuid, |
| | | wrap: conf.wrap, |
| | | setting: conf.setting, |
| | | columns: conf.columns |
| | | } |
| | | |
| | | if (item.wrap.checkAll === 'show') { |
| | | if (conf.subtype === 'datacard' && conf.wrap.cardType !== 'checkbox') { |
| | | item.wrap.checkAll = 'hidden' |
| | | } else if (conf.subtype === 'normaltable' && conf.wrap.tableType !== 'checkbox') { |
| | | item.wrap.checkAll = 'hidden' |
| | | } |
| | | } |
| | | } |
| | | |
| | | return true |
| | | }) |
| | | } |
| | | |
| | | getPrinter = (item, parentId) => { |
| | | let _item = window.GLOB.UserCacheMap.get(parentId + item.uuid) |
| | | |
| | |
| | | } |
| | | |
| | | // 格式化默认设置 |
| | | formatSetting = (components, params, mainSearch, inherit, regs) => { |
| | | formatSetting = (components, params, mainSearch, inherit, regs, balMap) => { |
| | | return components.map(component => { |
| | | if (component.type === 'tabs') { |
| | | component.subtabs = component.subtabs.map(tab => { |
| | | tab.components = this.formatSetting(tab.components, [], [], inherit, regs) |
| | | tab.components = this.formatSetting(tab.components, [], [], inherit, regs, balMap) |
| | | tab = {...tab, ...inherit} |
| | | return tab |
| | | }) |
| | | return component |
| | | } else if (component.type === 'group') { |
| | | component.components = this.formatSetting(component.components, [], [], inherit, regs) |
| | | component.components = this.formatSetting(component.components, [], [], inherit, regs, balMap) |
| | | component = {...component, ...inherit} |
| | | return component |
| | | } |
| | |
| | | } |
| | | } else if (component.floor === 1) { |
| | | component.setting.sync = 'false' |
| | | } |
| | | |
| | | if (balMap.has(component.uuid)) { |
| | | component.setting.$hasSyncModule = true |
| | | balMap.set(component.uuid, component) |
| | | } |
| | | |
| | | return component |
| | |
| | | } else if (item.type === 'balcony') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <Balcony menu={config} config={item} data={data} BID={_bid} menuType={menuType} /> |
| | | <Balcony config={item} data={data} BID={_bid} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'carousel' && item.subtype === 'datacard') { |