修复 onExportXls defSort 不生效问题 #7570

pull/8722/head
JEECG 2025-08-13 09:26:16 +08:00
parent de7f23c555
commit 0fe258dbc2
1 changed files with 20 additions and 3 deletions

View File

@ -16,7 +16,10 @@ interface ListPageOptions {
// //
designScope?: string; designScope?: string;
// //
tableProps: TableProps; tableProps: TableProps & {
// defSort
defSort?: DefSort;
};
// //
pagination?: boolean; pagination?: boolean;
// //
@ -46,6 +49,11 @@ interface IDoRequestOptions {
clearSelection?: boolean; clearSelection?: boolean;
} }
interface DefSort {
column: string;
order: 'asc' | 'desc';
}
/** /**
* listPage页面公共方法 * listPage页面公共方法
* *
@ -85,8 +93,17 @@ export function useListPage(options: ListPageOptions) {
//update-end-author:taoyan date:20220507 for: erp - //update-end-author:taoyan date:20220507 for: erp -
//update-begin-author:liusq date:20230410 for:[/issues/409], //update-begin-author:liusq date:20230410 for:[/issues/409],
if(!paramsForm?.column){ //
Object.assign(paramsForm,{column:'createTime',order:'desc'}); const { defSort } = options?.tableProps ?? {};
if (defSort && !paramsForm?.column) {
// 使 defSort
Object.assign(paramsForm, {
column: (defSort as DefSort).column,
order: (defSort as DefSort).order,
});
} else if (!paramsForm?.column) {
// ,使
Object.assign(paramsForm, { column: 'createTime', order: 'desc' });
} }
//update-begin-author:liusq date:20230410 for: [/issues/409], //update-begin-author:liusq date:20230410 for: [/issues/409],