Przeglądaj źródła

智能研报富文本上传图片fix

jwyu 11 miesięcy temu
rodzic
commit
598563466b
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      src/views/smartReport/components/TextEdit.vue

+ 5 - 0
src/views/smartReport/components/TextEdit.vue

@@ -25,6 +25,9 @@ export default {
             editor: null,
             lastEditRange: null,
             froalaConfig:{
+                imageUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url
+                videoUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url
+                fileUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url 更多上传介绍 请访问https://www.froala.com/wysiwyg-editor/docs/options
                 toolbarButtons: [
                     "textColor",
                     "bold",
@@ -100,6 +103,8 @@ export default {
     methods: {
         sendHtml(){
             const str=this.html.replace(/<p data-f-id=\"pbf\".*?<\/p>/g, "")
+            //如果富文本中有未上传完成的图片,去除这个dom
+			$('.fr-element').find('img.fr-uploading').length&&$('.fr-element').find('img.fr-uploading').remove()
             this.$emit('textChange', str)
         }
     },