| | |
| | | UNSAFE_componentWillMount () { |
| | | let _config = fromJS(this.props.config).toJS() |
| | | |
| | | let params = [] |
| | | if (_config.type !== 'group') { |
| | | let params = [] |
| | | |
| | | _config.components = this.formatSetting(_config.components, params) |
| | | |
| | | if (params.length > 0) { |
| | | this.loadmaindata(params) |
| | | } |
| | | } else { |
| | | let delay = 110 |
| | | _config.components.forEach(item => { |
| | |
| | | |
| | | this.setState({ |
| | | config: _config |
| | | }, () => { |
| | | if (params.length > 0) { |
| | | this.loadmaindata(params) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | let param = getStructuredParams(params, config, BID) |
| | | |
| | | if (config.$cache && config.$time) { |
| | | Api.getLCacheConfig(params[0].uuid, config.$time).then(res => { |
| | | if (!res.valid) { |
| | | this.getMainData(param, params, config.uuid) |
| | | } |
| | | }) |
| | | } else { |
| | | this.getMainData(param, params, config.uuid) |
| | | } |
| | | } |
| | | |
| | | getMainData = (param, params, tabId) => { |
| | | Api.genericInterface(param).then(result => { |
| | | if (result.status) { |
| | | if (result.message) { |
| | |
| | | window.GLOB.SyncData.set(item.name, _data) |
| | | }) |
| | | |
| | | MKEmitter.emit('transferSyncData', config.uuid) |
| | | MKEmitter.emit('transferSyncData', tabId) |
| | | } else { |
| | | MKEmitter.emit('transferSyncData', config.uuid) |
| | | MKEmitter.emit('transferSyncData', tabId) |
| | | |
| | | if (!result.message) return |
| | | if (result.ErrCode === 'N') { |