| | |
| | | * 1、 initdata 为打印时使用的数据集 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID } = this.props |
| | | const { data, initdata, BID, BData } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | let _data = null |
| | |
| | | item.key = index |
| | | item.$$uuid = item[_config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | |
| | | |
| | | this.setState({ |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | title: _config.wrap.title, |
| | | sync: _sync, |
| | | data: _data, |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | const { sync, config, setting, BID } = this.state |
| | | const { sync, config, setting, BID, BData } = this.state |
| | | |
| | | if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = [] |
| | |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { BID, setting, searchlist, actions, config, columns, selectedData } = this.state |
| | | const { BID, setting, searchlist, actions, config, columns, selectedData, BData } = this.state |
| | | |
| | | return ( |
| | | <div className="custom-normal-table" style={config.style}> |
| | |
| | | BID={BID} |
| | | setting={setting} |
| | | actions={actions} |
| | | BData={this.state.BData} |
| | | BData={BData} |
| | | columns={config.columns} |
| | | selectedData={selectedData} |
| | | /> |
| | |
| | | BID={BID} |
| | | setting={setting} |
| | | actions={actions} |
| | | BData={this.state.BData} |
| | | BData={BData} |
| | | columns={config.columns} |
| | | selectedData={selectedData} |
| | | /> |