vue2通过jquery.wordexport.js实现word导出

阅读: 评论:0

2024年1月25日发(作者:)

vue2通过jquery.wordexport.js实现word导出

} , force_saveable_type = "application/octet-stream" // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to , arbitrary_revoke_timeout = 1000 * 40 // in ms , revoke = function(file) { var revoker = function() { if (typeof file === "string") { // file is an object URL get_URL().revokeObjectURL(file); } else { // file is a File (); } }; setTimeout(revoker, arbitrary_revoke_timeout); } , dispatch = function(filesaver, event_types, event) { event_types = [].concat(event_types); var i = event_; while (i--) { var listener = filesaver["on" + event_types[i]]; if (typeof listener === "function") { try { (filesaver, event || filesaver); } catch (ex) { throw_outside(ex); } } } } , auto_bom = function(blob) { // prepend BOM for UTF-8 XML and text/* types (including HTML) // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF if (/^s*(?:textS*|applicationxml|S*S*+xml)s*;.*charsets*=s*utf-8/()) { return new Blob([arCode(0xFEFF), blob], {type: }); } return blob; } , FileSaver = function(blob, name, no_auto_bom) { if (!no_auto_bom) { blob = auto_bom(blob); } // First try ad, then web filesystem, then object URLs var filesaver = this , type = , force = type === force_saveable_type , object_url , dispatch_all = function() { dispatch(filesaver, "writestart progress write writeend".split(" ")); } // on any filesys errors revert to saving with object URLs , fs_error = function() { if ((is_chrome_ios || (force && is_safari)) && ader) { // Safari doesn't allow downloading of blob urls var reader = new FileReader(); end = function() { var url = is_chrome_ios ? : e(/^data:[^;]*;/, 'data:attachment/file;'); var popup = (url, '_blank'); if(!popup) = url; url=undefined; // release reference before dispatching tate = ; dispatch_all(); }; DataURL(blob); tate = ; return; } // don't create more object URLs than needed if (!object_url) { object_url = get_URL().createObjectURL(blob); } if (force) { = object_url; } else { var opened = (object_url, "_blank");

var opened = (object_url, "_blank"); if (!opened) { = object_url; } } tate = ; dispatch_all(); revoke(object_url); } ; tate = ; if (can_use_save_link) { object_url = get_URL().createObjectURL(blob); setTimeout(function() { save_ = object_url; save_ad = name; click(save_link); dispatch_all(); revoke(object_url); tate = ; }); return; } fs_error(); } , FS_proto = ype , saveAs = function(blob, name, no_auto_bom) { return new FileSaver(blob, name || || "download", no_auto_bom); } ; // IE 10+ (native saveAs) if (typeof navigator !== "undefined" && OrOpenBlob) { return function(blob, name, no_auto_bom) { name = name || || "download"; if (!no_auto_bom) { blob = auto_bom(blob); } return OrOpenBlob(blob, name); }; } FS_ = function(){}; FS_tate = FS_ = 0; FS_G = 1; FS_ = 2; FS_ = FS_estart = FS_ress = FS_e = FS_t = FS_r = FS_eend = null; return saveAs;}( typeof self !== "undefined" && self || typeof window !== "undefined" && window || t));// `self` is undefined in Firefox for Android content script context// while `this` is nsIContentFrameMessageManager// with an attribute `content` that corresponds to the windowif (typeof module !== "undefined" && s) { = saveAs;} else if ((typeof define !== "undefined" && define !== null) && ( !== null)) { define([], function() { return saveAs; // Apple does not allow , see /library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWind

return saveAs; });} saveAs = require("./").saveAs;if (typeof jQuery !== "undefined" && typeof saveAs !== "undefined") { (function($) { $.port = function(fileName, baseArr) { fileName = typeof fileName !== 'undefined' ? fileName : "jQuery-Word-Export"; var static = { mhtml: { head: "nnnn", body: "_body_" } }; var options = { maxWidth: 624 }; // Clone selected element before manipulating it var markup = $(this).clone(); // Remove hidden elements from the output (function() { var self = $(this); if ((':hidden')) (); }); // Embed all images using Data URLs // var images = Array(); // var img = ('img'); // for (var i = 0; i < ; i++) { // // Calculate dimensions of output image // var w = (img[i].width, th); // var h = img[i].height * (w / img[i].width); // // Create canvas for converting image to data URL // var canvas = Element("CANVAS"); // = w; // = h; // // Draw image to canvas // var context = text('2d'); // age(img[i], 0, 0, w, h); // // Get data URL encoding of image // var uri = URL("image/png"); // (uri,'uri') // $(img[i]).attr("src", img[i].src); // img[i].width = w; // img[i].height = h; // // Save encoded image to array // images[i] = { // type: ing(f(":") + 1, f(";")), // encoding: ing(f(";") + 1, f(",")), // location: $(img[i]).attr("src"), // data: ing(f(",") + 1) // }; // } // Prepare bottom of mhtml file with image data var mhtmlBottom = "n"; for (var i = 0; i < ; i++) { mhtmlBottom += "---BOUNDARYn"; mhtmlBottom += "Content-Location: " + baseArr[i].location + "n"; mhtmlBottom += "Content-Type: " + baseArr[i].type + "n"; mhtmlBottom += "Content-Transfer-Encoding: " + baseArr[i].encoding + "nn"; mhtmlBottom += baseArr[i].data + "nn"; } top: "Mime-Version: 1.0nContent-Base: " + + "nContent-Type: Multipart/related; boundary="-BOUNDARY";type="text/html"

vue2通过jquery.wordexport.js实现word导出

本文发布于:2024-01-25 22:59:50,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/1706194790432.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:导出   实现
留言与评论(共有 0 条评论)
   
验证码:
排行榜

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23