优化Table
parent
3ef5cb8e19
commit
05d3bb9e22
|
|
@ -1,11 +1,11 @@
|
||||||
import type { ProTableProps } from "@ant-design/pro-table";
|
import type { ProTableProps } from "@ant-design/pro-table";
|
||||||
import type { TableProps } from "antd";
|
import type { TableProps as AntdTableProps } from "antd";
|
||||||
import type { FC } from "react";
|
import type { FC } from "react";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TablePro 组件属性
|
* TablePro 组件属性
|
||||||
*/
|
*/
|
||||||
export type TableProProps<DataSource, U, ValueType> = Omit<TableProps, 'columns'> & ProTableProps<DataSource, U, ValueType> & {
|
export type TableProps<DataSource, U, ValueType> = Omit<AntdTableProps, 'columns'> & ProTableProps<DataSource, U, ValueType> & {
|
||||||
/** 当一个路由下存在多个表格的情况下 需要给每一个表格设置一个唯一存储索引 若没有设置则使用默认索引,请注意缓存数据会被覆盖 */
|
/** 当一个路由下存在多个表格的情况下 需要给每一个表格设置一个唯一存储索引 若没有设置则使用默认索引,请注意缓存数据会被覆盖 */
|
||||||
storeIndex?: string;
|
storeIndex?: string;
|
||||||
/** 是否禁用内容区滚动,默认 false */
|
/** 是否禁用内容区滚动,默认 false */
|
||||||
|
|
@ -21,5 +21,5 @@ export type TableProProps<DataSource, U, ValueType> = Omit<TableProps, 'columns'
|
||||||
/**
|
/**
|
||||||
* 表格组件
|
* 表格组件
|
||||||
*/
|
*/
|
||||||
declare const TablePro: <DataSource, U, ValueType = "text">(props: TableProProps<DataSource, U, ValueType>) => ReturnType<FC>;
|
declare const Table: <DataSource, U, ValueType = "text">(props: TableProps<DataSource, U, ValueType>) => ReturnType<FC>;
|
||||||
export default TablePro;
|
export default Table;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import Table from "@cqsjjb/jjb-react-admin-component/Table";
|
||||||
import { getIndexColumn } from "../../utils/index";
|
import { getIndexColumn } from "../../utils/index";
|
||||||
import "./index.less";
|
import "./index.less";
|
||||||
|
|
||||||
function TablePro(props) {
|
function Table(props) {
|
||||||
const {
|
const {
|
||||||
columns = [],
|
columns = [],
|
||||||
showIndexColumn = true,
|
showIndexColumn = true,
|
||||||
|
|
@ -18,4 +18,4 @@ function TablePro(props) {
|
||||||
return <Table rowKey={rowKey} columns={calcColumns()} {...restProps} />;
|
return <Table rowKey={rowKey} columns={calcColumns()} {...restProps} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TablePro;
|
export default Table;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue