MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / exportExcelPost

Function exportExcelPost

ui/src/request/index.ts:351–381  ·  view source on GitHub ↗
(
  fileName: string,
  url: string,
  params: any,
  data: any,
  loading?: NProgress | Ref<boolean>,
)

Source from the content-addressed store, hash-verified

349 data: any,
350 loading?: NProgress | Ref<boolean>,
351) => Promise<any> = (
352 fileName: string,
353 url: string,
354 params: any,
355 data: any,
356 loading?: NProgress | Ref<boolean>,
357) => {
358 return promise(
359 request({
360 url: url,
361 method: 'post',
362 params, // 查询字符串参数
363 data, // 请求体数据
364 responseType: 'blob',
365 }),
366 loading,
367 ).then((res: any) => {
368 if (res) {
369 const blob = new Blob([res], {
370 type: 'application/vnd.ms-excel',
371 })
372 const link = document.createElement('a')
373 link.href = window.URL.createObjectURL(blob)
374 link.download = fileName
375 link.click()
376 // 释放内存
377 window.URL.revokeObjectURL(link.href)
378 }
379 return true
380 })
381}
382
383export const exportFilePost: (
384 fileName: string,

Callers 6

exportMulDocumentFunction · 0.90
postExportChatLogFunction · 0.90
exportMulDocumentFunction · 0.90
postExportChatLogFunction · 0.90
exportOperateLogFunction · 0.90
exportMulDocumentFunction · 0.90

Calls 1

promiseFunction · 0.70

Tested by

no test coverage detected