| | |
| | | deleteCol = (col) => { |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | |
| | | _columns = this.loopDelCol(_columns, col) |
| | | if (col.type === 'colspan' && col.subcols && col.subcols.length > 0) { |
| | | let Index = _columns.findIndex(item => item.uuid === col.uuid) |
| | | |
| | | if (Index !== -1) { |
| | | let list = col.subcols.map(item => { |
| | | item.isSub = false |
| | | return item |
| | | }) |
| | | |
| | | _columns.splice(Index, 1, ...list) |
| | | } else { |
| | | _columns = this.loopDelCol(_columns, col) |
| | | } |
| | | } else { |
| | | _columns = this.loopDelCol(_columns, col) |
| | | } |
| | | |
| | | this.setState({ |
| | | columns: _columns |