From 316877c1d9e5b6d92334f30b03d97d7e833cd934 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 02 二月 2021 16:01:57 +0800 Subject: [PATCH] 2021-02-02 --- 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