chunk-d17f893e.f74a918f.js 5.4 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d17f893e"],{1:function(e,t){},2:function(e,t){},"21a6":function(e,t,n){(function(n){var o,r,a;(function(n,c){r=[],o=c,a="function"===typeof o?o.apply(t,r):o,void 0===a||(e.exports=a)})(0,(function(){"use strict";function t(e,t){return"undefined"==typeof t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function o(e,t,n){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){i(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function r(e){var t=new XMLHttpRequest;return t.open("HEAD",e,!1),t.send(),200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(o){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var c="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,i=c.saveAs||("object"!=typeof window||window!==c?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,n){var i=c.URL||c.webkitURL,s=document.createElement("a");t=t||e.name||"download",s.download=t,s.rel="noopener","string"==typeof e?(s.href=e,s.origin===location.origin?a(s):r(s.href)?o(e,t,n):a(s,s.target="_blank")):(s.href=i.createObjectURL(e),setTimeout((function(){i.revokeObjectURL(s.href)}),4e4),setTimeout((function(){a(s)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,c){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,c),n);else if(r(e))o(e,n,c);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout((function(){a(i)}))}}:function(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return o(e,t,n);var a="application/octet-stream"===e.type,i=/constructor/i.test(c.HTMLElement)||c.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||a&&i)&&"object"==typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=s?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},l.readAsDataURL(e)}else{var u=c.URL||c.webkitURL,f=u.createObjectURL(e);r?r.location=f:location.href=f,r=null,setTimeout((function(){u.revokeObjectURL(f)}),4e4)}});c.saveAs=i.saveAs=i,e.exports=i}))}).call(this,n("c8ba"))},3:function(e,t){},a1cf:function(e,t,n){"use strict";n.r(t),n.d(t,"export_table_to_excel",(function(){return p})),n.d(t,"export_json_to_excel",(function(){return d}));n("6b54"),n("ac6a");var o=n("2909"),r=(n("34ef1"),n("21a6")),a=n("1146"),c=n.n(a);function i(e){for(var t=[],n=e.querySelectorAll("tr"),o=[],r=0;r<n.length;++r){for(var a=[],c=n[r],i=c.querySelectorAll("td"),s=0;s<i.length;++s){var l=i[s],u=l.getAttribute("colspan"),f=l.getAttribute("rowspan"),p=l.innerText;if(""!==p&&p==+p&&(p=+p),o.forEach((function(e){if(r>=e.s.r&&r<=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)})),(f||u)&&(f=f||1,u=u||1,o.push({s:{r:r,c:a.length},e:{r:r+f-1,c:a.length+u-1}})),a.push(""!==p?p:null),u)for(var d=0;d<u-1;++d)a.push(null)}t.push(a)}return[t,o]}function s(e,t){t&&(e+=1462);var n=Date.parse(e);return(n-new Date(Date.UTC(1899,11,30)))/864e5}function l(e,t){for(var n={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},r=0;r!=e.length;++r)for(var a=0;a!=e[r].length;++a){o.s.r>r&&(o.s.r=r),o.s.c>a&&(o.s.c=a),o.e.r<r&&(o.e.r=r),o.e.c<a&&(o.e.c=a);var i={v:e[r][a]};if(null!=i.v){var l=c.a.utils.encode_cell({c:a,r:r});"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 o.s.c<1e7&&(n["!ref"]=c.a.utils.encode_range(o)),n}function u(){if(!(this instanceof u))return new u;this.SheetNames=[],this.Sheets={}}function f(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),o=0;o!=e.length;++o)n[o]=255&e.charCodeAt(o);return t}function p(e){var t=document.getElementById(e),n=i(t),o=n[1],a=n[0],s="sheet",p=new u,d=l(a);d["!merges"]=o,p.SheetNames.push(s),p.Sheets[s]=d;var h=c.a.write(p,{bookType:"xlsx",bookSST:!1,type:"binary"});Object(r["saveAs"])(new Blob([f(h)],{type:"application/octet-stream"}),"test.xlsx")}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.multiHeader,n=void 0===t?[]:t,a=e.multiHeader2,i=void 0===a?[]:a,s=e.data,p=e.filename,d=e.merges,h=void 0===d?[]:d,v=e.autoWidth,w=void 0===v||v,b=e.bookType,g=void 0===b?"xlsx":b;p=p||"excel-list",s=Object(o["a"])(s);for(var m=i.length-1;m>-1;m--)s.unshift(i[m]);for(var y=n.length-1;y>-1;y--)s.unshift(n[y]);var S="sheet",x=new u,k=l(s);if(h.length>0&&(k["!merges"]||(k["!merges"]=[]),h.forEach((function(e){k["!merges"].push(c.a.utils.decode_range(e))}))),w){for(var A=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}}))})),E=A[0],T=1;T<A.length;T++)for(var j=0;j<A[T].length;j++)E[j]["wch"]<A[T][j]["wch"]&&(E[j]["wch"]=A[T][j]["wch"]);k["!cols"]=E}x.SheetNames.push(S),x.Sheets[S]=k;var L=c.a.write(x,{bookType:g,bookSST:!1,type:"binary"});Object(r["saveAs"])(new Blob([f(L)],{type:"application/octet-stream"}),"".concat(p,".").concat(g))}}}]);