From 5ca389a3b7bfc54067547e2b8663ce413f602f3f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 31 一月 2021 20:41:30 +0800 Subject: [PATCH] 2021-01-31 --- src/templates/zshare/editTable/index.jsx | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/templates/zshare/editTable/index.jsx b/src/templates/zshare/editTable/index.jsx index feb862e..f78cdb1 100644 --- a/src/templates/zshare/editTable/index.jsx +++ b/src/templates/zshare/editTable/index.jsx @@ -172,7 +172,15 @@ 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') ? ( @@ -213,7 +221,13 @@ </div> ) } - }) + } + + if (_operation) { + operation.render = _operation.render + operation.width = _operation.width + } + columns.push(operation) } this.setState({ -- Gitblit v1.8.0