| | |
| | | }) |
| | | } |
| | | |
| | | config.$cache = config.cacheLocal === 'true' |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, config.$cache, Tab.uuid, Tab.uuid) |
| | | config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, Tab.uuid, Tab.uuid) |
| | | |
| | | // 获取主搜索条件 |
| | | config.components.forEach(component => { |
| | |
| | | |
| | | let params = [] |
| | | let BID = param.$BID || '' |
| | | let inherit = {} |
| | | |
| | | if (config.cacheUseful === 'true') { // 缓存继承 |
| | | inherit.cacheUseful = config.cacheUseful |
| | | inherit.timeUnit = config.timeUnit |
| | | inherit.cacheTime = config.cacheTime |
| | | } |
| | | |
| | | config.components = this.formatSetting(config.components, params, inherit, regs, balMap) |
| | | config.components = this.formatSetting(config.components, params, regs, balMap) |
| | | |
| | | if ([...balMap.keys()].length > 0) { |
| | | config.components = this.filterBalcony(config.components, balMap) |
| | |
| | | }) |
| | | } |
| | | |
| | | filterComponent = (components, roleId, balMap, urlparam, Tab, cache, searchId, syncId) => { |
| | | filterComponent = (components, roleId, balMap, urlparam, Tab, searchId, syncId) => { |
| | | return components.filter(item => { |
| | | item.$pageId = Tab.uuid |
| | | item.$cache = cache |
| | | item.$searchId = searchId |
| | | item.$syncId = syncId |
| | | |
| | |
| | | } |
| | | }) |
| | | |
| | | tab.components = this.filterComponent(tab.components, roleId, balMap, urlparam, Tab, cache, _searchId, tab.uuid) |
| | | tab.components = this.filterComponent(tab.components, roleId, balMap, urlparam, Tab, _searchId, tab.uuid) |
| | | return tab |
| | | }) |
| | | |
| | |
| | | return false |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, balMap, urlparam, Tab, cache, searchId, syncId) |
| | | item.components = this.filterComponent(item.components, roleId, balMap, urlparam, Tab, searchId, syncId) |
| | | |
| | | return true |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) { |
| | |
| | | } |
| | | |
| | | // 格式化默认设置 |
| | | formatSetting = (components, params, inherit, regs, balMap) => { |
| | | formatSetting = (components, params, regs, balMap) => { |
| | | let delay = 20 |
| | | return components.map(component => { |
| | | if (component.type === 'tabs') { |
| | | component.subtabs = component.subtabs.map(tab => { |
| | | tab.components = this.formatSetting(tab.components, null, null, inherit, regs, balMap) |
| | | tab = {...tab, ...inherit} |
| | | tab.components = this.formatSetting(tab.components, null, regs, balMap) |
| | | return tab |
| | | }) |
| | | return component |
| | | } else if (component.type === 'group') { |
| | | component.components = this.formatSetting(component.components, params, null, regs, balMap) |
| | | component.components = this.formatSetting(component.components, params, regs, balMap) |
| | | return component |
| | | } else if (component.wrap && component.wrap.datatype === 'public') { |
| | | component.setting.useMSearch = false |
| | |
| | | |
| | | return ( |
| | | <div className={'pop-page-wrap ' + (loading ? 'loading' : '')} style={config ? config.style : null}> |
| | | {loading && !config.$cache ? <Spin className="view-spin" size="large" /> : null} |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | | <Row className="component-wrap">{this.getComponents()}</Row> |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | </div> |