| | |
| | | }) |
| | | } |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, balMap, param, Tab) |
| | | config.$cache = config.cacheLocal === 'true' |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, config.$cache) |
| | | |
| | | // 获取主搜索条件 |
| | | let mainSearch = [] |
| | |
| | | }) |
| | | } |
| | | |
| | | filterComponent = (components, roleId, balMap, urlparam, Tab) => { |
| | | filterComponent = (components, roleId, balMap, urlparam, Tab, cache) => { |
| | | return components.filter(item => { |
| | | item.$pageId = Tab.uuid |
| | | item.$cache = cache |
| | | |
| | | if (item.style && item.style.boxShadow) { |
| | | delete item.style.hShadow |
| | |
| | | item.subtabs = item.subtabs.map(tab => { |
| | | tab.$pageId = Tab.uuid |
| | | |
| | | tab.components = this.filterComponent(tab.components, roleId, balMap, urlparam, Tab) |
| | | tab.components = this.filterComponent(tab.components, roleId, balMap, urlparam, Tab, cache) |
| | | return tab |
| | | }) |
| | | |
| | |
| | | return false |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, balMap, urlparam, Tab) |
| | | item.components = this.filterComponent(item.components, roleId, balMap, urlparam, Tab, cache) |
| | | |
| | | return true |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) { |
| | |
| | | * @description 主表数据加载 |
| | | */ |
| | | loadmaindata = (params) => { |
| | | let param = getStructuredParams(params, this.state.config, this.state.BID || '') |
| | | const { config } = this.state |
| | | let param = getStructuredParams(params, config, this.state.BID || '') |
| | | |
| | | this.setState({loading: true}) |
| | | |
| | |
| | | delete result.message |
| | | delete result.ErrMesg |
| | | delete result.ErrCode |
| | | |
| | | if (config.$cache) { |
| | | params.forEach((item) => { |
| | | let _data = result[item.name] || '' |
| | | if (_data && !Array.isArray(_data)) { |
| | | _data = [_data] |
| | | } |
| | | Api.writeCacheConfig(item.uuid, _data) |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | data: result, |
| | |
| | | |
| | | return ( |
| | | <div className={'pop-page-wrap ' + (loading ? 'loading' : '')} style={config ? config.style : null}> |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | | {loading && !config.$cache ? <Spin className="view-spin" size="large" /> : null} |
| | | <Row className="component-wrap">{this.getComponents()}</Row> |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | </div> |