mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-03 00:10:38 +00:00
2 lines
3.6 KiB
JavaScript
2 lines
3.6 KiB
JavaScript
import{Y as w}from"./element-plus-D1Ezoxxm.js";import{w as A,S as j,u as x}from"./xlsx-DvXcP_SB.js";var E={exports:{}};(function(a,u){(function(f,t){t()})(w,function(){function f(e,n){return typeof n>"u"?n={autoBom:!1}:typeof n!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),n={autoBom:!n}),n.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function t(e,n,l){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){v(r.response,n,l)},r.onerror=function(){console.error("could not download file")},r.send()}function i(e){var n=new XMLHttpRequest;n.open("HEAD",e,!1);try{n.send()}catch{}return 200<=n.status&&299>=n.status}function s(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof w=="object"&&w.global===w?w:void 0,p=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),v=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!p?function(e,n,l){var r=o.URL||o.webkitURL,c=document.createElement("a");n=n||e.name||"download",c.download=n,c.rel="noopener",typeof e=="string"?(c.href=e,c.origin===location.origin?s(c):i(c.href)?t(e,n,l):s(c,c.target="_blank")):(c.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(c.href)},4e4),setTimeout(function(){s(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,l){if(n=n||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(f(e,l),n);else if(i(e))t(e,n,l);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){s(r)})}}:function(e,n,l,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return t(e,n,l);var c=e.type==="application/octet-stream",_=/constructor/i.test(o.HTMLElement)||o.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||c&&_||p)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var d=m.result;d=b?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=d:location=d,r=null},m.readAsDataURL(e)}else{var S=o.URL||o.webkitURL,h=S.createObjectURL(e);r?r.location=h:location.href=h,r=null,setTimeout(function(){S.revokeObjectURL(h)},4e4)}});o.saveAs=v.saveAs=v,a.exports=v})})(E);var L=E.exports;function g(a,u){var f=Date.parse(a);return(f-new Date(Date.UTC(1899,11,30)))/(24*60*60*1e3)}function T(a,u){for(var f={},t={s:{c:1e7,r:1e7},e:{c:0,r:0}},i=0;i!=a.length;++i)for(var s=0;s!=a[i].length;++s){t.s.r>i&&(t.s.r=i),t.s.c>s&&(t.s.c=s),t.e.r<i&&(t.e.r=i),t.e.c<s&&(t.e.c=s);var o={v:a[i][s]};if(o.v!=null){var p=x.encode_cell({c:s,r:i});typeof o.v=="number"?o.t="n":typeof o.v=="boolean"?o.t="b":o.v instanceof Date?(o.t="n",o.z=j._table[14],o.v=g(o.v)):o.t="s",f[p]=o}}return t.s.c<1e7&&(f["!ref"]=x.encode_range(t)),f}function y(){if(!(this instanceof y))return new y;this.SheetNames=[],this.Sheets={}}function k(a){for(var u=new ArrayBuffer(a.length),f=new Uint8Array(u),t=0;t!=a.length;++t)f[t]=a.charCodeAt(t)&255;return u}function U(a,u,f){var t=u;t.unshift(a);var i="SheetJS",s=new y,o=T(t);s.SheetNames.push(i),s.Sheets[i]=o;var p=A(s,{bookType:"xlsx",bookSST:!1,type:"binary"}),v=f||"列表";L.saveAs(new Blob([k(p)],{type:"application/octet-stream"}),v+".xlsx")}function M(a,u,f,t){var i=O(u,t);U(a,i,f)}function O(a,u){return u.map(f=>a.map(t=>f[t]))}export{M as e};
|