cmc-web/public/static/js/cmp-element.umd.min.2.js

2 lines
3.3 KiB
JavaScript

(("undefined"!==typeof self?self:this)["webpackJsonpcmp_element"]=("undefined"!==typeof self?self:this)["webpackJsonpcmp_element"]||[]).push([[2],{0:function(e,t){},1:function(e,t){},2:function(e,t){},dfe4:function(e,t,n){"use strict";n.r(t),n.d(t,"export_table_to_excel",(function(){return h})),n.d(t,"exportJsonToExcel",(function(){return p}));var r=n("2909"),c=(n("c19f"),n("d3b7"),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("e260"),n("159b"),n("d81d"),n("25f0"),n("99af"),n("21a6")),o=n("1146"),a=n.n(o);function s(e){for(var t=[],n=e.querySelectorAll("tr"),r=[],c=0;c<n.length;++c){for(var o=[],a=n[c],s=a.querySelectorAll("td"),l=0;l<s.length;++l){var f=s[l],i=f.getAttribute("colspan"),u=f.getAttribute("rowspan"),h=f.innerText;if(""!==h&&h==+h&&(h=+h),r.forEach((function(e){if(c>=e.s.r&&c<=e.e.r&&o.length>=e.s.c&&o.length<=e.e.c)for(var t=0;t<=e.e.c-e.s.c;++t)o.push(null)})),(u||i)&&(u=u||1,i=i||1,r.push({s:{r:c,c:o.length},e:{r:c+u-1,c:o.length+i-1}})),o.push(""!==h?h:null),i)for(var p=0;p<i-1;++p)o.push(null)}t.push(o)}return[t,r]}function l(e,t){t&&(e+=1462);var n=Date.parse(e);return(n-new Date(Date.UTC(1899,11,30)))/864e5}function f(e,t){for(var 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={v:e[c][o]};if(null!=s.v){var f=a.a.utils.encode_cell({c:o,r:c});"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=l(s.v)):s.t="s",n[f]=s}}return r.s.c<1e7&&(n["!ref"]=a.a.utils.encode_range(r)),n}function i(){if(!(this instanceof i))return new i;this.SheetNames=[],this.Sheets={}}function u(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 h(e){var t=document.getElementById(e),n=s(t),r=n[1],o=n[0],l="SheetJS",h=new i,p=f(o);p["!merges"]=r,h.SheetNames.push(l),h.Sheets[l]=p;var d=a.a.write(h,{bookType:"xlsx",bookSST:!1,type:"binary"});Object(c["saveAs"])(new Blob([u(d)],{type:"application/octet-stream"}),"test.xlsx")}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.multiHeader,n=void 0===t?[]:t,o=e.header,s=e.data,l=e.filename,h=e.merges,p=void 0===h?[]:h,d=e.autoWidth,v=void 0===d||d,g=e.bookType,b=void 0===g?"xlsx":g;l=l||"excel-list",s=Object(r["a"])(s),s.unshift(o);for(var m=n.length-1;m>-1;m--)s.unshift(n[m]);var S="SheetJS",w=new i,y=f(s);if(p.length>0&&(y["!merges"]||(y["!merges"]=[]),p.forEach((function(e){y["!merges"].push(a.a.utils.decode_range(e))}))),v){for(var x=s.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}}))})),A=x[0],_=1;_<x.length;_++)for(var T=0;T<x[_].length;T++)A[T]["wch"]<x[_][T]["wch"]&&(A[T]["wch"]=x[_][T]["wch"]);y["!cols"]=A}w.SheetNames.push(S),w.Sheets[S]=y;var k=a.a.write(w,{bookType:b,bookSST:!1,type:"binary"});Object(c["saveAs"])(new Blob([u(k)],{type:"application/octet-stream"}),"".concat(l,".").concat(b))}}}]);
//# sourceMappingURL=cmp-element.umd.min.2.js.map