unknown 3 年之前
父节点
当前提交
d11827c29e
共有 2 个文件被更改,包括 3 次插入11 次删除
  1. 1 9
      src/components/Tinymce/components/EditorFile.vue
  2. 2 2
      src/components/Tinymce/index.vue

+ 1 - 9
src/components/Tinymce/components/EditorFile.vue

@@ -6,7 +6,7 @@
     <el-dialog :visible.sync="dialogVisible">
       <el-upload
         ref="upload"
-        :limit="1"
+        :multiple="true"
         :action="action"
         :auto-upload="true"
         :show-file-list="false"
@@ -52,11 +52,6 @@ export default {
     },
     handleSubmit() {
       const arr = Object.keys(this.listObj).map(v => this.listObj[v])
-      // if (!this.checkAllSuccess()) {
-      //   this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!')
-      //   return
-      // }
-      // console.log( "this.listObj", this.listObj)
       this.$emit('successCBK', arr)
       this.listObj = {}
       this.fileList = []
@@ -90,9 +85,6 @@ export default {
       return new Promise((resolve, reject) => {
         const img = new Image()
         img.src = _URL.createObjectURL(file)
-        // img.onload = function() {
-        //   _self.listObj[fileName] = { hasSuccess: false, uid: file.uid, width: this.width, height: this.height }
-        // }
         resolve(true)
       })
     }

+ 2 - 2
src/components/Tinymce/index.vue

@@ -5,7 +5,7 @@
 
       <el-upload
         ref="upload"
-        :limit="1"
+        :multiple="true"
         action="/api/artical/uploadFile"
         :auto-upload="true"
         :show-file-list="false"
@@ -249,7 +249,7 @@ export default {
       console.log( res, file.name )
       if (res.code === 200) {
         window.tinymce.get(this.tinymceId).insertContent(
-        `<a target="_blank" style="cursor:hand;color:blue" href="http://smoa.ndjsxh.cn:8888/preview/${res.data.filename}">${file.name}</a></br>`)
+        `<p><a target="_blank" style="cursor:hand;color:blue;display: block;" href="http://smoa.ndjsxh.cn:8888/preview/${res.data.filename}">${file.name}</a></p>`)
       } else {
         this.$message.error('图片上传失败')
       }