From 966ff7fb84181f0fa86a56569a8492453c3ae80a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 26 八月 2021 14:56:42 +0800 Subject: [PATCH] 2021-08-26 --- src/templates/zshare/editTable/index.jsx | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/templates/zshare/editTable/index.jsx b/src/templates/zshare/editTable/index.jsx index 5e1d00b..b431aca 100644 --- a/src/templates/zshare/editTable/index.jsx +++ b/src/templates/zshare/editTable/index.jsx @@ -14,6 +14,7 @@ let eTDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS const EditableContext = React.createContext() +const { confirm } = Modal let dragingIndex = -1 const { Paragraph } = Typography @@ -185,12 +186,11 @@ operation = { title: (<div> {eTDict['model.operation']} - {actions.includes('copy') ? ( - <span className="copy-control"> - <Icon type="copy" onClick={() => this.copy()} /> - <Icon type="snippets" onClick={this.paste} /> - </span> - ) : null} + <span className="copy-control"> + {actions.includes('copy') ? <Icon type="copy" title="澶嶅埗" onClick={() => this.copy()} /> : null} + {actions.includes('copy') ? <Icon type="snippets" title="绮樿创" onClick={this.paste} /> : null} + {actions.includes('clear') ? <Icon type="delete" title="娓呯┖" onClick={this.clear} /> : null} + </span> </div>), dataIndex: 'operation', width: '140px', @@ -271,6 +271,21 @@ this.setState({ editingKey: '' }) } + clear = () => { + const _this = this + + confirm({ + title: '纭畾娓呯┖鍒楄〃鍚楋紵', + content: '', + onOk() { + _this.setState({ data: [], editingKey: '' }, () => { + _this.props.onChange([]) + }) + }, + onCancel() {} + }) + } + copy = (item) => { const { type } = this.props const { data } = this.state -- Gitblit v1.8.0