/** * 导出所有的类型,方便pc和无线属性统一 */ import React, { ReactNode } from 'react'; import { TableProps } from '@alifd/next/types/table'; import { ButtonProps } from '@alifd/next/types/button'; import { ItemProps } from '@alifd/next/types/form'; export interface IFilterBar extends ItemProps { quick?: boolean; // 是否是快速过滤, 仅在mobile端使用 children?: React.ReactNode; } export interface IActionBar extends Omit { icon?: string | React.ReactNode; title?: string | React.ReactNode; hidden?: ({ value, index, record }: any) => boolean; onClick?: ({ value, index, record }: any) => void; render?: ReactNode; } // table的接口返回格式 export interface Result { total: number; list: any[]; } export interface ITablePro extends TableProps { children?: ReactNode; // TODO: PC已移除属性,改为filterPerLineNumber colSpan?: number | undefined; /** * @description 表格列,具体使用同Fusion Table Column(https://fusion.alibaba-inc.com/pc/component/table?spm=fusion-inc.yuque-inc-fusion.top-nav.d2pc.8288575eXwhFss&themeid=2#Table%20Column) * @default [] */ columns?: any[]; /** * @description 获取表格数据接口URI * @default */ getListUri?: string; /** * @description 获取表格数据接口方法,第一个参数为分页数据 { current, pageSize, sorter, filters },第二个参数为表单数据。生效优先级高于getListUri * @default */ getListHandle?: any; /** * @description 对象描述右上角按钮 * @default */ actionBar?: IActionBar[]; /** * @description 对象描述查询表单 * @default */ filterBar?: IFilterBar[]; /** * @description 查询表单部分每行显示个数 * @default 4 */ filterPerLineNumber?: number; /** * @description 可编辑模式,优先级高于simple * @default false */ editable?: boolean; /** * @description 简单模式 * @default false */ simple?: boolean; /** * @description 重置自定义方法,参数为reset方法 * @default */ onReset?: any; /** * @description 对象描述表格操作列 * @default */ actionColumn?: IActionBar[]; /** * @description 表格操作列宽度,不传会自动计算 * @default */ actionColumnWidth?: number; /** * @description 建议受控模式下使用 * @default */ dataSource?: any[]; } export interface ITablePro_PC extends React.FC { onRefresh?: any; run?: any; runAsync?: any; Column?: any; }