Jelajahi Sumber

fix(pptEasy/addCourse3): 新增上传加载状态控制逻辑

新增uploadLoading状态变量,完善多场景下的上传防重复提交逻辑,修复可能的重复触发上传问题
lsc 3 jam lalu
induk
melakukan
01db3646e7
1 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 6 1
      src/components/pages/pptEasy/addCourse3.vue

+ 6 - 1
src/components/pages/pptEasy/addCourse3.vue

@@ -1037,6 +1037,7 @@ export default {
       role: this.$route.query.role,
       cid: this.$route.query.cid != undefined ? this.$route.query.cid : "",
       uploadWorkLoading: false,
+      uploadLoading: false,
       dialogVisibleBasicInfo: false,
       dialogVisibleClass: false,
       dialogVisiblePublish: false,
@@ -1973,14 +1974,16 @@ export default {
     },
     async addWork(type = 1, ctype = 1) {
       if (this.$refs.pptIframeRef.contentWindow.window.pptLoading !== 2) return this.$message.info(this.lang.ssPptLoad)
-      if (this.uploadWorkLoading) return;
+      if (this.uploadWorkLoading || this.uploadLoading) return;
       if(ctype != 3){
         this.uploadWorkLoading = true;
       }
+      this.uploadLoading = true;
       let _pptData = await this.getPPtJson();
       let imgExporting = await this.getPPTimgExporting()
       if (imgExporting) {
         this.uploadWorkLoading = false;
+        this.uploadLoading = false;
         const msg = type == 1 ? this.lang.ssPptLoad2 : this.lang.ssPptLoad3;
         this.showToast(msg);
         return;
@@ -2058,6 +2061,7 @@ export default {
           if(type != 3){
             this.uploadWorkLoading = false;
           }
+          this.uploadLoading = false;
           console.log(this.steps);
           // if (this.steps != 1 && this.steps != 2 && this.steps != 3) {
           this.showToast(this.lang.ssSaveSuccess);
@@ -2087,6 +2091,7 @@ export default {
         })
         .catch(err => {
           this.uploadWorkLoading = false;
+          this.uploadLoading = false;
           this.addOp3(
             "1",
             "",