Kaynağa Gözat

评卷员分组修改

zhangjie 3 yıl önce
ebeveyn
işleme
e91407bf8e
1 değiştirilmiş dosya ile 13 ekleme ve 8 silme
  1. 13 8
      src/modules/grading/GradingGroupManage.vue

+ 13 - 8
src/modules/grading/GradingGroupManage.vue

@@ -114,15 +114,20 @@ export default {
     },
     async save() {
       this.isSubmit = true;
-      const toSaveAll = this.groups.map(group => {
-        return updateGradingGroup(this.subjectId, group);
-      });
-      const result = await Promise.all(toSaveAll).catch(() => {});
-      this.isSubmit = false;
-      if (!result) {
-        this.$Message.error("保存失败,请重新尝试!");
-        return;
+      for (let i = 0; i < this.groups.length; i++) {
+        const group = this.groups[i];
+        let result = await updateGradingGroup(
+          this.subjectId,
+          group
+        ).catch(() => {});
+        if (!result) {
+          this.isSubmit = false;
+          this.$Message.error("保存失败,请重新尝试!");
+          return;
+        }
       }
+
+      this.isSubmit = false;
       this.$Message.success("保存成功!");
       this.initData();
     },