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/datatable/index.jsx | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/templates/zshare/modalform/datatable/index.jsx b/src/templates/zshare/modalform/datatable/index.jsx index 2a361f8..c6c3887 100644 --- a/src/templates/zshare/modalform/datatable/index.jsx +++ b/src/templates/zshare/modalform/datatable/index.jsx @@ -3,7 +3,7 @@ import { is, fromJS } from 'immutable' import { DndProvider, DragSource, DropTarget } from 'react-dnd' import { Table, Input, Popconfirm, Form, notification } from 'antd' -import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons' +import { PlusOutlined, EditOutlined, DeleteOutlined, SwapOutlined } from '@ant-design/icons' import Utils from '@/utils/utils.js' import FileUpload from '@/tabviews/zshare/fileupload' @@ -258,6 +258,7 @@ ) : ( <div className={'operation-btn' + (editingKey !== '' ? ' disabled' : '')}> <span className="primary" onClick={() => {editingKey === '' && this.edit(record.key)}}><EditOutlined /></span> + <span className="hide-control" title="鏄剧ず/闅愯棌" onClick={() => {editingKey === '' && this.handleHide(record.key)}}><SwapOutlined /></span> {editingKey === '' ? <Popconfirm overlayClassName="popover-confirm" title={this.props.dict['model.query.delete']} @@ -360,6 +361,20 @@ this.setState({ editingKey: key }) } + handleHide = (key) => { + let _data = this.state.data.map(item => { + if (item.key === key) { + item.Hide = !item.Hide + } + return item + }) + this.setState({ + data: _data + }, () => { + this.props.onChange(_data) + }) + } + moveRow = (dragIndex, hoverIndex) => { const { editingKey } = this.state let _data = fromJS(this.state.data).toJS() @@ -418,7 +433,7 @@ rowKey="key" dataSource={this.state.data} columns={columns} - rowClassName="editable-row" + rowClassName={(record) => record.Hide ? 'editable-row hide' : 'editable-row'} onRow={(record, index) => ({ index, moveAble: !this.state.editingKey, -- Gitblit v1.8.0