From f393af9623c26ae177a3f69b8676afc4e23bff8d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 08 二月 2022 14:48:51 +0800 Subject: [PATCH] 2022-02-08 --- src/templates/zshare/modalform/modaleditable/index.jsx | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/src/templates/zshare/modalform/modaleditable/index.jsx b/src/templates/zshare/modalform/modaleditable/index.jsx index 8670071..06714d0 100644 --- a/src/templates/zshare/modalform/modaleditable/index.jsx +++ b/src/templates/zshare/modalform/modaleditable/index.jsx @@ -222,6 +222,20 @@ }) } + handleHide = (record) => { + let _data = this.state.dataSource.map(item => { + if (item.key === record.key) { + item.Hide = !item.Hide + } + return item + }) + this.setState({ + dataSource: _data + }, () => { + this.props.onChange(_data) + }) + } + handleDelete = key => { const { dataSource } = this.state let _data = dataSource.filter(item => item.key !== key) @@ -336,6 +350,7 @@ <div style={{fontSize: '15px'}}> <span className="operation-btn" onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><ArrowUpOutlined /></span> <span className="operation-btn" onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><ArrowDownOutlined /></span> + <span className="operation-btn" title="鏄剧ず/闅愯棌" onClick={() => this.handleHide(record)} style={{color: 'rgb(142, 68, 173)'}}><SwapOutlined /></span> <Popconfirm title="纭畾鍒犻櫎鍚楋紵" overlayClassName="popover-confirm" @@ -420,7 +435,7 @@ <PlusOutlined className="add-row" onClick={this.handleAdd} /> <Table components={components} - rowClassName={() => 'editable-row'} + rowClassName={(record) => record.Hide ? 'editable-row hide' : 'editable-row'} bordered dataSource={dataSource} columns={columns} -- Gitblit v1.8.0