9cd8d31af7d36be35723663146eca7093e6e32cc.svn-base 4.3 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0cc0b6"],{"4bf8":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("99af"),n("4160"),n("d81d"),n("c19f"),n("ace4"),n("d3b7"),n("25f0"),n("5cc6"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("170b"),n("b39a"),n("72f7"),n("159b");var r=n("2909"),o=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"),s=0;s<h.length;++s){var l=h[s],i=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||i)&&(u=u||1,i=i||1,r.push({s:{r:o,c:a.length},e:{r:o+u-1,c:a.length+i-1}})),a.push(""!==f?f:null),i)for(var g=0;g<i-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 s(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 s={v:e[o][c]};if(null!=s.v){var l=a.a.utils.encode_cell({c:c,r:o});"number"===typeof s.v?s.t="n":"boolean"===typeof s.v?s.t="b":s.v instanceof Date?(s.t="n",s.z=a.a.SSF._table[14],s.v=h(s.v)):s.t="s",n[l]=s}}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 i(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=s(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([i(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,d=e.bookType,p=void 0===d?"xlsx":d,w=e.ws_name;h=h||"excel-list",c=Object(r["a"])(c),c.unshift(o),w=w||"SheetJS";for(var b=n.length-1;b>-1;b--)c.unshift(n[b]);var m=new l,S=s(c);if(f.length>0&&(S["!merges"]||(S["!merges"]=[]),f.forEach((function(e){S["!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 A=0;A<y[_].length;A++)x[A]["wch"]<y[_][A]["wch"]&&(x[A]["wch"]=y[_][A]["wch"]);S["!cols"]=x}m.SheetNames.push(w),m.Sheets[w]=S;var k=a.a.write(m,{bookType:p,bookSST:!1,type:"binary"});saveAs(new Blob([i(k)],{type:"application/octet-stream"}),"".concat(h,".").concat(p))}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,d=void 0===v||v,p=e.bookType,w=void 0===p?"xlsx":p;u=u||"excel-list",c=Object(r["a"])(c);for(var b=0;b<o.length;b++)c[b].unshift(o[b]);for(var m=n.length-1;m>-1;m--)c.unshift(n[m]);for(var S=h,y=new l,x=[],_=0;_<o.length;_++)x.push(s(c[_]));if(g.length>0&&(x["!merges"]||(x["!merges"]=[]),g.forEach((function(e){x["!merges"].push(a.a.utils.decode_range(e))}))),d){for(var A=[],k=0;k<o.length;k++)A.push(c[k].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(k=0;k<A.length;k++){T[k]=A[k][0];for(var B=1;B<A[k].length;B++)for(var j=0;j<A[k][B].length;j++)T[k][j]["wch"]<A[k][B][j]["wch"]&&(T[k][j]["wch"]=A[k][B][j]["wch"])}for(var C=0;C<T.length;C++)x[C]["!cols"]=T[C]}for(k=0;k<o.length;k++)y.SheetNames.push(S[k]),y.Sheets[S[k]]=x[k];var D=a.a.write(y,{bookType:w,bookSST:!1,type:"binary"});saveAs(new Blob([i(D)],{type:"application/octet-stream"}),"".concat(u,".").concat(w))}n("0fd4")}}]);