ims-front/src/api/material/mods/material/downloadExcel.ts
my_ong 04afb056c3
All checks were successful
Release / lint (push) Successful in 50s
Release / Release (push) Successful in 2m0s
sparkles: 要加物料类型筛选
2025-03-23 10:10:29 +08:00

29 lines
663 B
TypeScript

/**
* @desc 导出物料列表
*/
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
import type { AxiosResponse } from 'axios'
export interface Params {
/** 类型 */
type?: string
/** 搜索关键词 */
key?: string
}
export default async function (
params: Params,
success: (data: void) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'get',
url: `/material/download-excel`,
params,
})
.then((data: AxiosResponse<void, unknown>) => {
success(data.data)
})
.catch((error: { code: string; error?: string }) => fail(error))
}