From 570af41adaa82553e9d24b6b641db9e1f2f533ae Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 12 七月 2024 14:47:58 +0800
Subject: [PATCH] fix:修改试卷-全选考生bug修复

---
 src/views/exam/personalRandomTemplate/edit.vue |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/views/exam/personalRandomTemplate/edit.vue b/src/views/exam/personalRandomTemplate/edit.vue
index 6bd5423..80e6559 100644
--- a/src/views/exam/personalRandomTemplate/edit.vue
+++ b/src/views/exam/personalRandomTemplate/edit.vue
@@ -247,7 +247,10 @@
         limitDateTime: [],
         name: '',
         suggestTime: null,
-        titleItems: [],
+        titleItems: [{
+          name: '',
+          questionItems: []
+        }],
         subjectSource: {},
         questionTypeVMS: [],
         examineeList: [],
@@ -313,6 +316,7 @@
       _this.subjectFilter = _this.subjects;
     });
     if (id && parseInt(id) !== 0) {
+      this.selectAllBoolean = false;
       _this.formLoading = true;
       await examPaperApi.selfselect(id).then(re => {
         const { userIds, userNames } = re.response;
@@ -355,6 +359,7 @@
       this.student.multipleSelection = val;
     },
     selectAll () {
+      this.preSelectAll();
       this.selectAllBoolean = false;
       let param = { ...this.student };
       param.pageSize = 999999;
@@ -380,6 +385,18 @@
       });
       this.student.multipleSelection = [];
       this.studentDialog = false;
+    },
+    preSelectAll() {
+      this.selectAllBoolean = true;
+      this.$refs.multipleTable.clearSelection();
+      this.form.userIds = this.student.multipleSelection.map((item) => item.id);
+      this.form.examineeList = this.student.multipleSelection.map((item) => {
+        return {
+          id: item.id,
+          realName: item.realName
+        };
+      });
+      this.student.multipleSelection = [];
     },
     getTags() {
       userApi.tagList(null).then(data => {
@@ -469,7 +486,10 @@
         console.log(this.form.subjectSource);
         console.log(this.form.questionTypeVMS);
         // this.form.paperType = 7
-        this.form.titleItems = [];
+        this.form.titleItems = [{
+          name: '',
+          questionItems: []
+        }];
       } else {
         this.form.subjectSource = {};
         this.subjectIdList = [];

--
Gitblit v1.8.0