lsc vor 3 Jahren
Ursprung
Commit
34d27d3cfc
1 geänderte Dateien mit 6 neuen und 8 gelöschten Zeilen
  1. 6 8
      src/components/pages/addCourse.vue

+ 6 - 8
src/components/pages/addCourse.vue

@@ -4474,11 +4474,11 @@ export default {
             console.log(_chapAarry);
             for (let d = 0; d < _unitJson2.length; d++) {
               if (
-                _chapAarry.indexOf(_unitJson2[d].chapterInfo[0].chapterid) !=
-                  -1 &&
-                _unitIndex == d
+                _chapAarry.indexOf(_unitJson2[d].chapterInfo[0].chapterid) != -1
               ) {
-                index = 2;
+                if (_unitIndex == d) {
+                  index = 2;
+                }
                 chapindex = d;
                 // this.$message.error("您所修改的阶段已经被其他老师删除了");
               }
@@ -4487,8 +4487,6 @@ export default {
             _unitJson = JSON.parse(JSON.stringify(_unitJson2));
           }
 
-          
-
           for (let i = 0; i < unitJson.length; i++) {
             if (
               i < _unitJson.length - 1 &&
@@ -4508,13 +4506,13 @@ export default {
             //   continue;
             // } else
           }
-          
+
           if (_chapAarry.length) {
             if (chapindex > _unitIndex) {
               this.isDelete = 2;
               this.unitIndex--;
             }
-          }else if (
+          } else if (
             _unitJson2[this.unitIndex].chapterInfo[0].chapterid !=
             _unitJson[this.unitIndex].chapterInfo[0].chapterid
           ) {