Selaa lähdekoodia

缺陷复制粘贴功能

PrinceLee 5 vuotta sitten
vanhempi
sitoutus
83055bfd9d

+ 2 - 0
src/views/projectManage/bugList/details/index.vue

@@ -1225,6 +1225,8 @@ export default {
         type: 'success'
       })
       this.bugUpdate(this.bug, 'accessory')
+      this.imageName = null
+      this.imageUrl = null
       window.uploadFiles = null
     },
     updateFile(file) {

+ 12 - 0
src/views/projectManage/bugList/file/createdBug.vue

@@ -152,6 +152,7 @@
                 <el-upload
                   class="upload-demo"
                   action="http://star.xiaojukeji.com/upload/img.node"
+                  :on-remove="handleRemove"
                   :on-preview="handlePictureCardPreview"
                   :on-progress="progress"
                   :on-success="handleChange"
@@ -447,6 +448,14 @@ export default {
         }))
       })
     },
+    handleRemove(file, fileList) {
+      this.fileDbList = this.fileDbList.filter(item => {
+        return item.name !== file.name
+      })
+      this.fileList = this.fileList.filter(item => {
+        return item.name !== file.name
+      })
+    },
     pasteUpload() {
       if (!this.modalShow) {
         return false
@@ -470,11 +479,14 @@ export default {
       }
       this.fileList.push(item)
       this.fileDbList.push(item)
+      this.formInline.accessory = JSON.stringify(this.fileDbList)
       this.$message({
         showClose: true,
         message: '文件上传成功',
         type: 'success'
       })
+      this.imageName = null
+      this.imageUrl = null
       window.uploadFiles = null
     },
     updateFile(file) {