| | |
| | | |
| | | copyDatasource = () => { |
| | | const { config } = this.props |
| | | const { columns, scripts } = this.state |
| | | |
| | | if (columns.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请添加字段集!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | const { columns, subColumns, scripts } = this.state |
| | | |
| | | this.settingForm.handleConfirm().then(res => { |
| | | delete res.supModule |
| | |
| | | let source = { |
| | | key: 'interface', |
| | | type: 'line', |
| | | data: {setting: res, columns, scripts, pageable: false, format: 'array', name: res.name, status: 'false', type: 'interface', uuid: '' } |
| | | data: {setting: res, columns, subColumns, scripts, pageable: false, format: 'array', name: res.name, status: 'false', type: 'interface', uuid: '' } |
| | | } |
| | | |
| | | try { |
| | |
| | | } |
| | | |
| | | if (config.subtype !== 'basetable') { |
| | | let subColumns = [] |
| | | |
| | | if (config.subtype === 'dualdatacard' && res.data.subColumns) { |
| | | subColumns = res.data.subColumns.map(col => { |
| | | col.uuid = Utils.getuuid() |
| | | return col |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | scripts: res.data.scripts.map(col => { |
| | | col.uuid = Utils.getuuid() |
| | |
| | | col.uuid = Utils.getuuid() |
| | | return col |
| | | }), |
| | | subColumns: subColumns, |
| | | setting: res.data.setting, |
| | | median: res.data.setting, |
| | | reload: true, |
| | |
| | | {!reload ? <SettingForm |
| | | config={config} |
| | | columns={columns} |
| | | subColumns={subColumns} |
| | | setting={setting} |
| | | scripts={scripts} |
| | | updateStatus={(res) => this.setState({median: {...res}})} |