From 26de0696f74e183e3aadad2e9ff1918b40e5c8cc Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期四, 09 三月 2023 13:46:27 +0800 Subject: [PATCH] 修改导出文书word --- zhengcaioa/zhengcaioa/wwwroot/js/jquery.wordexport.js | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/zhengcaioa/zhengcaioa/wwwroot/js/jquery.wordexport.js b/zhengcaioa/zhengcaioa/wwwroot/js/jquery.wordexport.js index 14ac6d5..8481785 100644 --- a/zhengcaioa/zhengcaioa/wwwroot/js/jquery.wordexport.js +++ b/zhengcaioa/zhengcaioa/wwwroot/js/jquery.wordexport.js @@ -1,4 +1,4 @@ -锘縤f (typeof jQuery !== "undefined" && typeof saveAs !== "undefined") { +if (typeof jQuery !== "undefined" && typeof saveAs !== "undefined") { (function($) { $.fn.wordExport = function(fileName) { fileName = typeof fileName !== 'undefined' ? fileName : "jQuery-Word-Export"; @@ -14,14 +14,14 @@ }; // Clone selected element before manipulating it var markup = $(this).clone(); - + // Remove hidden elements from the output markup.each(function() { var self = $(this); if (self.is(':hidden')) self.remove(); }); - + // Embed all images using Data URLs var images = Array(); var img = markup.find('img'); @@ -49,7 +49,7 @@ data: uri.substring(uri.indexOf(",") + 1) }; } - + // Prepare bottom of mhtml file with image data var mhtmlBottom = "\n"; for (var i = 0; i < images.length; i++) { @@ -60,13 +60,13 @@ mhtmlBottom += images[i].data + "\n\n"; } mhtmlBottom += "--NEXT.ITEM-BOUNDARY--"; - + //TODO: load css from included stylesheet var styles = ""; - + // Aggregate parts of the file together var fileContent = static.mhtml.top.replace("_html_", static.mhtml.head.replace("_styles_", styles) + static.mhtml.body.replace("_body_", markup.html())) + mhtmlBottom; - + // Create a Blob with the file contents var blob = new Blob([fileContent], { type: "application/msword;charset=utf-8" @@ -81,4 +81,4 @@ if (typeof saveAs === "undefined") { console.error("jQuery Word Export: missing dependency (FileSaver.js)"); } -} \ No newline at end of file +} -- Gitblit v1.9.1