1.0.46 • Published 12 months ago
@wm-hosp/table-dragger-resizable v1.0.46
Installation
npm install @wm-hosp/table-dragger-resizable --saveUsage
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
| props | type | default | description | required |
|---|---|---|---|---|
| propsColumns | columnsProps[] | [] | columns source array | true |
| tableType | string | - | current table type | true |
| defaultcheckedColumns | array | - | dataIndex of the column selected by default | false |
| otherFetchParams | FetchParams[] | - | function object | false |
| isNotEllipsis | boolean | false | display with ellipsis | false |
| updatePropsColumns | boolean | true | wheather to show change button | false |
| isNotShowDragger | boolean | - | show filter column button | false |
| pagination | object | - | 同 antd | false |
| scroll | object | - | 同 antd | false |
| dataSource | [] | - | 同 antd | true |
注:其他与 antd 的 Table 属性保持一致
columnsProps
| props | type | default | description | required |
|---|---|---|---|---|
| title | string | - | column title | true |
| dataIndex | string | - | description | false |
| width | number | - | description | false |
| render | React.ReactNode | - | ReactNode | false |
| draggerTitle | string | - | Filter column drag name | false |
otherFetchParams
| props | type | default | description | required |
|---|---|---|---|---|
| fetchTableJson | function | - | Get database save | false |
| fetchUpdateTableJson | function | - | Update database | false |
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
| props | type | default | description | required |
|---|---|---|---|---|
| propsColumns | columnsProps[] | [] | columns source array | true |
| tableType | string | - | current table type | true |
| defaultcheckedColumns | array | - | dataIndex of the column selected by default | false |
| fetchTableJson | function | - | Get database save | false |
| fetchUpdateTableJson | function | - | Update database | false |
| onChange | function | - | Update current columns | false |
注:WmShowDraggerColumns 可与 WmTableDraggerResizable 一起使用,实现卡片表格的拖拽与显示
columnsProps
| props | type | default | description | required |
|---|---|---|---|---|
| title | string | - | column title | true |
| dataIndex | string | - | description | false |
| width | number | - | description | false |
| render | React.ReactNode | - | ReactNode | false |
| draggerTitle | string | - | Filter column drag name | false |
2.0.2
12 months ago
1.0.46
12 months ago
2.0.1
12 months ago
2.0.0
12 months ago
1.0.44
12 months ago
1.0.45
12 months ago
1.0.40
2 years ago
1.0.43
2 years ago
1.0.42
2 years ago
1.0.41
2 years ago
1.0.39
3 years ago
1.0.19
4 years ago
1.0.18
4 years ago
1.0.17
4 years ago
1.0.38
3 years ago
1.0.16
4 years ago
1.0.22
4 years ago
1.0.21
4 years ago
1.0.20
4 years ago
1.0.26
4 years ago
1.0.25
4 years ago
1.0.24
4 years ago
1.0.23
4 years ago
1.0.29
4 years ago
1.0.28
4 years ago
1.0.27
4 years ago
1.0.33
3 years ago
1.0.32
3 years ago
1.0.31
3 years ago
1.0.30
3 years ago
1.0.37
3 years ago
1.0.15
4 years ago
1.0.36
3 years ago
1.0.35
3 years ago
1.0.34
3 years ago
1.0.14
4 years ago
1.0.13
4 years ago
1.0.12
4 years ago
1.0.11
4 years ago
1.0.10
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago