chunk-581b2547.9d712337.js 5.3 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-581b2547"],{1:function(e,t){},2:function(e,t){},3:function(e,t){},"4bf8d":function(e,t,n){"use strict";n.r(t),n.d(t,"export_table_to_excel",(function(){return u})),n.d(t,"export_json_to_excel",(function(){return f})),n.d(t,"export_json_to_excel2",(function(){return g})),n.d(t,"export_json_to_excel3",(function(){return v}));n("6b54"),n("ac6a");var r=n("2909"),o=(n("34ef1"),n("1146")),a=n.n(o);function c(e){for(var t=[],n=e.querySelectorAll("tr"),r=[],o=0;o<n.length;++o){for(var a=[],c=n[o],h=c.querySelectorAll("td"),i=0;i<h.length;++i){var l=h[i],s=l.getAttribute("colspan"),u=l.getAttribute("rowspan"),f=l.innerText;if(""!==f&&f==+f&&(f=+f),r.forEach((function(e){if(o>=e.s.r&&o<=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)})),(u||s)&&(u=u||1,s=s||1,r.push({s:{r:o,c:a.length},e:{r:o+u-1,c:a.length+s-1}})),a.push(""!==f?f:null),s)for(var g=0;g<s-1;++g)a.push(null)}t.push(a)}return[t,r]}function h(e,t){t&&(e+=1462);var n=Date.parse(e);return(n-new Date(Date.UTC(1899,11,30)))/864e5}function i(e,t){for(var n={},r={s:{c:1e7,r:1e7},e:{c:0,r:0}},o=0;o!=e.length;++o)for(var c=0;c!=e[o].length;++c){r.s.r>o&&(r.s.r=o),r.s.c>c&&(r.s.c=c),r.e.r<o&&(r.e.r=o),r.e.c<c&&(r.e.c=c);var i={v:e[o][c]};if(null!=i.v){var l=a.a.utils.encode_cell({c:c,r:o});"number"===typeof i.v?i.t="n":"boolean"===typeof i.v?i.t="b":i.v instanceof Date?(i.t="n",i.z=a.a.SSF._table[14],i.v=h(i.v)):i.t="s",n[l]=i}}return r.s.c<1e7&&(n["!ref"]=a.a.utils.encode_range(r)),n}function l(){if(!(this instanceof l))return new l;this.SheetNames=[],this.Sheets={}}function s(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r!=e.length;++r)n[r]=255&e.charCodeAt(r);return t}function u(e){var t=document.getElementById(e),n=c(t),r=n[1],o=n[0],h="SheetJS",u=new l,f=i(o);f["!merges"]=r,u.SheetNames.push(h),u.Sheets[h]=f;var g=a.a.write(u,{bookType:"xlsx",bookSST:!1,type:"binary"});saveAs(new Blob([s(g)],{type:"application/octet-stream"}),"test.xlsx")}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.multiHeader,n=void 0===t?[]:t,o=e.header,c=e.data,h=e.filename,u=e.merges,f=void 0===u?[]:u,g=e.autoWidth,v=void 0===g||g,p=e.bookType,d=void 0===p?"xlsx":p,w=e.ws_name;h=h||"excel-list",c=Object(r["a"])(c),c.unshift(o),w=w||"SheetJS";for(var m=n.length-1;m>-1;m--)c.unshift(n[m]);var S=new l,b=i(c);if(f.length>0&&(b["!merges"]||(b["!merges"]=[]),f.forEach((function(e){b["!merges"].push(a.a.utils.decode_range(e))}))),v){for(var y=c.map((function(e){return e.map((function(e){return null==e?{wch:10}:e.toString().charCodeAt(0)>255?{wch:2*e.toString().length}:{wch:e.toString().length}}))})),x=y[0],_=1;_<y.length;_++)for(var k=0;k<y[_].length;k++)x[k]["wch"]<y[_][k]["wch"]&&(x[k]["wch"]=y[_][k]["wch"]);b["!cols"]=x}S.SheetNames.push(w),S.Sheets[w]=b;var A=a.a.write(S,{bookType:d,bookSST:!1,type:"binary"});saveAs(new Blob([s(A)],{type:"application/octet-stream"}),"".concat(h,".").concat(d))}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.multiHeader,n=void 0===t?[]:t,o=e.header,c=e.data,h=e.sheetname,u=e.filename,f=e.merges,g=void 0===f?[]:f,v=e.autoWidth,p=void 0===v||v,d=e.bookType,w=void 0===d?"xlsx":d;u=u||"excel-list",c=Object(r["a"])(c);for(var m=0;m<o.length;m++)c[m].unshift(o[m]);for(var S=n.length-1;S>-1;S--)c.unshift(n[S]);for(var b=h,y=new l,x=[],_=0;_<o.length;_++)x.push(i(c[_]));if(g.length>0&&(x["!merges"]||(x["!merges"]=[]),g.forEach((function(e){x["!merges"].push(a.a.utils.decode_range(e))}))),p){for(var k=[],A=0;A<o.length;A++)k.push(c[A].map((function(e){return e.map((function(e){return null==e?{wch:10}:e.toString().charCodeAt(0)>255?{wch:2*e.toString().length}:{wch:e.toString().length}}))})));var T=[];for(A=0;A<k.length;A++){T[A]=k[A][0];for(var j=1;j<k[A].length;j++)for(var B=0;B<k[A][j].length;B++)T[A][B]["wch"]<k[A][j][B]["wch"]&&(T[A][B]["wch"]=k[A][j][B]["wch"])}for(var C=0;C<T.length;C++)x[C]["!cols"]=T[C]}for(A=0;A<o.length;A++)y.SheetNames.push(b[A]),y.Sheets[b[A]]=x[A];var E=a.a.write(y,{bookType:w,bookSST:!1,type:"binary"});saveAs(new Blob([s(E)],{type:"application/octet-stream"}),"".concat(u,".").concat(w))}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.multiHeader,n=void 0===t?[]:t,o=e.header,c=e.data,h=e.sheetname,u=e.filename,f=e.merges,g=void 0===f?[]:f,v=e.autoWidth,p=void 0===v||v,d=e.bookType,w=void 0===d?"xlsx":d;u=u||"excel-list",c=Object(r["a"])(c);for(var m=0;m<o.length;m++)c[m].unshift(o[m]);for(var S=n.length-1;S>-1;S--)c.unshift(n[S]);for(var b=h,y=new l,x=[],_=0;_<o.length;_++)x.push(i(c[_]));if(g.length>0&&(x["!merges"]||(x["!merges"]=[]),g.forEach((function(e){x["!merges"].push(a.a.utils.decode_range(e))}))),p){for(var k=[],A=0;A<o.length;A++)k.push(c[A].map((function(e){return e.map((function(e){return null==e?{wch:10}:e.toString().charCodeAt(0)>255?{wch:2*e.toString().length}:{wch:e.toString().length}}))})));var T=[];for(A=0;A<k.length;A++){T[A]=k[A][0];for(var j=1;j<k[A].length;j++)for(var B=0;B<k[A][j].length;B++)T[A][B]["wch"]<k[A][j][B]["wch"]&&(T[A][B]["wch"]=k[A][j][B]["wch"])}for(var C=0;C<T.length;C++)x[C]["!cols"]=T[C]}for(A=0;A<o.length;A++)y.SheetNames.push(b[A]),y.Sheets[b[A]]=x[A];var E=a.a.write(y,{bookType:w,bookSST:!1,type:"binary"});saveAs(new Blob([s(E)],{type:"application/octet-stream"}),"".concat(u,".").concat(w))}n("0fd4")}}]);