king
2023-04-05 4c538565bd930279c9e32234617aa25804b19dee
src/templates/zshare/editTable/index.jsx
@@ -163,6 +163,7 @@
class EditTable extends Component {
  static propTpyes = {
    actions: PropTypes.any,         // 操作项
    searchKey: PropTypes.any,       // 搜索条件
    data: PropTypes.any,            // 数据列表
    columns: PropTypes.array,       // 显示列
    onChange: PropTypes.func        // 数据变化
@@ -585,7 +586,7 @@
  }
  render() {
    const { actions, indexShow } = this.props
    const { actions, indexShow, searchKey } = this.props
    const { editLineId } = this.state
    let components = {
@@ -595,7 +596,7 @@
    }
    let moveprops = {}
    if (actions.includes('move')) {
    if (actions.includes('move') && !searchKey) {
      components.body.row = DragableBodyRow
      moveprops.moveAble = !this.state.editingKey
      moveprops.moveRow = this.moveRow
@@ -641,6 +642,8 @@
      return item
    })
    let reg = searchKey ? new RegExp(searchKey, 'ig') : null
    return (
      <EditableContext.Provider value={this.props.form}>
        <div className="modal-edit-table">
@@ -651,7 +654,18 @@
              components={components}
              dataSource={data}
              columns={columns}
              rowClassName={record => !editLineId || editLineId !== record.uuid ? 'editable-row' : 'editable-row active'}
              rowClassName={record => {
                let className = 'editable-row'
                if (editLineId && editLineId === record.uuid) {
                  className += ' active'
                }
                if (searchKey) {
                  if (!reg.test(record.field) && !reg.test(record.label)) {
                    className += ' hidden'
                  }
                }
                return className
              }}
              pagination={false}
              onRow={(record, index) => ({
                index,