| | |
| | | * @description 监听到显示列复制时,触发显示列编辑 |
| | | */ |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { config } = this.props |
| | | const { columnlist } = this.state |
| | | |
| | | if ( |
| | | nextProps.pasteContent && |
| | | columnlist.length === 0 && |
| | | nextProps.pasteContent.columns && |
| | | nextProps.pasteContent.copyType === 'columns' && |
| | | nextProps.pasteContent.columns.length > 0 |
| | | ) { |
| | | this.setState({columnlist: nextProps.pasteContent.columns}) |
| | | } else if (!is(fromJS(nextProps.config.columns), fromJS(this.props.config.columns)) && !is(fromJS(nextProps.config.columns), fromJS(columnlist))) { |
| | | if (columnlist.filter(col => !col.origin).length === 0) { |
| | | this.setState({columnlist: nextProps.pasteContent.columns}, () => { |
| | | this.props.updatecolumn({...config, columns: nextProps.pasteContent.columns}) |
| | | }) |
| | | } |
| | | } else if (!is(fromJS(nextProps.config.columns), fromJS(config.columns)) && !is(fromJS(nextProps.config.columns), fromJS(columnlist))) { |
| | | this.setState({columnlist: fromJS(nextProps.config.columns).toJS()}) |
| | | } |
| | | } |