export.d1a777b9.js 997 B

1
  1. import{aF as s,a6 as E,az as r}from"./index.js";const{VITE_PROXY_DOMAIN_REAL:w,VITE_PROXY_USER_REAL:A,VITE_WORKORDER_REAL:o}=E(),p=o,d=o,R=(e,t)=>s.request("post",`${p}${e}`,{data:t,responseType:"blob"}),b=(e,t)=>s.request("post",`${d}${e}`,{data:t,responseType:"blob"});async function f(e){if(!e.url)return;e.onStart&&e.onStart();const a=await(e.admin===!1?b:R)(e.url,{...e.params}).catch(()=>e.onFail&&e.onFail()),{code:u}=a;if(Number(u)!==0&&e.onFail&&e.onFail(),a.type==="application/json"){r.warning("\u672A\u627E\u5230\u6570\u636E");return}if(r.warning("\u4E0B\u8F7D\u4E2D,\u8BF7\u7A0D\u7B49"),u&&Number(u)!==0){r.warning(a.message);return}function l(){const i=new Blob([a],{type:"application/vnd.ms-excel"}),c=window.URL.createObjectURL(i),n=document.createElement("a");n.style.display="none",n.href=c,n.setAttribute("download",e.name),document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(c),r.success("\u4E0B\u8F7D\u5B8C\u6210"),e.onSuccess&&e.onSuccess()}l()}export{f as h};