791.6d3f0082.js 4.4 KB

123
  1. (self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[791],{3818:function(){
  2. /*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
  3. (function(e){"use strict";if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{return void new Blob}catch(n){}var t=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||function(e){var t=function(e){return Object.prototype.toString.call(e).match(/^\[object\s(.*)\]$/)[1]},n=function(){this.data=[]},o=function(e,t,n){this.data=e,this.size=e.length,this.type=t,this.encoding=n},r=n.prototype,a=o.prototype,i=e.FileReaderSync,s=function(e){this.code=this[this.name=e]},c="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),l=c.length,u=e.URL||e.webkitURL||e,f=u.createObjectURL,h=u.revokeObjectURL,p=u,d=e.btoa,b=e.atob,g=e.ArrayBuffer,R=e.Uint8Array;o.fake=a.fake=!0;while(l--)s.prototype[c[l]]=l+1;return u.createObjectURL||(p=e.URL={}),p.createObjectURL=function(e){var t,n=e.type;return null===n&&(n="application/octet-stream"),e instanceof o?(t="data:"+n,"base64"===e.encoding?t+";base64,"+e.data:"URI"===e.encoding?t+","+decodeURIComponent(e.data):d?t+";base64,"+d(e.data):t+","+encodeURIComponent(e.data)):f?f.call(u,e):void 0},p.revokeObjectURL=function(e){"data:"!==e.substring(0,5)&&h&&h.call(u,e)},r.append=function(e){var n=this.data;if(R&&(e instanceof g||e instanceof R)){for(var r="",a=new R(e),c=0,l=a.length;c<l;c++)r+=String.fromCharCode(a[c]);n.push(r)}else if("Blob"===t(e)||"File"===t(e)){if(!i)throw new s("NOT_READABLE_ERR");var u=new i;n.push(u.readAsBinaryString(e))}else e instanceof o?"base64"===e.encoding&&b?n.push(b(e.data)):"URI"===e.encoding?n.push(decodeURIComponent(e.data)):"raw"===e.encoding&&n.push(e.data):("string"!==typeof e&&(e+=""),n.push(unescape(encodeURIComponent(e))))},r.getBlob=function(e){return arguments.length||(e=null),new o(this.data.join(""),e,"raw")},r.toString=function(){return"[object BlobBuilder]"},a.slice=function(e,t,n){var r=arguments.length;return r<3&&(n=null),new o(this.data.slice(e,r>1?t:this.data.length),n,this.encoding)},a.toString=function(){return"[object Blob]"},a.close=function(){this.size=this.data.length=0},n}(e);e.Blob=function(e,n){var o=n&&n.type||"",r=new t;if(e)for(var a=0,i=e.length;a<i;a++)r.append(e[a]);return r.getBlob(o)}})("undefined"!==typeof self&&self||"undefined"!==typeof window&&window||this.content||this)},791:function(e,t,n){"use strict";n.r(t),n.d(t,{export_table_to_excel:function(){return c},export_json_to_excel:function(){return l}});n(8675),n(3462);function o(e){for(var t=[],n=e.querySelectorAll("tr"),o=[],r=0;r<n.length;++r){for(var a=[],i=n[r],s=i.querySelectorAll("td"),c=0;c<s.length;++c){var l=s[c],u=l.getAttribute("colspan"),f=l.getAttribute("rowspan"),h=l.innerText;if(""!==h&&h==+h&&(h=+h),o.forEach((function(e){if(r>=e.s.r&&r<=e.e.r&&a.length>=e.s.c&&a.length<=e.e.c)for(var t=0;t<=e.e.c-e.s.c;++t)a.push(null)})),(f||u)&&(f=f||1,u=u||1,o.push({s:{r:r,c:a.length},e:{r:r+f-1,c:a.length+u-1}})),a.push(""!==h?h:null),u)for(var p=0;p<u-1;++p)a.push(null)}t.push(a)}return[t,o]}function r(e,t){t&&(e+=1462);var n=Date.parse(e);return(n-new Date(Date.UTC(1899,11,30)))/864e5}function a(e,t){for(var n={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},a=0;a!=e.length;++a)for(var i=0;i!=e[a].length;++i){o.s.r>a&&(o.s.r=a),o.s.c>i&&(o.s.c=i),o.e.r<a&&(o.e.r=a),o.e.c<i&&(o.e.c=i);var s={v:e[a][i]};if(null!=s.v){var c=XLSX.utils.encode_cell({c:i,r:a});"number"===typeof s.v?s.t="n":"boolean"===typeof s.v?s.t="b":s.v instanceof Date?(s.t="n",s.z=XLSX.SSF._table[14],s.v=r(s.v)):s.t="s",n[c]=s}}return o.s.c<1e7&&(n["!ref"]=XLSX.utils.encode_range(o)),n}function i(){if(!(this instanceof i))return new i;this.SheetNames=[],this.Sheets={}}function s(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),o=0;o!=e.length;++o)n[o]=255&e.charCodeAt(o);return t}function c(e){var t=document.getElementById(e);console.log("a");var n=o(t),r=n[1],c=n[0],l="SheetJS";console.log(c);var u=new i,f=a(c);f["!merges"]=r,u.SheetNames.push(l),u.Sheets[l]=f;var h=XLSX.write(u,{bookType:"xlsx",bookSST:!1,type:"binary"});saveAs(new Blob([s(h)],{type:"application/octet-stream"}),"test.xlsx")}function l(e,t,n,o){var r=t;r.unshift(e);var c=new i,l=a(r);c.SheetNames.push(o),c.Sheets[o]=l;var u=XLSX.write(c,{bookType:"xlsx",bookSST:!1,type:"binary"}),f=n||"列表";saveAs(new Blob([s(u)],{type:"application/octet-stream"}),f+".xlsx")}n(3860),n(3818),n(8658)}}]);