You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
741 B

import{h as e}from"./index-D5exsJys.js";var t=!1;function n(){return t}function r(e){return e==null||!Number.isFinite(e)||e<=0?``:e<1024*1024?`约 ${Math.max(1,Math.round(e/1024))} KB`:`约 ${(e/(1024*1024)).toFixed(1)} MB`}function i(n,i,a=`下载`){if(t)return e.warning(`附件正在${a}中,请勿重复点击`),null;t=!0;let o=n.trim()||`附件`,s=r(i),c=e({type:`info`,message:s?`正在准备${a}「${o}」(${s}),文件较大时请耐心等待…`:`正在准备${a}「${o}」,请稍候…`,duration:0,showClose:!0});return{setText:t=>{c.close(),c=e({type:`info`,message:t,duration:0,showClose:!0})},close:()=>{c.close(),t=!1}}}function a(){e.success(`下载已开始,请查看浏览器下载进度`)}export{n,a as r,i as t};