1.0.43 • Published 10 months ago

@wm-hosp/table-dragger-resizable v1.0.43

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

Installation

npm install @wm-hosp/table-dragger-resizable --save

Usage

import * as React from 'react';
import { WmTableDraggerResizable } from '@wm-hosp/sum_react';

const TableDraggerResizable: React.FC<Props> = (props) => {
  return (
    <WmTableDraggerResizable
      bordered
      rowKey="id"
      dataSource={data}
      // loading={loading}
      tableType={'warehouseOrderList'}
      pagination={false}
      propsColumns={
        inboundType === 0
          ? this.columns
          : this.columns.filter((e) => !e.virtualHidden)
      }
      scroll={{ x: 1200 }}
      locale={{
        emptyText: loading ? '加载中...' : '暂无数据',
      }}
      rowClassName={(record: any) => {
        return record.hasRed ? 'hasRedIcon' : '';
      }}
      rowSelection={{
        selectedRowKeys,
        onChange: this.onSelectRowKeysChange,
        fixed: true,
      }}
      otherFetchParams={{
        fetchTableJson,
        fetchUpdateTableJson,
      }}
    >
      <div className="action-btn-radio">
        <div>
          <Button
            ghost
            type="primary"
            style={{ marginRight: 10 }}
            onClick={this.handleBatchOpenPrint}
          >
            批量打印
          </Button>
        </div>
      </div>
    </WmTableDraggerResizable>
  );
};

export default TableDraggerResizable;

Props

propstypedefaultdescriptionrequired
propsColumnscolumnsProps[][]columns source arraytrue
tableTypestring-current table typetrue
defaultcheckedColumnsarray-dataIndex of the column selected by defaultfalse
otherFetchParamsFetchParams[]-function objectfalse
isNotEllipsisbooleanfalsedisplay with ellipsisfalse
updatePropsColumnsbooleantruewheather to show change buttonfalse
isNotShowDraggerboolean-show filter column buttonfalse
paginationobject-同 antdfalse
scrollobject-同 antdfalse
dataSource[]-同 antdtrue

注:其他与 antd 的 Table 属性保持一致

columnsProps

propstypedefaultdescriptionrequired
titlestring-column titletrue
dataIndexstring-descriptionfalse
widthnumber-descriptionfalse
renderReact.ReactNode-ReactNodefalse
draggerTitlestring-Filter column drag namefalse

otherFetchParams

propstypedefaultdescriptionrequired
fetchTableJsonfunction-Get database savefalse
fetchUpdateTableJsonfunction-Update databasefalse
import * as React from 'react';
import { WmShowDraggerColumns } from '@wm-hosp/sum_react';

const ShowDraggerColumns: React.FC<Props> = (props) => {
  return (
    <WmShowDraggerColumns
      tableType={DYNAMIC_TABLE_TYPE.myOrderApplyColumns}
      propsColumns={[...this.columns]}
      defaultcheckedColumns={checkedColumns}
      onChange={(newColumns) => {
        this.setState({ countTime: (this.state.countTime || 0) + 1 });
        this.columns = newColumns;
      }}
      fetchTableJson={fetchTableJson}
      fetchUpdateTableJson={fetchUpdateTableJson}
    />
  );
};

export default ShowDraggerColumns;

Props

propstypedefaultdescriptionrequired
propsColumnscolumnsProps[][]columns source arraytrue
tableTypestring-current table typetrue
defaultcheckedColumnsarray-dataIndex of the column selected by defaultfalse
fetchTableJsonfunction-Get database savefalse
fetchUpdateTableJsonfunction-Update databasefalse
onChangefunction-Update current columnsfalse

注:WmShowDraggerColumns 可与 WmTableDraggerResizable 一起使用,实现卡片表格的拖拽与显示

columnsProps

propstypedefaultdescriptionrequired
titlestring-column titletrue
dataIndexstring-descriptionfalse
widthnumber-descriptionfalse
renderReact.ReactNode-ReactNodefalse
draggerTitlestring-Filter column drag namefalse
1.0.40

10 months ago

1.0.43

10 months ago

1.0.42

10 months ago

1.0.41

10 months ago

1.0.39

1 year ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.38

2 years ago

1.0.16

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.37

2 years ago

1.0.15

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago