Procházet zdrojové kódy

feat: 增加fail delMaterial

gemercheung před 1 rokem
rodič
revize
632c4c4900

+ 7 - 2
packages/qjkankan-editor/src/views/material/audio/index.vue

@@ -515,7 +515,7 @@ export default {
           eachFile.name,
           eachFile.name.toLowerCase().indexOf("mp3")
         );
-   
+
         if (eachFile.name.toLowerCase().indexOf("mp3") <= -1) {
           setTimeout(() => {
             this.$msg({
@@ -590,14 +590,19 @@ export default {
         this.uploadListForUI.push(itemInUploadList);
       });
     },
-    onCancelTask(uid) {
+    async onCancelTask(uid) {
       const index = this.uploadListForUI.findIndex((eachItem) => {
         return eachItem.uid === uid;
       });
       if (this.uploadListForUI[index].status === "LOADING") {
         this.uploadListForUI[index].abortHandler.abort();
       } else {
+        const item = this.uploadListForUI[index];
         this.uploadListForUI.splice(index, 1);
+        if (item && item.backendId) {
+          console.log("新增取消增加删除通知");
+          await delMaterial(item.backendId);
+        }
       }
     },
     getMoreMaterialItem() {

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

@@ -600,14 +600,19 @@ export default {
         this.uploadListForUI.push(itemInUploadList);
       });
     },
-    onCancelTask(uid) {
+    async onCancelTask(uid) {
       const index = this.uploadListForUI.findIndex((eachItem) => {
         return eachItem.uid === uid;
       });
       if (this.uploadListForUI[index].status === "LOADING") {
         this.uploadListForUI[index].abortHandler.abort();
       } else {
+        const item = this.uploadListForUI[index];
         this.uploadListForUI.splice(index, 1);
+        if (item && item.backendId) {
+          console.log("新增取消增加删除");
+          await delMaterial(item.backendId);
+        }
       }
     },
     getMoreMaterialItem() {

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

@@ -815,14 +815,19 @@ export default {
         this.uploadListForUI.push(itemInUploadList);
       });
     },
-    onCancelTask(uid) {
+    async onCancelTask(uid) {
       const index = this.uploadListForUI.findIndex((eachItem) => {
         return eachItem.uid === uid;
       });
       if (this.uploadListForUI[index].status === "LOADING") {
         this.uploadListForUI[index].abortHandler.abort();
       } else {
+        const item = this.uploadListForUI[index];
         this.uploadListForUI.splice(index, 1);
+        if (item && item.backendId) {
+          console.log("新增取消增加删除通知");
+          await delMaterial(item.backendId);
+        }
       }
     },
     getMoreMaterialItem(islongpolling = null) {

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

@@ -591,14 +591,19 @@ export default {
         this.uploadListForUI.push(itemInUploadList);
       });
     },
-    onCancelTask(uid) {
+    async onCancelTask(uid) {
       const index = this.uploadListForUI.findIndex((eachItem) => {
         return eachItem.uid === uid;
       });
       if (this.uploadListForUI[index].status === "LOADING") {
         this.uploadListForUI[index].abortHandler.abort();
       } else {
+        const item = this.uploadListForUI[index];
         this.uploadListForUI.splice(index, 1);
+        if (item && item.backendId) {
+          console.log("新增取消增加删除通知");
+          await delMaterial(item.backendId);
+        }
       }
     },
     getMoreMaterialItem() {