From 0a4de03499b57d999a0ee53a3aedbdeca18c5d25 Mon Sep 17 00:00:00 2001 From: 阿宝 Date: Tue, 20 Dec 2022 11:23:34 +0800 Subject: [PATCH] 教师管理,学生管理班级设置 --- src/views/down/client.vue | 10 +++++++--- src/views/setUp/student.vue | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- src/views/setUp/teacher.vue | 47 ++++++++++++++++++++++++++++++++--------------- 3 files changed, 123 insertions(+), 27 deletions(-) diff --git a/src/views/down/client.vue b/src/views/down/client.vue index 84d5a69..8e6bada 100644 --- a/src/views/down/client.vue +++ b/src/views/down/client.vue @@ -228,7 +228,7 @@ :step="1" :step-strictly="true" > - {{ examsDuration ? "秒" : "" }} + {{ examsDuration ? "分" : "" }} @@ -327,7 +327,7 @@ export default { multipleChoiceNum: 4, singleTypeNum: 20, askCountdown: 30, - examsDuration: 5400, + examsDuration: 90, displayModel: 0, languageSet: 0, otherSet: [], @@ -401,6 +401,9 @@ export default { for (let key in this.formData) { content[key] ? (this.formData[key] = content[key]) : ""; } + this.formData.examsDuration = (this.formData.examsDuration / 60).toFixed( + 0 + ); this.type = 2; (this.configId = obj.id), (this.dialogVis = true); }, @@ -418,7 +421,7 @@ export default { }, examsDurationChange(val) { if (val) { - this.formData.examsDuration = 5400; + this.formData.examsDuration = 90; } else { this.formData.examsDuration = 0; } @@ -430,6 +433,7 @@ export default { content[key] = this.formData[key]; } } + content.examsDuration = content.examsDuration * 60; if (this.type == 1) { this.addAppConfig({ diff --git a/src/views/setUp/student.vue b/src/views/setUp/student.vue index 44b5e51..747d1d3 100644 --- a/src/views/setUp/student.vue +++ b/src/views/setUp/student.vue @@ -44,7 +44,7 @@ :class="query.classId == item.id ? 'active' : ''" @click="classDetail(item)" > - + {{ item.className }}({{ item.studentCount }}) @@ -79,12 +79,16 @@
    -
  • +
  • - + title="确定删除吗?" + @confirm="removeStu(item, index)" + > +

    {{ item.studentName }}

    @@ -147,6 +151,38 @@ 取 消 + + + + {{ formClass.gradeName }} + + + + + + + + + + + + + +

    + @@ -157,6 +193,7 @@ export default { return { url: "", diaStu: false, + diaClass: false, query: { gradeName: "", classId: "", @@ -179,6 +216,16 @@ export default { { required: true, message: "请输入学生长学号", trigger: "blur" }, ], }, + formClass: { + gradeName: "", + className: "", + intoSchoolYear: "", + }, + rulesClass: { + className: [ + { required: true, message: "请输入班级名称", trigger: "blur" }, + ], + }, gradeName: "", gradeList: [], classList: [], @@ -213,13 +260,41 @@ export default { this.formStu.className = obj.className; this._QueryData(3); }, - async removeStu(obj,index) { - const { data, status, info } = await this.$request.delStudent({ + setClass(obj) { + this.formClass.gradeName = obj.gradeName; + this.formClass.classId = obj.id; + this.formClass.className = obj.className; + this.formClass.intoSchoolYear = obj.intoSchoolYear + ""; + this.diaClass = true; + }, + saveClass() { + this.$refs.formClass.validate(async (valid) => { + if (valid) { + const { data, status, info } = await this.$request.updateClass({ + classId: this.formClass.classId, + className: this.formClass.className, + intoSchoolYear: this.formClass.intoSchoolYear, + }); + if (status === 0) { + this.$message.success("修改成功"); + this.diaClass = false; + this._QueryClass(); + } else { + this.$message.error(info); + } + } else { + console.log("输入有误请检查!"); + return false; + } + }); + }, + async removeStu(obj, index) { + const { data, status, info } = await this.$request.delStudent({ studentId: obj.id, }); if (status === 0) { this.$message.success("删除成功"); - this.studentList.splice(index,1) + this.studentList.splice(index, 1); } else { this.$message.error(info); } diff --git a/src/views/setUp/teacher.vue b/src/views/setUp/teacher.vue index f5ef4dd..e26a7f0 100644 --- a/src/views/setUp/teacher.vue +++ b/src/views/setUp/teacher.vue @@ -94,8 +94,11 @@
    - - + +

    手机号码:{{ teacherDetail.loginName }}

    @@ -210,7 +213,11 @@ 取 消
    - + - + + {{formTeacher.teacherName}} + + - + - + - +
    @@ -309,6 +323,7 @@ export default { diaUp: false, diaTeacher: false, isAdd: false, + setTercherType: 1, query: { gradeName: "", teacherName: "", @@ -320,7 +335,8 @@ export default { gradeClassList: [], gradeSubList: [], teacherList: [], - teacherTypeList: [ + teacherRoleList: [ + //角色 { value: 6, label: "班主任", @@ -409,7 +425,8 @@ export default { this.showTId = obj.id; this.teacherDetail = { ...obj }; }, - editTeacher() { + editTeacher(type) { + this.setTercherType = type this.isAdd = false; for (let key in this.teacherDetail) { if (key == "realName") { @@ -476,14 +493,14 @@ export default { classId: item.classId[1], className: this.classList.find( (items) => items.value == item.classId[1] - ).label, + )?.label||"", }); } else if (item.roleId == 7) { teacherCourseList.push({ classId: item.classId[0], className: this.classList.find( (items) => items.value == item.classId[0] - ).label, + )?.label||"", subjectName: item.classId[1], }); } else { @@ -491,7 +508,7 @@ export default { grade: item.classId[0], gradeName: this.gradeList.find( (items) => items.id == item.classId[0] - ).label, + )?.label||"", subjectName: item.classId[1], }); } @@ -578,7 +595,7 @@ export default { query = { ...this.query }; } this.loading = true; - this.teacherList=[] + this.teacherList = []; const { data, status, info } = await this.$request.teacherList({ ...query, }); -- libgit2 0.21.4