chunk-2c21b5a5.502eb795.js 5.5 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2c21b5a5","chunk-748b566e"],{"21a6":function(e,t,n){(function(n){var o,r,a;(function(n,i){r=[],o=i,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(){s(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 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 i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,c=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!c?function(e,t,n){var c=i.URL||i.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=c.createObjectURL(e),setTimeout((function(){c.revokeObjectURL(s.href)}),4e4),setTimeout((function(){a(s)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,i){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,i),n);else if(r(e))o(e,n,i);else{var c=document.createElement("a");c.href=e,c.target="_blank",setTimeout((function(){a(c)}))}}: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,s=/constructor/i.test(i.HTMLElement)||i.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||a&&s||c)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},u.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,p=f.createObjectURL(e);r?r.location=p:location.href=p,r=null,setTimeout((function(){f.revokeObjectURL(p)}),4e4)}});i.saveAs=s.saveAs=s,e.exports=s}))}).call(this,n("c8ba"))},"4bf8d":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("34ef"),n("21a6")),a=n("1146"),i=n.n(a);function c(e){for(var t=[],n=e.querySelectorAll("tr"),o=[],r=0;r<n.length;++r){for(var a=[],i=n[r],c=i.querySelectorAll("td"),s=0;s<c.length;++s){var l=c[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 c={v:e[r][a]};if(null!=c.v){var l=i.a.utils.encode_cell({c:a,r:r});"number"===typeof c.v?c.t="n":"boolean"===typeof c.v?c.t="b":c.v instanceof Date?(c.t="n",c.z=i.a.SSF._table[14],c.v=s(c.v)):c.t="s",n[l]=c}}return o.s.c<1e7&&(n["!ref"]=i.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=c(t),o=n[1],a=n[0],s="SheetJS",p=new u,d=l(a);d["!merges"]=o,p.SheetNames.push(s),p.Sheets[s]=d;var h=i.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.header,c=e.data,s=e.filename,p=e.merges,d=void 0===p?[]:p,h=e.autoWidth,v=void 0===h||h,w=e.bookType,g=void 0===w?"xlsx":w,b=e.isCSV,m=void 0!==b&&b;s=s||"导出数据",c=Object(o["a"])(c),c.unshift(a);for(var y=n.length-1;y>-1;y--)c.unshift(n[y]);var S="SheetJS",A=new u,k=l(c);if(d.length>0&&(k["!merges"]||(k["!merges"]=[]),d.forEach((function(e){k["!merges"].push(i.a.utils.decode_range(e))}))),v){for(var x=c.map((function(e){return e.map((function(e){return null==e||void 0==e||""==e?{wch:10}:e.toString().charCodeAt(0)>255?{wch:2*e.toString().length}:{wch:e.toString().length}}))})),E=x[0],T=1;T<x.length;T++)for(var j=0;j<x[T].length;j++)E[j]["wch"]<x[T][j]["wch"]&&(E[j]["wch"]=x[T][j]["wch"]);k["!cols"]=E}A.SheetNames.push(S),A.Sheets[S]=k;var L=i.a.write(A,{bookType:g,bookSST:!1,type:"binary"});Object(r["saveAs"])(new Blob([f(L)],{type:"application/octet-stream"}),"".concat(s,".").concat(m?"csv":g))}}}]);