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);