Explorar o código

Merge branch 'master' of http://git.cc-lotus.info/new_train/train-student

lrf402788946 %!s(int64=5) %!d(string=hai) anos
pai
achega
92ca59a555
Modificáronse 1 ficheiros con 12 adicións e 8 borrados
  1. 12 8
      src/views/class/index.vue

+ 12 - 8
src/views/class/index.vue

@@ -74,10 +74,10 @@ export default {
     isleftarrow: '',
     navShow: true,
   }),
-  created() {
-    this.searchInfo();
-    this.searchstu();
-    this.findGroup();
+  async created() {
+    await this.searchInfo();
+    await this.searchstu();
+    await this.findGroup();
   },
   computed: {
     ...mapState(['user']),
@@ -150,10 +150,14 @@ export default {
       let noGroupStudentNames = [];
       // 循环所有学生id
       for (let i = 0; i < studentList.length; i++) {
-        // 循环有组学生id
-        for (let j = 0; j < studentIds.length; j++) {
-          if (studentList[i].id != studentIds[j]) {
-            noGroupStudentNames.push(studentList[i].name);
+        if (studentIds.length === 0) {
+          noGroupStudentNames.push(studentList[i].name);
+        } else {
+          // 循环有组学生id
+          for (let j = 0; j < studentIds.length; j++) {
+            if (studentList[i].id != studentIds[j]) {
+              noGroupStudentNames.push(studentList[i].name);
+            }
           }
         }
       }