| | |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | |
| | | let col = { focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: item.subType, elements: [] } |
| | | if (col.type === 'colspan') { |
| | | col.subcols = [] |
| | | } else if (col.type === 'action') { |
| | | col.label = '操作' |
| | | } else if (col.type === 'index') { |
| | | col.label = '序号' |
| | | } |
| | | |
| | | _columns.splice(hoverIndex, 0, col) |
| | | |
| | |
| | | loopCol = (columns, col) => { |
| | | return columns.map(column => { |
| | | if (column.type === 'colspan') { |
| | | column.subcols = this.loopCol(column.subcols, col) |
| | | column.subcols = this.loopCol(column.subcols || [], col) |
| | | } |
| | | if (column.uuid === col.uuid) { |
| | | return col |