1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2125b98f"],{1:function(e,t){},2:function(e,t){},3:function(e,t){},"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 h}));var r=n("2909"),a=(n("d3b7"),n("c19f"),n("ace4"),n("5cc6"),n("907a"),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("fa9e"),n("77d9"),n("159b"),n("d81d"),n("25f0"),n("99af"),n("1146")),c=n.n(a);function o(e){for(var t=[],n=e.querySelectorAll("tr"),r=[],a=0;a<n.length;++a){for(var c=[],o=n[a],s=o.querySelectorAll("td"),i=0;i<s.length;++i){var l=s[i],f=l.getAttribute("colspan"),u=l.getAttribute("rowspan"),h=l.innerText;if(""!==h&&h==+h&&(h=+h),r.forEach((function(e){if(a>=e.s.r&&a<=e.e.r&&c.length>=e.s.c&&c.length<=e.e.c)for(var t=0;t<=e.e.c-e.s.c;++t)c.push(null)})),(u||f)&&(u=u||1,f=f||1,r.push({s:{r:a,c:c.length},e:{r:a+u-1,c:c.length+f-1}})),c.push(""!==h?h:null),f)for(var v=0;v<f-1;++v)c.push(null)}t.push(c)}return[t,r]}function s(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}},a=0;a!=e.length;++a)for(var o=0;o!=e[a].length;++o){r.s.r>a&&(r.s.r=a),r.s.c>o&&(r.s.c=o),r.e.r<a&&(r.e.r=a),r.e.c<o&&(r.e.c=o);var i={v:e[a][o]};if(null!=i.v){var l=c.a.utils.encode_cell({c:o,r:a});"number"===typeof i.v?i.t="n":"boolean"===typeof i.v?i.t="b":i.v instanceof Date?(i.t="n",i.z=c.a.SSF._table[14],i.v=s(i.v)):i.t="s",n[l]=i}}return r.s.c<1e7&&(n["!ref"]=c.a.utils.encode_range(r)),n}function l(){if(!(this instanceof l))return new l;this.SheetNames=[],this.Sheets={}}function f(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=o(t),r=n[1],a=n[0],s="SheetJS",u=new l,h=i(a);h["!merges"]=r,u.SheetNames.push(s),u.Sheets[s]=h;var v=c.a.write(u,{bookType:"xlsx",bookSST:!1,type:"binary"});saveAs(new Blob([f(v)],{type:"application/octet-stream"}),"test.xlsx")}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.multiHeader,n=void 0===t?[]:t,a=e.header,o=e.data,s=e.filename,u=e.merges,h=void 0===u?[]:u,v=e.autoWidth,d=void 0===v||v,p=e.bookType,g=void 0===p?"xlsx":p;s=s||"excel-list",o=Object(r["a"])(o),o.unshift(a);for(var b=n.length-1;b>-1;b--)o.unshift(n[b]);var w="SheetJS",S=new l,m=i(o);if(h.length>0&&(m["!merges"]||(m["!merges"]=[]),h.forEach((function(e){m["!merges"].push(c.a.utils.decode_range(e))}))),d){for(var y=o.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],A=1;A<y.length;A++)for(var _=0;_<y[A].length;_++)x[_]["wch"]<y[A][_]["wch"]&&(x[_]["wch"]=y[A][_]["wch"]);m["!cols"]=x}S.SheetNames.push(w),S.Sheets[w]=m;var k=c.a.write(S,{bookType:g,bookSST:!1,type:"binary"});saveAs(new Blob([f(k)],{type:"application/octet-stream"}),"".concat(s,".").concat(g))}n("0fd4")}}]);
|