| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | if (!is(fromJS(this.props.linkSubFields), fromJS(nextProps.linkSubFields)) || this.props.type !== nextProps.type) { |
| | | this.resetColumn(nextProps.type, nextProps.linkSubFields) |
| | | } else if (!is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = [] |
| | | nextProps.data.forEach(item => { |
| | | let _item = {key: Utils.getuuid()} |
| | | this.state.columns.forEach(col => { |
| | | _item[col.dataIndex] = item[col.dataIndex] || '' |
| | | if (col.dataIndex !== 'ParentID' && !_item[col.dataIndex]) { |
| | | _item[col.dataIndex] = item.Text |
| | | } |
| | | }) |
| | | _data.push(_item) |
| | | }) |
| | | this.setState({ |
| | | dataSource: _data, |
| | | count: nextProps.data.length |
| | | }) |
| | | } |
| | | } |
| | | |