From c3560a52e2baaf82a20b716a5db138b266da93dd Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Wed, 7 Dec 2022 15:41:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20vxe=20=E5=AF=BC=E5=87=BA=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts index 7a1573693..7bced0ffe 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts @@ -15,6 +15,7 @@ interface UseVxeGridConfig { treeConfig?: VxeTablePropTypes.TreeConfig // 树形表单配置 isList?: boolean // 是否不带分页的list getListApi: (option: any) => Promise // 获取列表接口 + getAllListApi?: (option: any) => Promise // 获取全部数据接口 用于VXE导出 deleteApi?: (option: any) => Promise // 删除接口 exportListApi?: (option: any) => Promise // 导出接口 exportName?: string // 导出文件夹名称 @@ -99,8 +100,8 @@ export const useVxeGrid = (config?: UseVxeGridConfig) => { queryAll: ({ form }) => { const queryParams = Object.assign({}, JSON.parse(JSON.stringify(form))) return new Promise(async (resolve) => { - if (config?.exportListApi) { - resolve(await config?.exportListApi(queryParams)) + if (config?.getAllListApi) { + resolve(await config?.getAllListApi(queryParams)) } else { resolve(await config?.getListApi(queryParams)) } @@ -113,7 +114,7 @@ export const useVxeGrid = (config?: UseVxeGridConfig) => { // 默认选中类型 type: 'csv', // 自定义数据量列表 - modes: config?.exportListApi ? ['current', 'all'] : ['current'], + modes: config?.getAllListApi ? ['current', 'all'] : ['current'], columns: config?.allSchemas.printSchema } })