lsc 2 jaren geleden
bovenliggende
commit
8a7163e03d
1 gewijzigde bestanden met toevoegingen van 11 en 10 verwijderingen
  1. 11 10
      src/components/pages/addCourse.vue

+ 11 - 10
src/components/pages/addCourse.vue

@@ -880,9 +880,7 @@
                         <div>
                         <div>
                           <span>{{ unitJson[unitIndex].chapterInfo[0].taskJson[
                           <span>{{ unitJson[unitIndex].chapterInfo[0].taskJson[
                             itemTaskIndex
                             itemTaskIndex
-                          ].isFinishSize2 ? unitJson[unitIndex].chapterInfo[0].taskJson[
-                            itemTaskIndex
-                          ].isFinishSize2 :0 }}M</span> / <span>{{ unitJson[unitIndex].chapterInfo[0].taskJson[
+                          ].isFinishSize2}}M</span> / <span>{{ unitJson[unitIndex].chapterInfo[0].taskJson[
   itemTaskIndex
   itemTaskIndex
 ].isAllSize2 }}M</span>
 ].isAllSize2 }}M</span>
                         </div>
                         </div>
@@ -3882,9 +3880,11 @@ export default {
           queueSize: 2,
           queueSize: 2,
           leavePartsOnError: true,
           leavePartsOnError: true,
         };
         };
-        bucket
-          .upload(params, options)
-          .on("httpUploadProgress", function (evt) {
+        const request = bucket.upload(params, options)
+        request.on("httpUploadProgress", function (evt) {
+            // request.abort();
+            // this.abort();
+            // bucket.abortMultipartUpload.bind(bucket);
             //这里可以写进度条
             //这里可以写进度条
             // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
             // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
             _this.unitJson[unitIndex].chapterInfo[0].taskJson[
             _this.unitJson[unitIndex].chapterInfo[0].taskJson[
@@ -3897,7 +3897,7 @@ export default {
               1024 /
               1024 /
               1024
               1024
             ).toFixed(2)
             ).toFixed(2)
-            this.$forceUpdate();
+            _this.$forceUpdate();
           })
           })
           .send(function (err, data) {
           .send(function (err, data) {
             // loading.close();
             // loading.close();
@@ -3918,8 +3918,9 @@ export default {
             }, 1000);
             }, 1000);
             _this.inputShow2 = true;
             _this.inputShow2 = true;
             if (err) {
             if (err) {
-              var a = _this.$refs.upload1.uploadFiles;
-              a.splice(a.length - 1, a.length);
+              console.log(err);
+              // var a = _this.$refs.upload1.uploadFiles;
+              // a.splice(a.length - 1, a.length);
               _this.$message.error("上传失败");
               _this.$message.error("上传失败");
             } else {
             } else {
               if (type == 2 || type == 3) {
               if (type == 2 || type == 3) {
@@ -3954,7 +3955,7 @@ export default {
               console.log(data.Location);
               console.log(data.Location);
             }
             }
           });
           });
-      }
+        }
     },
     },
     addunit() {
     addunit() {
       this.unitJson.push({
       this.unitJson.push({