From bf97988edfb77f5436d4ef20575e9f34477f36a7 Mon Sep 17 00:00:00 2001 From: long <515897141@qq.com> Date: 星期三, 08 十二月 2021 11:17:41 +0800 Subject: [PATCH] 多图上传组件添加可多选图片 --- src/components/WangEnduit/index.vue | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/src/components/WangEnduit/index.vue b/src/components/WangEnduit/index.vue index b5ed31b..3e0d96d 100644 --- a/src/components/WangEnduit/index.vue +++ b/src/components/WangEnduit/index.vue @@ -87,7 +87,7 @@ formData.append('file', files[0]) self.postFN( { - url: 'admin/image/upload', + url: 'admin/image/upload?folderCode=IMG', header: { 'Content-Type': 'multipart/form-data' }, params: formData, mockData: { @@ -108,6 +108,20 @@ // info 鏄渶瑕佹彁绀虹殑鍐呭 self.$messagewarn(info) } + // 杩囨护word澶嶅埗 + this.editor.customConfig.pasteTextHandle = function(content) { + var html = content + html = html.replace(/<\/?SPANYES[^>]*>/gi, '')// 绉婚櫎span + html = html.replace(/<\!\-\-(.|[\r\n])*?\-\->/gi, '')// 绉婚櫎娉ㄩ噴 + html = html.replace(/<(\w[^>]*) {2}lang=([^|>]*)([^>]*)/gi, '<$1$3')// 绉婚櫎lang灞炴�� + html = html.replace(/<\\?\?xml[^>]*>/gi, '')// 绉婚櫎xml鍜岀浉鍏虫弿杩� + html = html.replace(/<\/?\w+:[^>]*>/gi, '')// 绉婚櫎xml鍛藉悕绌洪棿鐨勬爣绛� + html = html.replace(/ /gi, '')// 绉婚櫎绌烘牸 + html = html.replace(/^\s+|\s+$/g, '') + html = html.replace(/<o:p> <\/o:p>/g, '')// 绉婚櫎鏍囩 + html = html.replace(/<br\/>/g, '')// 绉婚櫎br鏍囩 + return html + } this.editor.create() // 鍒涘缓瀵屾枃鏈疄渚� // if (!this.content) { // // this.editor.txt.html('璇风紪杈戝唴瀹�1') -- Gitblit v1.8.0