import type { TableParams } from '@/types' import type { ProTableProps } from '@ant-design/pro-table' /** * @description 规范化 table 请求参数 */ export function normalizeTableRequestParams>( ...args: Parameters>['request']> ): TableParams { const [{ current, pageSize, keyword, ...conditions }, sort] = args return { conditions: conditions as U, page: { current, size: pageSize }, sort: Object.entries(sort).map(([key, value]) => ({ property: key, direction: value === 'descend' ? 'desc' : 'asc', })), } }