lsc 2 years ago
parent
commit
03280410c0
1 changed files with 19 additions and 14 deletions
  1. 19 14
      src/components/pages/addCourse.vue

+ 19 - 14
src/components/pages/addCourse.vue

@@ -4511,22 +4511,27 @@ export default {
             if (chapindex < _unitIndex) {
               this.isDelete = 2;
               this.unitIndex--;
-            } else if (
-              _unitJson2[this.unitIndex].chapterInfo[0].chapterid !=
-              _unitJson[this.unitIndex].chapterInfo[0].chapterid
-            ) {
+            }else {
               this.isDelete = 2;
-              for (let n = 0; n < _unitJson.length; n++) {
-                if (
-                  _unitJson2[this.unitIndex].chapterInfo[0].chapterid ==
-                  _unitJson[n].chapterInfo[0].chapterid
-                ) {
-                  this.unitIndex = n;
-                  _unitJson[n] = _unitJson2[this.unitIndex];
-                  break;
-                }
-              }
+              this.unitIndex++;
             }
+
+            // else if (
+            //   _unitJson2[this.unitIndex].chapterInfo[0].chapterid !=
+            //   _unitJson[this.unitIndex].chapterInfo[0].chapterid
+            // ) {
+            //   this.isDelete = 2;
+            //   for (let n = 0; n < _unitJson.length; n++) {
+            //     if (
+            //       _unitJson2[this.unitIndex].chapterInfo[0].chapterid ==
+            //       _unitJson[n].chapterInfo[0].chapterid
+            //     ) {
+            //       this.unitIndex = n;
+            //       _unitJson[n] = _unitJson2[this.unitIndex];
+            //       break;
+            //     }
+            //   }
+            // }
           } else if(index != 2) {
             _unitJson[this.unitIndex] = _unitJson2[this.unitIndex];
           }