From c3c2b1278c72b719a667e58680804afbfbb56754 Mon Sep 17 00:00:00 2001 From: 梁保满 Date: Sun, 4 Feb 2024 11:31:51 +0800 Subject: [PATCH] 即时测多班汇总 --- src/views/basic/test/components/multipleClass.vue | 0 src/views/basic/test/list.vue | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 src/views/basic/test/components/multipleClass.vue diff --git a/src/views/basic/test/components/multipleClass.vue b/src/views/basic/test/components/multipleClass.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/basic/test/components/multipleClass.vue diff --git a/src/views/basic/test/list.vue b/src/views/basic/test/list.vue index 7429071..d2df02b 100644 --- a/src/views/basic/test/list.vue +++ b/src/views/basic/test/list.vue @@ -36,11 +36,13 @@ style="width: 100%" @selection-change="handleSelectionChange" > - + @@ -249,6 +251,7 @@ export default { endDay: "", }, multipleSelection: [], + multipleSelectionClassId: [], tableData: [], page: 1, size: 20, @@ -333,31 +336,45 @@ export default { }); subjectArr = [...new Set(subjectArr)]; console.log(subjectArr); - if (ids.length == 1) { - this.$router.push({ - path: "/testAnalysis", - query: { - id: ids[0], - title: this.multipleSelection[0].title, - score: this.multipleSelection[0].examPaperScore || 0, - type: 1, - subjectName: subjectArr.join(), - classId: this.query.classId[0], - params: this.$route.query.params, - }, - }); - } else { + if (this.multipleSelectionClassId.length > 1) { //去详情 this.$router.push({ path: "/testAnalysis", query: { ids: ids.join(), - classId: this.query.classId[0], - type: subjectArr.length == 1 ? 2 : 3, + classId: this.multipleSelectionClassId.join(), + type: 5, subjectName: subjectArr.join(), params: this.$route.query.params, }, }); + } else { + if (ids.length == 1) { + this.$router.push({ + path: "/testAnalysis", + query: { + id: ids[0], + title: this.multipleSelection[0].title, + score: this.multipleSelection[0].examPaperScore || 0, + type: 1, + subjectName: subjectArr.join(), + classId: this.query.classId[0], + params: this.$route.query.params, + }, + }); + } else { + //去详情 + this.$router.push({ + path: "/testAnalysis", + query: { + ids: ids.join(), + classId: this.query.classId[0], + type: subjectArr.length == 1 ? 2 : 3, + subjectName: subjectArr.join(), + params: this.$route.query.params, + }, + }); + } } }, // 多班对比 @@ -376,6 +393,22 @@ export default { }, }); }, + // 班主任教学班不能与行政班汇总 + checkboxDisabled(obj) { + let id = this.multipleSelection[0] || ""; + if (id) { + let classId; + for (let i = 0; i < this.tableData.length; i++) { + if (this.tableData[i].id == id) { + classId = this.tableData[i].classId; + break; + } + } + return obj.classId == classId ? false : true; + } else { + return false; + } + }, handleSelectionChange(val) { this.multipleSelection = val; }, @@ -464,13 +497,14 @@ export default { this.total = data?.count || 0; } else { this.isMultipleClass = true; - let classArr = []; + this.multipleSelectionClassId = []; data?.list?.map((item) => { - if (!classArr.includes(item.classId)) { - classArr.push(item.classId); + if (!this.multipleSelectionClassId.includes(item.classId)) { + this.multipleSelectionClassId.push(item.classId); } }); - if (classArr.length > 1) { + + if (this.multipleSelectionClassId.length > 1) { //多班级 let tableObj = {}; data?.list?.map((item) => { -- libgit2 0.21.4