瀏覽代碼

管理中心:点击上传列表项的小叉叉,不是一律调用abort,而是上传中的调用abort,已经失败的直接删掉这条。

任一存 2 年之前
父節點
當前提交
ada5a239f8

+ 5 - 1
packages/qjkankan-editor/src/views/material/audio/index.vue

@@ -339,7 +339,11 @@ export default {
       const index = this.uploadListForUI.findIndex((eachItem) => {
         return eachItem.uid === uid
       })
-      this.uploadListForUI[index].abortHandler.abort()
+      if (this.uploadListForUI[index].status === 'LOADING') {
+        this.uploadListForUI[index].abortHandler.abort()
+      } else {
+        this.uploadListForUI.splice(index, 1)
+      }
     },
     getMoreMaterialItem() {
       this.isRequestingMoreData = true

+ 5 - 1
packages/qjkankan-editor/src/views/material/image/index.vue

@@ -352,7 +352,11 @@ export default {
       const index = this.uploadListForUI.findIndex((eachItem) => {
         return eachItem.uid === uid
       })
-      this.uploadListForUI[index].abortHandler.abort()
+      if (this.uploadListForUI[index].status === 'LOADING') {
+        this.uploadListForUI[index].abortHandler.abort()
+      } else {
+        this.uploadListForUI.splice(index, 1)
+      }
     },
     getMoreMaterialItem() {
       this.isRequestingMoreData = true

+ 5 - 1
packages/qjkankan-editor/src/views/material/pano/index.vue

@@ -504,7 +504,11 @@ export default {
       const index = this.uploadListForUI.findIndex((eachItem) => {
         return eachItem.uid === uid
       })
-      this.uploadListForUI[index].abortHandler.abort()
+      if (this.uploadListForUI[index].status === 'LOADING') {
+        this.uploadListForUI[index].abortHandler.abort()
+      } else {
+        this.uploadListForUI.splice(index, 1)
+      }
     },
     getMoreMaterialItem(islongpolling = null) {
       this.isRequestingMoreData = true

+ 5 - 1
packages/qjkankan-editor/src/views/material/video/index.vue

@@ -347,7 +347,11 @@ export default {
       const index = this.uploadListForUI.findIndex((eachItem) => {
         return eachItem.uid === uid
       })
-      this.uploadListForUI[index].abortHandler.abort()
+      if (this.uploadListForUI[index].status === 'LOADING') {
+        this.uploadListForUI[index].abortHandler.abort()
+      } else {
+        this.uploadListForUI.splice(index, 1)
+      }
     },
     getMoreMaterialItem() {
       this.isRequestingMoreData = true