TableSelectNormal.js 1.3 KB
Newer Older
钟是志's avatar
钟是志 committed
1 2 3 4 5 6 7 8 9 10 11 12 13
import React, { Fragment, useEffect, useRef, useState } from 'react';
import { Button, Table } from 'antd';
import TableSelectZhanWei from '@/webPublic/one_stop_public/libs/Split/TableSelectZhanWei';

export default function TableSelectNormal(props) {
  const {
    isMultiple, isShowQuanXuan,
    selectAll, cancelAll,
    valueName, dataSource,
    columns3, allWidth,
    get, otherProps,
  } = props;

钟是志's avatar
钟是志 committed
14 15
  if(otherProps && otherProps.showType === 'card-select'){
    return <TableSelectZhanWei {...props} otherProps={otherProps}/>;
钟是志's avatar
钟是志 committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
  }
  return (
    <Fragment>
      {isMultiple && isShowQuanXuan !== false && (
        <>
          {' '}
          <Button
            id={'quanXuanButton'}
            type={'primary'}
            style={{ margin: '0 10px 10px 0' }}
            onClick={selectAll}>
            全选
          </Button>
          <Button
            id={'quXiaoQuanXuanButton'}
            type={'primary'}
            style={{ marginBottom: '10px' }}
            onClick={cancelAll}>
            取消全选
          </Button>
        </>
      )}
      <Table
        rowKey={valueName}
        size='small'
        dataSource={dataSource.list}
        columns={columns3}
        scroll={{ x: get === 'mobile' ? 'max-content' : allWidth }}
      />
    </Fragment>
  );
}