From 2ae47e898b03f54b1d0e4315749fe955841033b0 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Tue, 11 Apr 2023 22:04:11 +0800 Subject: [PATCH] =?UTF-8?q?[/issues/409]=E5=AF=BC=E5=87=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=B2=A1=E6=9C=89=E6=8C=89=E6=8E=92=E5=BA=8F=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=AF=BC=E5=87=BA,=E8=AE=BE=E7=BD=AE=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E9=BB=98=E8=AE=A4=E6=8E=92=E5=BA=8F=EF=BC=8C=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=97=B6=E9=97=B4=E5=80=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/system/useListPage.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/hooks/system/useListPage.ts b/src/hooks/system/useListPage.ts index 81cc60f..a8c6152 100644 --- a/src/hooks/system/useListPage.ts +++ b/src/hooks/system/useListPage.ts @@ -69,13 +69,20 @@ export function useListPage(options: ListPageOptions) { if (realUrl) { let title = typeof name === 'function' ? name() : name; //update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导出报错,原因未知- - let paramsForm = {}; + let paramsForm:any = {}; try { paramsForm = await getForm().validate(); } catch (e) { console.error(e); } //update-end-author:taoyan date:20220507 for: erp代码生成 子表 导出报错,原因未知- + + //update-begin-author:liusq date:20230410 for:[/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序 + if(!paramsForm?.column){ + Object.assign(paramsForm,{column:'createTime',order:'desc'}); + } + //update-begin-author:liusq date:20230410 for: [/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序 + //如果参数不为空,则整合到一起 //update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导出动态设置mainId if (params) { @@ -90,6 +97,7 @@ export function useListPage(options: ListPageOptions) { if (selectedRowKeys.value && selectedRowKeys.value.length > 0) { paramsForm['selections'] = selectedRowKeys.value.join(','); } + console.log() return handleExportXls(title as string, realUrl, filterObj(paramsForm)); //update-end---author:wangshuai ---date:20220411 for:导出新增自定义参数-------------- } else {