From 4fab460c41892ccfc82685ca6dd4af58989ead6c Mon Sep 17 00:00:00 2001 From: 梁保满 Date: Tue, 18 Apr 2023 15:20:53 +0800 Subject: [PATCH] 班级归档操作交互 --- src/views/standard/setUp/student.vue | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/views/standard/setUp/student.vue b/src/views/standard/setUp/student.vue index 0a5154b..d6d7141 100644 --- a/src/views/standard/setUp/student.vue +++ b/src/views/standard/setUp/student.vue @@ -69,12 +69,11 @@ @@ -373,7 +381,10 @@ export default { teacherCourseList: [], teacherGradeList: [], }, + diaArchiving: false, archivedTotal: 0, //已归档班级 + archivingObj: {}, //即将归档班级信息 + archivingIndex: 0, //即将归档班级下标 }; }, async created() { @@ -519,17 +530,27 @@ export default { 2000, { leading: true, trailing: false } ), + + openArchivingDia(obj, index) { + this.archivingObj = { ...obj }; + this.archivingIndex = index; + this.diaArchiving = true; + }, //班级归档 - async archivingClass(obj, index) { + async archivingClass() { const { data, status, info } = await this.$request.classArchiving({ - classId: obj.id, + classId: this.archivingObj.id, }); + this.diaArchiving = false; if (status === 0) { this.$message.success("归档成功"); - this.classList.splice(index, 1); - this.classDetail(this.classList[index]); + this.classList.splice(this.archivingIndex, 1); + if (this.archivingIndex == this.classList.length) { + this.classDetail(this.classList[this.archivingIndex - 1]); + } else { + this.classDetail(this.classList[this.archivingIndex]); + } this._QueryArchivedNum(); - this._QueryData(3); } else { this.$message.error(info); -- libgit2 0.21.4