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 i})),n.d(t,"export_json_to_excel",(function(){return h}));var r=n("2909"),c=(n("d3b7"),n("c19f"),n("ace4"),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"),n("d81d"),n("25f0"),n("99af"),n("21a6")),a=(t=n("1146"),n.n(t));function o(e){for(var t,n={},r={s:{c:1e7,r:1e7},e:{c:0,r:0}},c=0;c!=e.length;++c)for(var o=0;o!=e[c].length;++o){r.s.r>c&&(r.s.r=c),r.s.c>o&&(r.s.c=o),r.e.r<c&&(r.e.r=c),r.e.c<o&&(r.e.c=o);var s,l={v:e[c][o]};null!=l.v&&(s=a.a.utils.encode_cell({c:o,r:c}),"number"==typeof l.v?l.t="n":"boolean"==typeof l.v?l.t="b":l.v instanceof Date?(l.t="n",l.z=a.a.SSF._table[14],l.v=(t=l.v,(Date.parse(t)-new Date(Date.UTC(1899,11,30)))/864e5)):l.t="s",n[s]=l)}return r.s.c<1e7&&(n["!ref"]=a.a.utils.encode_range(r)),n}function s(){if(!(this instanceof s))return new s;this.SheetNames=[],this.Sheets={}}function l(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 i(e){e=function(e){for(var t=[],n=e.querySelectorAll("tr"),r=[],c=0;c<n.length;++c){for(var a=[],o=n[c].querySelectorAll("td"),s=0;s<o.length;++s){var l=o[s],i=l.getAttribute("colspan"),h=l.getAttribute("rowspan");l=l.innerText;if(""!==l&&l==+l&&(l=+l),r.forEach((function(e){if(c>=e.s.r&&c<=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)})),(h||i)&&r.push({s:{r:c,c:a.length},e:{r:c+(h||1)-1,c:a.length+(i=i||1)-1}}),a.push(""!==l?l:null),i)for(var u=0;u<i-1;++u)a.push(null)}t.push(a)}return[t,r]}(document.getElementById(e));var t=e[1],n=(e=e[0],"SheetJS"),r=new s;e=o(e),e["!merges"]=t,r.SheetNames.push(n),r.Sheets[n]=e,t=a.a.write(r,{bookType:"xlsx",bookSST:!1,type:"binary"});Object(c.saveAs)(new Blob([l(t)],{type:"application/octet-stream"}),"test.xlsx")}function h(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.multiHeader,n=void 0===t?[]:t,i=(t=e.header,e.data),h=e.filename,u=e.merges,f=(u=void 0===u?[]:u,e.autoWidth);f=void 0===f||f,e=e.bookType,e=void 0===e?"xlsx":e,h=h||"excel-list";(i=Object(r.a)(i)).unshift(t);for(var p=n.length-1;-1<p;p--)i.unshift(n[p]);t="SheetJS";var d=new s,g=o(i);if(0<u.length&&(g["!merges"]||(g["!merges"]=[]),u.forEach((function(e){g["!merges"].push(a.a.utils.decode_range(e))}))),f){for(var v=i.map((function(e){return e.map((function(e){return null==e?{wch:10}:255<e.toString().charCodeAt(0)?{wch:2*e.toString().length}:{wch:e.toString().length}}))})),b=v[0],w=1;w<v.length;w++)for(var S=0;S<v[w].length;S++)b[S].wch<v[w][S].wch&&(b[S].wch=v[w][S].wch);g["!cols"]=b}d.SheetNames.push(t),d.Sheets[t]=g,u=a.a.write(d,{bookType:e,bookSST:!1,type:"binary"}),Object(c.saveAs)(new Blob([l(u)],{type:"application/octet-stream"}),"".concat(h,".").concat(e))}}}]);
|