lsc преди 2 години
родител
ревизия
539952629a
променени са 1 файла, в които са добавени 10 реда и са изтрити 2 реда
  1. 10 2
      src/components/pages/addCourse.vue

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

@@ -4474,8 +4474,9 @@ 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 &&
+                _unitIndex == d
               ) {
                 index = 2;
                 chapindex = d;
@@ -4486,6 +4487,13 @@ export default {
             _unitJson = JSON.parse(JSON.stringify(_unitJson2));
           }
 
+          if (_chapAarry.length) {
+            if (chapindex > _unitIndex) {
+              this.isDelete = 2;
+              this.unitIndex--;
+            }
+          }
+
           for (let i = 0; i < unitJson.length; i++) {
             if (
               i < _unitJson.length - 1 &&