ERP/static/js/chunk-6b3a.98e739d6.js
2019-03-11 19:01:31 +08:00

1 line
No EOL
9.5 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6b3a"],{20:function(t,e){},21:function(t,e){},22:function(t,e){},"8rVx":function(t,e){t.exports=function(t){function e(t){"undefined"!=typeof console&&(console.error||console.log)("[Script Loader]",t)}try{"undefined"!=typeof execScript&&"undefined"!=typeof attachEvent&&"undefined"==typeof addEventListener?execScript(t):"undefined"!=typeof eval?eval.call(null,t):e("EvalError: No eval function available")}catch(t){e(t)}}},"H/Y7":function(t,e){t.exports='/* FileSaver.js\n * A saveAs() FileSaver implementation.\n * 1.3.2\n * 2016-06-16 18:25:19\n *\n * By Eli Grey, http://eligrey.com\n * License: MIT\n * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n */\n\n/*global self */\n/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */\n\n/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */\n\nvar saveAs = saveAs || (function(view) {\n\t"use strict";\n\t// IE <10 is explicitly unsupported\n\tif (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\\./.test(navigator.userAgent)) {\n\t\treturn;\n\t}\n\tvar\n\t\t doc = view.document\n\t\t // only get URL when necessary in case Blob.js hasn\'t overridden it yet\n\t\t, get_URL = function() {\n\t\t\treturn view.URL || view.webkitURL || view;\n\t\t}\n\t\t, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")\n\t\t, can_use_save_link = "download" in save_link\n\t\t, click = function(node) {\n\t\t\tvar event = new MouseEvent("click");\n\t\t\tnode.dispatchEvent(event);\n\t\t}\n\t\t, is_safari = /constructor/i.test(view.HTMLElement) || view.safari\n\t\t, is_chrome_ios =/CriOS\\/[\\d]+/.test(navigator.userAgent)\n\t\t, throw_outside = function(ex) {\n\t\t\t(view.setImmediate || view.setTimeout)(function() {\n\t\t\t\tthrow ex;\n\t\t\t}, 0);\n\t\t}\n\t\t, force_saveable_type = "application/octet-stream"\n\t\t// the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to\n\t\t, arbitrary_revoke_timeout = 1000 * 40 // in ms\n\t\t, revoke = function(file) {\n\t\t\tvar revoker = function() {\n\t\t\t\tif (typeof file === "string") { // file is an object URL\n\t\t\t\t\tget_URL().revokeObjectURL(file);\n\t\t\t\t} else { // file is a File\n\t\t\t\t\tfile.remove();\n\t\t\t\t}\n\t\t\t};\n\t\t\tsetTimeout(revoker, arbitrary_revoke_timeout);\n\t\t}\n\t\t, dispatch = function(filesaver, event_types, event) {\n\t\t\tevent_types = [].concat(event_types);\n\t\t\tvar i = event_types.length;\n\t\t\twhile (i--) {\n\t\t\t\tvar listener = filesaver["on" + event_types[i]];\n\t\t\t\tif (typeof listener === "function") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlistener.call(filesaver, event || filesaver);\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tthrow_outside(ex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t, auto_bom = function(blob) {\n\t\t\t// prepend BOM for UTF-8 XML and text/* types (including HTML)\n\t\t\t// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n\t\t\tif (/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n\t\t\t\treturn new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});\n\t\t\t}\n\t\t\treturn blob;\n\t\t}\n\t\t, FileSaver = function(blob, name, no_auto_bom) {\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\t// First try a.download, then web filesystem, then object URLs\n\t\t\tvar\n\t\t\t\t filesaver = this\n\t\t\t\t, type = blob.type\n\t\t\t\t, force = type === force_saveable_type\n\t\t\t\t, object_url\n\t\t\t\t, dispatch_all = function() {\n\t\t\t\t\tdispatch(filesaver, "writestart progress write writeend".split(" "));\n\t\t\t\t}\n\t\t\t\t// on any filesys errors revert to saving with object URLs\n\t\t\t\t, fs_error = function() {\n\t\t\t\t\tif ((is_chrome_ios || (force && is_safari)) && view.FileReader) {\n\t\t\t\t\t\t// Safari doesn\'t allow downloading of blob urls\n\t\t\t\t\t\tvar reader = new FileReader();\n\t\t\t\t\t\treader.onloadend = function() {\n\t\t\t\t\t\t\tvar url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, \'data:attachment/file;\');\n\t\t\t\t\t\t\tvar popup = view.open(url, \'_blank\');\n\t\t\t\t\t\t\tif(!popup) view.location.href = url;\n\t\t\t\t\t\t\turl=undefined; // release reference before dispatching\n\t\t\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\t\t\tdispatch_all();\n\t\t\t\t\t\t};\n\t\t\t\t\t\treader.readAsDataURL(blob);\n\t\t\t\t\t\tfilesaver.readyState = filesaver.INIT;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// don\'t create more object URLs than needed\n\t\t\t\t\tif (!object_url) {\n\t\t\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\t\t}\n\t\t\t\t\tif (force) {\n\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar opened = view.open(object_url, "_blank");\n\t\t\t\t\t\tif (!opened) {\n\t\t\t\t\t\t\t// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html\n\t\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t}\n\t\t\t;\n\t\t\tfilesaver.readyState = filesaver.INIT;\n\n\t\t\tif (can_use_save_link) {\n\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tsave_link.href = object_url;\n\t\t\t\t\tsave_link.download = name;\n\t\t\t\t\tclick(save_link);\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfs_error();\n\t\t}\n\t\t, FS_proto = FileSaver.prototype\n\t\t, saveAs = function(blob, name, no_auto_bom) {\n\t\t\treturn new FileSaver(blob, name || blob.name || "download", no_auto_bom);\n\t\t}\n\t;\n\t// IE 10+ (native saveAs)\n\tif (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) {\n\t\treturn function(blob, name, no_auto_bom) {\n\t\t\tname = name || blob.name || "download";\n\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\treturn navigator.msSaveOrOpenBlob(blob, name);\n\t\t};\n\t}\n\n\tFS_proto.abort = function(){};\n\tFS_proto.readyState = FS_proto.INIT = 0;\n\tFS_proto.WRITING = 1;\n\tFS_proto.DONE = 2;\n\n\tFS_proto.error =\n\tFS_proto.onwritestart =\n\tFS_proto.onprogress =\n\tFS_proto.onwrite =\n\tFS_proto.onabort =\n\tFS_proto.onerror =\n\tFS_proto.onwriteend =\n\t\tnull;\n\n\treturn saveAs;\n}(\n\t typeof self !== "undefined" && self\n\t|| typeof window !== "undefined" && window\n\t|| this.content\n));\n// `self` is undefined in Firefox for Android content script context\n// while `this` is nsIContentFrameMessageManager\n// with an attribute `content` that corresponds to the window\n\nif (typeof module !== "undefined" && module.exports) {\n module.exports.saveAs = saveAs;\n} else if ((typeof define !== "undefined" && define !== null) && (define.amd !== null)) {\n define("FileSaver.js", function() {\n return saveAs;\n });\n}\n'},MnM9:function(t,e,n){n("8rVx")(n("H/Y7"))},"S/jZ":function(t,e,n){"use strict";n.r(e),n.d(e,"export_table_to_excel",function(){return f}),n.d(e,"export_json_to_excel",function(){return v});var o=n("m1cH"),r=n.n(o),i=n("EUZL"),a=n.n(i);function l(t,e){return e&&(t+=1462),(Date.parse(t)-new Date(Date.UTC(1899,11,30)))/864e5}function s(t,e){for(var n={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},r=0;r!=t.length;++r)for(var i=0;i!=t[r].length;++i){o.s.r>r&&(o.s.r=r),o.s.c>i&&(o.s.c=i),o.e.r<r&&(o.e.r=r),o.e.c<i&&(o.e.c=i);var s={v:t[r][i]};if(null!=s.v){var c=a.a.utils.encode_cell({c:i,r:r});"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[c]=s}}return o.s.c<1e7&&(n["!ref"]=a.a.utils.encode_range(o)),n}function c(){if(!(this instanceof c))return new c;this.SheetNames=[],this.Sheets={}}function u(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),o=0;o!=t.length;++o)n[o]=255&t.charCodeAt(o);return e}function f(t){var e=function(t){for(var e=[],n=t.querySelectorAll("tr"),o=[],r=0;r<n.length;++r){for(var i=[],a=n[r].querySelectorAll("td"),l=0;l<a.length;++l){var s=a[l],c=s.getAttribute("colspan"),u=s.getAttribute("rowspan"),f=s.innerText;if(""!==f&&f==+f&&(f=+f),o.forEach(function(t){if(r>=t.s.r&&r<=t.e.r&&i.length>=t.s.c&&i.length<=t.e.c)for(var e=0;e<=t.e.c-t.s.c;++e)i.push(null)}),(u||c)&&(u=u||1,c=c||1,o.push({s:{r:r,c:i.length},e:{r:r+u-1,c:i.length+c-1}})),i.push(""!==f?f:null),c)for(var v=0;v<c-1;++v)i.push(null)}e.push(i)}return[e,o]}(document.getElementById(t)),n=e[1],o=e[0],r=new c,i=s(o);i["!merges"]=n,r.SheetNames.push("SheetJS"),r.Sheets.SheetJS=i;var l=a.a.write(r,{bookType:"xlsx",bookSST:!1,type:"binary"});saveAs(new Blob([u(l)],{type:"application/octet-stream"}),"test.xlsx")}function v(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.header,n=t.data,o=t.filename,i=t.autoWidth,l=void 0===i||i,f=t.bookType,v=void 0===f?"xlsx":f;o=o||"excel-list",(n=[].concat(r()(n))).unshift(e);var d=new c,p=s(n);if(l){for(var b=n.map(function(t){return t.map(function(t){return null==t?{wch:10}:t.toString().charCodeAt(0)>255?{wch:2*t.toString().length}:{wch:t.toString().length}})}),h=b[0],_=1;_<b.length;_++)for(var w=0;w<b[_].length;w++)h[w].wch<b[_][w].wch&&(h[w].wch=b[_][w].wch);p["!cols"]=h}d.SheetNames.push("SheetJS"),d.Sheets.SheetJS=p;var m=a.a.write(d,{bookType:v,bookSST:!1,type:"binary"});saveAs(new Blob([u(m)],{type:"application/octet-stream"}),o+"."+v)}n("MnM9")}}]);