| | |
| | | let columns = fromJS(this.props.columns).toJS() |
| | | |
| | | if (actions && (actions.includes('edit') || actions.includes('copy') || actions.includes('del'))) { |
| | | columns.push({ |
| | | let _operation = null |
| | | columns = columns.filter(item => { |
| | | if (item.dataIndex === 'operation') { |
| | | _operation = item |
| | | } |
| | | return item.dataIndex !== 'operation' |
| | | }) |
| | | |
| | | let operation = { |
| | | title: (<div> |
| | | {eTDict['model.operation']} |
| | | {actions.includes('copy') ? ( |
| | |
| | | </div> |
| | | ) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (_operation) { |
| | | operation.render = _operation.render |
| | | operation.width = _operation.width |
| | | } |
| | | columns.push(operation) |
| | | } |
| | | |
| | | this.setState({ |