import { TableProps } from 'ant-design-vue'; import { BaseResult, DataFormat, QueryData, SearchQuery } from '../interface'; import { ColumnType } from 'ant-design-vue/es/table'; export interface SearchTableProps extends Omit, 'dataSource' | 'loading' | 'components' | 'onChange' | 'rowSelection'> { /** 查询条件,使用 VcTableForm.useQuery 获取 */ query: SearchQuery; /** 数据请求接口 */ api: (params: P) => Promise>; /** 查询条件 → 接口参数转换 */ queryFormat: (queryData: Q) => P; /** 接口响应 → { rows, total } 转换 */ dataFormat: (responseData: BaseResult) => DataFormat; /** 是否启用右键导出(复杂表头不要用) */ exported?: boolean; /** 显示序号列 */ showIndex?: boolean | ColumnType; /** 行选择回调;传入则启用行选择,每次翻页/查询会清空选择 */ onSelectedRows?: (rows: T[]) => void; } /** VcTable 通过 ref 暴露的方法集合 */ export type SearchTableInstance = { /** 获取当前展示中(isShow 为 true)且非操作列的字段 title 数组 */ getColumns: () => unknown[]; };