mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-10-31 10:37:41 +08:00 
			
		
		
		
	fix: vxe 导出全部功能
This commit is contained in:
		| @ -15,6 +15,7 @@ interface UseVxeGridConfig<T = any> { | |||||||
|   treeConfig?: VxeTablePropTypes.TreeConfig // 树形表单配置 |   treeConfig?: VxeTablePropTypes.TreeConfig // 树形表单配置 | ||||||
|   isList?: boolean // 是否不带分页的list |   isList?: boolean // 是否不带分页的list | ||||||
|   getListApi: (option: any) => Promise<T> // 获取列表接口 |   getListApi: (option: any) => Promise<T> // 获取列表接口 | ||||||
|  |   getAllListApi?: (option: any) => Promise<T> // 获取全部数据接口 用于VXE导出 | ||||||
|   deleteApi?: (option: any) => Promise<T> // 删除接口 |   deleteApi?: (option: any) => Promise<T> // 删除接口 | ||||||
|   exportListApi?: (option: any) => Promise<T> // 导出接口 |   exportListApi?: (option: any) => Promise<T> // 导出接口 | ||||||
|   exportName?: string // 导出文件夹名称 |   exportName?: string // 导出文件夹名称 | ||||||
| @ -99,8 +100,8 @@ export const useVxeGrid = <T = any>(config?: UseVxeGridConfig<T>) => { | |||||||
|         queryAll: ({ form }) => { |         queryAll: ({ form }) => { | ||||||
|           const queryParams = Object.assign({}, JSON.parse(JSON.stringify(form))) |           const queryParams = Object.assign({}, JSON.parse(JSON.stringify(form))) | ||||||
|           return new Promise(async (resolve) => { |           return new Promise(async (resolve) => { | ||||||
|             if (config?.exportListApi) { |             if (config?.getAllListApi) { | ||||||
|               resolve(await config?.exportListApi(queryParams)) |               resolve(await config?.getAllListApi(queryParams)) | ||||||
|             } else { |             } else { | ||||||
|               resolve(await config?.getListApi(queryParams)) |               resolve(await config?.getListApi(queryParams)) | ||||||
|             } |             } | ||||||
| @ -113,7 +114,7 @@ export const useVxeGrid = <T = any>(config?: UseVxeGridConfig<T>) => { | |||||||
|       // 默认选中类型 |       // 默认选中类型 | ||||||
|       type: 'csv', |       type: 'csv', | ||||||
|       // 自定义数据量列表 |       // 自定义数据量列表 | ||||||
|       modes: config?.exportListApi ? ['current', 'all'] : ['current'], |       modes: config?.getAllListApi ? ['current', 'all'] : ['current'], | ||||||
|       columns: config?.allSchemas.printSchema |       columns: config?.allSchemas.printSchema | ||||||
|     } |     } | ||||||
|   }) |   }) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 xingyu4j
					xingyu4j