feat: P0-6 Excel导入导出全套(客户/合同/库存/统计, 自动表头探测)

This commit is contained in:
HHY
2026-09-25 03:30:27 -07:00
parent 436d006b5a
commit 40c16d56a1
14 changed files with 367 additions and 9 deletions
+8
View File
@@ -51,3 +51,11 @@ export async function apiDownload(url: string, filename: string): Promise<void>
link.click()
URL.revokeObjectURL(link.href)
}
/** 上传文件(multipart,自动带 token),返回 envelope data */
export async function apiUpload<T = any>(url: string, file: File): Promise<T> {
const fd = new FormData()
fd.append('file', file)
const res = await http.post(url, fd, { headers: { 'Content-Type': 'multipart/form-data' } })
return res.data.data as T
}