소스 검색

修改主题图片不插入富文本

long 3 년 전
부모
커밋
4c581ab731
1개의 변경된 파일12개의 추가작업 그리고 12개의 파일을 삭제
  1. 12 12
      operationSupport/src/components/Tinymce/index.vue

+ 12 - 12
operationSupport/src/components/Tinymce/index.vue

@@ -286,18 +286,18 @@ export default {
             window.tinymce.get(this.tinymceId).setContent(newContent);
         },
         imageSuccessCBK(arr) {
-            if (arr) {
-                // 获取内容,允许上传图片的线上大小,个数
-                let content = window.tinymce.get(this.tinymceId).getContent();
-                let img = [];
-                content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, function (match, capture) {
-                    img.push(capture);
-                });
-                // if (img.length >= 3) {
-                //     return this.$message.warning('最多插入三张图片');
-                // }
-                arr.forEach((v) => window.tinymce.get(this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" />`));
-            }
+            // if (arr) {
+            //     // 获取内容,允许上传图片的线上大小,个数
+            //     let content = window.tinymce.get(this.tinymceId).getContent();
+            //     let img = [];
+            //     content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, function (match, capture) {
+            //         img.push(capture);
+            //     });
+            //     // if (img.length >= 3) {
+            //     //     return this.$message.warning('最多插入三张图片');
+            //     // }
+            //     arr.forEach((v) => window.tinymce.get(this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" />`));
+            // }
         }
     }
 };