| | |
| | | * @description 主表数据加载 |
| | | */ |
| | | async loadmaindata () { |
| | | const { setting } = this.state |
| | | const { setting, BIDs } = this.state |
| | | |
| | | if (setting.datatype !== 'query') return |
| | | if (setting.datatype !== 'query') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未设置数据查询配置!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let param = null |
| | | |
| | |
| | | data: _data, |
| | | primaryId: _primaryId, |
| | | BIDs: { |
| | | ...BIDs, |
| | | mainTable: _primaryId, |
| | | mainTabledata: _data |
| | | } |
| | |
| | | /** |
| | | * @description 按钮操作完成后(成功或失败),页面刷新,重置页码及选择项 |
| | | */ |
| | | refreshbyaction = (btn, type, primaryId) => { |
| | | refreshbyaction = (btn, type, primaryId, formdata) => { |
| | | const { BIDs } = this.state |
| | | |
| | | if (type === 'success' && btn.afterExecSuccess === 'notclose') { |
| | | this.setState({ |
| | | primaryId: primaryId |
| | | }, () => { |
| | | if (btn.execSuccess === 'refresh') { |
| | | this.loadmaindata() |
| | | } else { |
| | | let data = {} |
| | | |
| | | if (formdata && formdata.length > 0) { |
| | | formdata.forEach(item => { |
| | | data[item.key] = item.value |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | BIDs: { |
| | | ...BIDs, |
| | | mainTable: primaryId, |
| | | mainTabledata: data |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } else if (type === 'success' && btn.afterExecSuccess === 'close') { |
| | |
| | | refreshdata={this.refreshbyaction} |
| | | /> : null |
| | | } |
| | | {setting && setting.onload !== 'false' && |
| | | config.tabgroups.map(group => { |
| | | {!loadingview && !viewlost && config.tabgroups.map(group => { |
| | | if (config[group].length === 0) return null |
| | | |
| | | return ( |