Commit 8ad809583561da64a7e032b6f9817295f19ba193
1 parent
29319cfb
教师学生管理,设备状态
Showing
9 changed files
with
950 additions
and
408 deletions
src/api/apis/apis.js
| ... | ... | @@ -274,10 +274,11 @@ export default { |
| 274 | 274 | }); |
| 275 | 275 | }, |
| 276 | 276 | //任课老师-数据导出 |
| 277 | - exportData() { | |
| 277 | + exportData(data) { | |
| 278 | 278 | return service({ |
| 279 | 279 | url: setUpUrls.exportData, |
| 280 | 280 | method: "POST", |
| 281 | + data, | |
| 281 | 282 | responseType: 'arraybuffer', |
| 282 | 283 | headers: { |
| 283 | 284 | 'Content-Type': 'application/octet-stream' |
| ... | ... | @@ -1632,11 +1633,6 @@ export default { |
| 1632 | 1633 | }, |
| 1633 | 1634 | //删除基站 |
| 1634 | 1635 | deleteStation(data) { |
| 1635 | - console.log(service({ | |
| 1636 | - url: setUpUrls.deleteStation, | |
| 1637 | - method: "POST", | |
| 1638 | - data | |
| 1639 | - })) | |
| 1640 | 1636 | return service({ |
| 1641 | 1637 | url: setUpUrls.deleteStation, |
| 1642 | 1638 | method: "POST", |
| ... | ... | @@ -1651,4 +1647,36 @@ export default { |
| 1651 | 1647 | data |
| 1652 | 1648 | }); |
| 1653 | 1649 | }, |
| 1650 | + //教学班班级名册模板下载 | |
| 1651 | + tClassAndStudentTemplate(data) { | |
| 1652 | + return service({ | |
| 1653 | + url: setUpUrls.tClassAndStudentTemplate, | |
| 1654 | + method: "POST", | |
| 1655 | + data | |
| 1656 | + }); | |
| 1657 | + }, | |
| 1658 | + //教学班班级名册导出 | |
| 1659 | + exportTClassAndStudent(data) { | |
| 1660 | + return service({ | |
| 1661 | + url: setUpUrls.exportTClassAndStudent, | |
| 1662 | + method: "POST", | |
| 1663 | + data | |
| 1664 | + }); | |
| 1665 | + }, | |
| 1666 | + // 删除班级信息(新) | |
| 1667 | + deleteClass(data) { | |
| 1668 | + return service({ | |
| 1669 | + url: setUpUrls.deleteClass, | |
| 1670 | + method: "POST", | |
| 1671 | + data | |
| 1672 | + }); | |
| 1673 | + }, | |
| 1674 | + // 清除老师下所有关联班级 | |
| 1675 | + clearTeacherClasses(data) { | |
| 1676 | + return service({ | |
| 1677 | + url: setUpUrls.clearTeacherClasses, | |
| 1678 | + method: "POST", | |
| 1679 | + data | |
| 1680 | + }); | |
| 1681 | + }, | |
| 1654 | 1682 | }; | ... | ... |
src/api/urls/apis.js
| ... | ... | @@ -406,28 +406,36 @@ export default { |
| 406 | 406 | // 删除班级信息 |
| 407 | 407 | removeClass: "/api_html/school/manager/delClass", |
| 408 | 408 | |
| 409 | - //删除即时测考试 | |
| 410 | - deleteReport: "/api_html/teaching/deleteReport", | |
| 411 | - //设置单班科目分析低分区间 | |
| 412 | - setLowRange: "/api_html/teaching/setLowRange", | |
| 413 | - //查询即时测多班对比情况详情 | |
| 414 | - examMultiClassReport: "/api_html/teaching/examMultiClassReport", | |
| 415 | - //导出即时测多班报表 | |
| 416 | - exportExamMultiReport: "/api_html/teaching/exportExamMultiReport", | |
| 417 | - //查询即时测多班默认等级列表 | |
| 418 | - defaultLevels: "/api_html/teaching/defaultLevels", | |
| 409 | + //删除即时测考试 | |
| 410 | + deleteReport: "/api_html/teaching/deleteReport", | |
| 411 | + //设置单班科目分析低分区间 | |
| 412 | + setLowRange: "/api_html/teaching/setLowRange", | |
| 413 | + //查询即时测多班对比情况详情 | |
| 414 | + examMultiClassReport: "/api_html/teaching/examMultiClassReport", | |
| 415 | + //导出即时测多班报表 | |
| 416 | + exportExamMultiReport: "/api_html/teaching/exportExamMultiReport", | |
| 417 | + //查询即时测多班默认等级列表 | |
| 418 | + defaultLevels: "/api_html/teaching/defaultLevels", | |
| 419 | 419 | |
| 420 | 420 | |
| 421 | 421 | |
| 422 | - /** v1.5 */ | |
| 423 | - //教师/个人版查询答题卡列表的分享数量 | |
| 424 | - paperShareCount: "/api_html/common/paper/paperShareCount", | |
| 425 | - //教师/个人版导入备题组卷Word文档 | |
| 426 | - paperWordUpload: "/api_html/common/paper/upload", | |
| 427 | - //删除随堂问报表 | |
| 428 | - deletePaperReport: "/api_html/teaching/deletePaperReport", | |
| 429 | - //删除基站 | |
| 430 | - deleteStation: "/api_html/school/manager/deleteStation", | |
| 431 | - //导出授课端日志 | |
| 432 | - downloadDeviceLog: "/api_html/school/manager/downloadDeviceLog", | |
| 422 | + /** v1.5 */ | |
| 423 | + //教师/个人版查询答题卡列表的分享数量 | |
| 424 | + paperShareCount: "/api_html/common/paper/paperShareCount", | |
| 425 | + //教师/个人版导入备题组卷Word文档 | |
| 426 | + paperWordUpload: "/api_html/common/paper/upload", | |
| 427 | + //删除随堂问报表 | |
| 428 | + deletePaperReport: "/api_html/teaching/deletePaperReport", | |
| 429 | + //删除基站 | |
| 430 | + deleteStation: "/api_html/school/manager/deleteStation", | |
| 431 | + //导出授课端日志 | |
| 432 | + downloadDeviceLog: "/api_html/school/manager/downloadDeviceLog", | |
| 433 | + // 教学班班级名册模板下载 | |
| 434 | + tClassAndStudentTemplate: "/api_html/school/manager/tClassAndStudentTemplate", | |
| 435 | + // 教学班班级名册导出 | |
| 436 | + exportTClassAndStudent: "/api_html/school/manager/exportTClassAndStudent", | |
| 437 | + // 删除班级信息(新) | |
| 438 | + deleteClass: "/api_html/school/manager/deleteClass", | |
| 439 | + // 清除老师下所有关联班级 | |
| 440 | + clearTeacherClasses: "/api_html/school/manager/clearTeacherClasses", | |
| 433 | 441 | } | ... | ... |
src/router/index.js
| ... | ... | @@ -36,6 +36,7 @@ const SetUpConglomerate = () => import("@/views/basic/setUp/conglomerate") |
| 36 | 36 | const SetUpSchool = () => import("@/views/basic/setUp/school") |
| 37 | 37 | const SetUpTeacher = () => import("@/views/basic/setUp/teacher") |
| 38 | 38 | const SetUpStudent = () => import("@/views/basic/setUp/student") |
| 39 | +const SetUpPersonalSetUpStudent = () => import("@/views/basic/setUp/PersonalStudent") | |
| 39 | 40 | const ArchivedClazz = () => import("@/views/basic/setUp/archivedClazz") |
| 40 | 41 | const UserInfo = () => import("@/views/basic/userInfo/index") |
| 41 | 42 | |
| ... | ... | @@ -778,7 +779,7 @@ const addroutersPersonal = [ |
| 778 | 779 | path: "/setUpStudent", |
| 779 | 780 | iconCls: "a fa-mortar-board", |
| 780 | 781 | name: '', |
| 781 | - component: SetUpStudent, | |
| 782 | + component: SetUpPersonalSetUpStudent, | |
| 782 | 783 | children: [] |
| 783 | 784 | }, |
| 784 | 785 | ] | ... | ... |
src/views/basic/dataSync/index.vue
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <p class="p1"> |
| 28 | 28 | <el-checkbox-group v-model="type"> |
| 29 | 29 | <el-checkbox :label="0">班级信息</el-checkbox> |
| 30 | - <el-checkbox :label="2">备题组卷数据</el-checkbox> | |
| 30 | + <el-checkbox :label="1">备题组卷数据</el-checkbox> | |
| 31 | 31 | <el-checkbox :label="2">报表数据</el-checkbox> |
| 32 | 32 | </el-checkbox-group> |
| 33 | 33 | </p> |
| ... | ... | @@ -98,10 +98,10 @@ export default { |
| 98 | 98 | query.exportData = formatDate(times, "yyyy-MM-dd"); |
| 99 | 99 | query.exportData = query.exportData.replaceAll("-", "") |
| 100 | 100 | } |
| 101 | + console.log({ ...query }) | |
| 101 | 102 | const exportData = this.role == "ROLE_PERSONAL" ? this.$request.pExportData : this.$request.exportData |
| 102 | - const data = await exportData(); | |
| 103 | + const data = await exportData({ ...query }); | |
| 103 | 104 | this.downLoading = false; |
| 104 | - console.log(data); | |
| 105 | 105 | if (data) { |
| 106 | 106 | let blob = new Blob([data], { type: "application/octet-stream" }); |
| 107 | 107 | const url = URL.createObjectURL(blob); | ... | ... |
src/views/basic/device/index.vue
| ... | ... | @@ -100,7 +100,7 @@ |
| 100 | 100 | <el-button type="warning" circle size="mini" icon="fa fa-eye" |
| 101 | 101 | @click="linkTo(scoped.row, 1)"></el-button> |
| 102 | 102 | </el-tooltip> |
| 103 | - <el-popconfirm title="确定删除吗?" @confirm="delStation(scoped.row)"> | |
| 103 | + <el-popconfirm title="确定删除吗?" @confirm="_delStation($event, scoped.row)"> | |
| 104 | 104 | <el-button class="del" slot="reference" type="danger" circle size="mini" |
| 105 | 105 | icon="fa fa-trash-o"></el-button> |
| 106 | 106 | </el-popconfirm> |
| ... | ... | @@ -224,7 +224,8 @@ |
| 224 | 224 | </template></el-table-column> |
| 225 | 225 | <el-table-column label="日志记录" align="center" width="80"> |
| 226 | 226 | <template slot-scope="scope"> |
| 227 | - <el-link type="primary" @click="downloadDeviceLog(scope.row.id)">下载</el-link> | |
| 227 | + <el-link v-if="scope.row.content" type="primary" :href="scope.row.content" download>下载</el-link> | |
| 228 | + <span v-else>暂无记录</span> | |
| 228 | 229 | </template> |
| 229 | 230 | </el-table-column> |
| 230 | 231 | <el-table-column label="自动更新" align="center" width="100"><template slot-scope="scoped"> |
| ... | ... | @@ -482,7 +483,7 @@ export default { |
| 482 | 483 | }, |
| 483 | 484 | }); |
| 484 | 485 | }, |
| 485 | - async delStation(obj) { | |
| 486 | + _delStation: _.debounce(async function (event, obj) { | |
| 486 | 487 | const { status, info } = await this.$request.deleteStation({ |
| 487 | 488 | id: obj.id |
| 488 | 489 | }); |
| ... | ... | @@ -492,7 +493,7 @@ export default { |
| 492 | 493 | } else { |
| 493 | 494 | this.$message.error(info); |
| 494 | 495 | } |
| 495 | - }, | |
| 496 | + }, 300), | |
| 496 | 497 | clickPieChart(obj) { |
| 497 | 498 | this.query.onlineStatus = |
| 498 | 499 | obj.name == "在线" ? 1 : obj.name == "离线" ? 0 : 2; |
| ... | ... | @@ -624,20 +625,6 @@ export default { |
| 624 | 625 | this.$message.error(data.info); |
| 625 | 626 | } |
| 626 | 627 | }, |
| 627 | - // 导出授课端日志 | |
| 628 | - async downloadDeviceLog(id) { | |
| 629 | - let data = await this.$request.downloadDeviceLog({ | |
| 630 | - id: id, | |
| 631 | - }); | |
| 632 | - if (data) { | |
| 633 | - let blob = new Blob([data], { | |
| 634 | - type: "application/vnd.ms-excel;charset=utf-8", | |
| 635 | - }); | |
| 636 | - downloadFile(`基站模版.xlsx`, blob); | |
| 637 | - } else { | |
| 638 | - this.$message.error("下载失败"); | |
| 639 | - } | |
| 640 | - }, | |
| 641 | 628 | async downExcel() { |
| 642 | 629 | let data = await this.$request.stationTemplate({ |
| 643 | 630 | id: this.id, |
| ... | ... | @@ -995,7 +982,8 @@ export default { |
| 995 | 982 | .error-tips { |
| 996 | 983 | margin-bottom: 12px; |
| 997 | 984 | } |
| 998 | -.del{ | |
| 985 | + | |
| 986 | +.del { | |
| 999 | 987 | margin-left: 10px; |
| 1000 | 988 | } |
| 1001 | 989 | ... | ... |
src/views/basic/setUp/PersonalStudent.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div> | |
| 3 | + <back-box> | |
| 4 | + <template slot="title"> | |
| 5 | + <span>学生管理</span> | |
| 6 | + </template> | |
| 7 | + <template slot="btns"> | |
| 8 | + <el-tooltip effect="dark" content="学生导入" placement="bottom"> | |
| 9 | + <el-button | |
| 10 | + type="primary" | |
| 11 | + icon="el-icon-upload2" | |
| 12 | + size="mini" | |
| 13 | + plain | |
| 14 | + circle | |
| 15 | + @click="diaUp = true" | |
| 16 | + ></el-button> | |
| 17 | + </el-tooltip> | |
| 18 | + <el-tooltip effect="dark" content="学生导出" placement="bottom"> | |
| 19 | + <el-button | |
| 20 | + type="primary" | |
| 21 | + icon="el-icon-download" | |
| 22 | + size="mini" | |
| 23 | + plain | |
| 24 | + circle | |
| 25 | + @click="exportStudentExl" | |
| 26 | + ></el-button> | |
| 27 | + </el-tooltip> | |
| 28 | + <el-tooltip effect="dark" content="添加班级" placement="bottom"> | |
| 29 | + <el-button | |
| 30 | + type="primary" | |
| 31 | + icon="el-icon-plus" | |
| 32 | + size="mini" | |
| 33 | + plain | |
| 34 | + circle | |
| 35 | + @click="addClass" | |
| 36 | + ></el-button> | |
| 37 | + </el-tooltip> | |
| 38 | + </template> | |
| 39 | + </back-box> | |
| 40 | + | |
| 41 | + <div class="page-content"> | |
| 42 | + <div class="stu-box"> | |
| 43 | + <div class="stu-list"> | |
| 44 | + <p class="h-title">班级列表</p> | |
| 45 | + <ul class="stu-ul"> | |
| 46 | + <li | |
| 47 | + class="stu-item" | |
| 48 | + v-for="item in classList" | |
| 49 | + :key="item.id" | |
| 50 | + :class="query.classId == item.id ? 'active' : ''" | |
| 51 | + @click="classDetail(item)" | |
| 52 | + > | |
| 53 | + <i class="el-icon-edit-outline" @click.stop="setClass(item)"></i> | |
| 54 | + {{ item.className }}({{ item.studentCount }}) | |
| 55 | + </li> | |
| 56 | + </ul> | |
| 57 | + </div> | |
| 58 | + <div class="stu-detail"> | |
| 59 | + <p class="stu-head"> | |
| 60 | + {{ formStu.className }}所有学生({{ studentList.length }}) | |
| 61 | + <i | |
| 62 | + v-if="query.classId" | |
| 63 | + class="el-icon-circle-plus-outline" | |
| 64 | + @click="openAddDia" | |
| 65 | + ></i> | |
| 66 | + </p> | |
| 67 | + <ul class="s-ul" v-loading="loading"> | |
| 68 | + <li | |
| 69 | + class="s-li" | |
| 70 | + v-for="(item, index) in studentList" | |
| 71 | + :key="item.id" | |
| 72 | + > | |
| 73 | + <el-popconfirm | |
| 74 | + title="确定删除吗?" | |
| 75 | + @confirm="removeStu(item, index)" | |
| 76 | + > | |
| 77 | + <i class="el-icon-delete" slot="reference"></i> | |
| 78 | + </el-popconfirm> | |
| 79 | + <p class="name">{{ item.studentName }}</p> | |
| 80 | + <p class="p1">答题器:{{ item.clickerSn || "--" }}</p> | |
| 81 | + <p class="p1">长学号:{{ item.studentCode }}</p> | |
| 82 | + <p class="p1">短学号:{{ item.shortNumber || "--" }}</p> | |
| 83 | + </li> | |
| 84 | + </ul> | |
| 85 | + <el-empty | |
| 86 | + :image-size="100" | |
| 87 | + v-if="!studentList.length && loading == false" | |
| 88 | + description="没有更多数据" | |
| 89 | + ></el-empty> | |
| 90 | + </div> | |
| 91 | + </div> | |
| 92 | + </div> | |
| 93 | + <el-dialog :close-on-click-modal="false" title="添加学生" :visible.sync="diaStu" width="400"> | |
| 94 | + <el-form | |
| 95 | + ref="formBox" | |
| 96 | + :model="formStu" | |
| 97 | + :rules="rulesStu" | |
| 98 | + label-width="160px" | |
| 99 | + > | |
| 100 | + <el-form-item label="所在班级:"> | |
| 101 | + <span>{{ formStu.className }}</span> | |
| 102 | + </el-form-item> | |
| 103 | + <el-form-item label="学生姓名:" prop="studentName"> | |
| 104 | + <el-col :span="10"> | |
| 105 | + <el-input | |
| 106 | + maxlength="30" | |
| 107 | + placeholder="输入学生姓名" | |
| 108 | + v-model.trim="formStu.studentName" | |
| 109 | + /> | |
| 110 | + </el-col> | |
| 111 | + </el-form-item> | |
| 112 | + <el-form-item label="长学号:" prop="studentCode"> | |
| 113 | + <el-col :span="10"> | |
| 114 | + <el-input | |
| 115 | + maxlength="12" | |
| 116 | + placeholder="输入学生长学号" | |
| 117 | + v-model.trim="formStu.studentCode" | |
| 118 | + /> | |
| 119 | + </el-col> | |
| 120 | + </el-form-item> | |
| 121 | + <el-form-item label="短学号:"> | |
| 122 | + <el-col :span="10"> | |
| 123 | + <el-input maxlength="12" v-model.trim="formStu.shortNumber" /> | |
| 124 | + </el-col> | |
| 125 | + </el-form-item> | |
| 126 | + <el-form-item label="性别:"> | |
| 127 | + <el-radio-group v-model="formStu.sex"> | |
| 128 | + <el-radio :label="1">男</el-radio> | |
| 129 | + <el-radio :label="2">女</el-radio> | |
| 130 | + </el-radio-group> | |
| 131 | + </el-form-item> | |
| 132 | + <el-form-item label="答题器编码:"> | |
| 133 | + <el-col :span="10"> | |
| 134 | + <el-input v-model.trim="formStu.clickerSn" /> | |
| 135 | + </el-col> | |
| 136 | + </el-form-item> | |
| 137 | + </el-form> | |
| 138 | + <div class="dialog-footer" slot="footer"> | |
| 139 | + <el-button @click="addStu">确 定</el-button> | |
| 140 | + <el-button @click="diaStu = false">取 消</el-button> | |
| 141 | + </div> | |
| 142 | + </el-dialog> | |
| 143 | + <el-dialog :close-on-click-modal="false" | |
| 144 | + :title="formClass.classId ? '修改班级' : '添加班级'" | |
| 145 | + :visible.sync="diaClass" | |
| 146 | + width="400" | |
| 147 | + > | |
| 148 | + <el-form | |
| 149 | + class="form-box" | |
| 150 | + ref="formClass" | |
| 151 | + :model="formClass" | |
| 152 | + :rules="rulesClass" | |
| 153 | + label-width="160px" | |
| 154 | + > | |
| 155 | + <el-form-item label="班级名称:" prop="className"> | |
| 156 | + <el-col :span="10"> | |
| 157 | + <el-input maxlength="30" v-model.trim="formClass.className" /> | |
| 158 | + </el-col> | |
| 159 | + </el-form-item> | |
| 160 | + <el-form-item label="科目:" prop="subjectNames"> | |
| 161 | + <div class="subject-box" :class="showAll ? 'active' : ''"> | |
| 162 | + <span class="showAll" v-if="subjectList.length>6" @click="showAll = !showAll">{{ | |
| 163 | + showAll ? "收起" : "更多..." | |
| 164 | + }}</span> | |
| 165 | + <el-checkbox-group v-model="formClass.subjectNames"> | |
| 166 | + <el-checkbox | |
| 167 | + v-for="item in subjectList" | |
| 168 | + :label="item" | |
| 169 | + :key="item" | |
| 170 | + >{{ item }}</el-checkbox | |
| 171 | + > | |
| 172 | + </el-checkbox-group> | |
| 173 | + </div> | |
| 174 | + <el-col :span="8"> | |
| 175 | + <el-input | |
| 176 | + placeholder="添加科目" | |
| 177 | + v-model.trim="subjectName" | |
| 178 | + maxlength="30" | |
| 179 | + > | |
| 180 | + <i | |
| 181 | + slot="suffix" | |
| 182 | + class="el-input__icon el-icon-plus" | |
| 183 | + @click="addSubjectName" | |
| 184 | + ></i> | |
| 185 | + </el-input> | |
| 186 | + </el-col> | |
| 187 | + </el-form-item> | |
| 188 | + </el-form> | |
| 189 | + <div class="dialog-footer" slot="footer"> | |
| 190 | + <el-button @click="saveClass">确 定</el-button> | |
| 191 | + <el-button @click="diaClass = false">取 消</el-button> | |
| 192 | + <el-button v-if="formClass.classId" @click="removeClass" | |
| 193 | + >删 除</el-button | |
| 194 | + > | |
| 195 | + </div> | |
| 196 | + </el-dialog> | |
| 197 | + <el-dialog :close-on-click-modal="false" title="学生导入" :visible.sync="diaUp" width="600"> | |
| 198 | + <upload :url="url" @upSuccess="upSuccess" fileName="学生模板"> | |
| 199 | + <p class="down-txt" slot="down"> | |
| 200 | + 通过Excel名单导入学生模板,点击 | |
| 201 | + <el-link type="danger" @click="downExcel">模板下载</el-link> 。 | |
| 202 | + </p> | |
| 203 | + </upload> | |
| 204 | + <div class="dialog-footer" slot="footer"> | |
| 205 | + <el-button @click="diaUp = false">取 消</el-button> | |
| 206 | + </div> | |
| 207 | + </el-dialog> | |
| 208 | + </div> | |
| 209 | +</template> | |
| 210 | + | |
| 211 | +<script> | |
| 212 | +import { downloadFile, getBlob } from "@/utils"; | |
| 213 | +export default { | |
| 214 | + data() { | |
| 215 | + return { | |
| 216 | + loading: false, | |
| 217 | + diaUp: false, //导入弹窗 | |
| 218 | + url: "/api_html/personal/importStudent", | |
| 219 | + diaStu: false, //添加学生 | |
| 220 | + diaClass: false, //添加-修改班级 | |
| 221 | + showAll: false, //修改年级科目显示 | |
| 222 | + query: { | |
| 223 | + classId: "", | |
| 224 | + }, | |
| 225 | + formStu: { | |
| 226 | + //添加学生信息 | |
| 227 | + className: "", | |
| 228 | + studentName: "", | |
| 229 | + studentCode: "", | |
| 230 | + shortNumber: "", | |
| 231 | + sex: 1, | |
| 232 | + clickerSn: "", | |
| 233 | + }, | |
| 234 | + rulesStu: { | |
| 235 | + studentName: [ | |
| 236 | + { required: true, message: "请输入学生名称", trigger: "blur" }, | |
| 237 | + ], | |
| 238 | + studentCode: [ | |
| 239 | + { required: true, message: "请输入学生长学号", trigger: "blur" }, | |
| 240 | + ], | |
| 241 | + }, | |
| 242 | + formClass: { | |
| 243 | + //添加班级信息 | |
| 244 | + classId: "", | |
| 245 | + className: "", | |
| 246 | + subjectNames: [], | |
| 247 | + }, | |
| 248 | + rulesClass: { | |
| 249 | + className: [ | |
| 250 | + { required: true, message: "请输入班级名称", trigger: "blur" }, | |
| 251 | + ], | |
| 252 | + subjectNames: [ | |
| 253 | + { required: true, message: "请输入科目名称", trigger: "blur" }, | |
| 254 | + ], | |
| 255 | + }, | |
| 256 | + classList: [], //班级列表 | |
| 257 | + studentList: [], //学生列表 | |
| 258 | + subjectList: [], //科目列表 | |
| 259 | + subjectName: "", //添加科目名称 | |
| 260 | + }; | |
| 261 | + }, | |
| 262 | + async created() { | |
| 263 | + await this._QueryClass(); | |
| 264 | + this._QuerySubject(); | |
| 265 | + this._QueryData(); | |
| 266 | + }, | |
| 267 | + methods: { | |
| 268 | + addClass() { | |
| 269 | + this.formClass.classId = ""; | |
| 270 | + this.formClass.className = ""; | |
| 271 | + this.formClass.subjectNames = []; | |
| 272 | + this.diaClass = true; | |
| 273 | + }, | |
| 274 | + openAddDia() { | |
| 275 | + this.formStu.studentName = ""; | |
| 276 | + this.formStu.studentCode = ""; | |
| 277 | + this.formStu.shortNumber = ""; | |
| 278 | + this.formStu.sex = 1; | |
| 279 | + this.formStu.clickerSn = ""; | |
| 280 | + this.diaStu = true; | |
| 281 | + }, | |
| 282 | + classDetail(obj) { | |
| 283 | + this.query.classId = obj.id; | |
| 284 | + this.formStu.className = obj.className; | |
| 285 | + this._QueryData(); | |
| 286 | + }, | |
| 287 | + setClass(obj) { | |
| 288 | + this.formClass.classId = obj.id; | |
| 289 | + this.formClass.className = obj.className; | |
| 290 | + this.formClass.subjectNames = obj.subjectNames||[]; | |
| 291 | + this.diaClass = true; | |
| 292 | + }, | |
| 293 | + addSubjectName() { | |
| 294 | + if (!this.subjectName) { | |
| 295 | + this.$message.warning("请填写科目名称"); | |
| 296 | + return; | |
| 297 | + } else if (this.subjectList.includes(this.subjectName)) { | |
| 298 | + this.$message.warning("科目已存在,请重新填写~"); | |
| 299 | + return; | |
| 300 | + } | |
| 301 | + this.subjectList.push(this.subjectName); | |
| 302 | + this.formClass.subjectNames.push(this.subjectName); | |
| 303 | + this.subjectName = ""; | |
| 304 | + }, | |
| 305 | + saveClass() { | |
| 306 | + this.$refs.formClass.validate(async (valid) => { | |
| 307 | + if (valid) { | |
| 308 | + const { data, status, info } = await this.$request.pSaveClass({ | |
| 309 | + classId: this.formClass.classId, | |
| 310 | + className: this.formClass.className, | |
| 311 | + subjectNames: this.formClass.subjectNames, | |
| 312 | + }); | |
| 313 | + if (status === 0) { | |
| 314 | + this.$message.success("修改成功"); | |
| 315 | + this.diaClass = false; | |
| 316 | + this._QueryClass(); | |
| 317 | + } else { | |
| 318 | + this.$message.error(info); | |
| 319 | + } | |
| 320 | + } else { | |
| 321 | + this.$message.warning("输入有误请检查!"); | |
| 322 | + return false; | |
| 323 | + } | |
| 324 | + }); | |
| 325 | + }, | |
| 326 | + async removeClass() { | |
| 327 | + let stuNum = 0; | |
| 328 | + this.classList.map((item) => { | |
| 329 | + if (item.classId == this.formClass.classId) { | |
| 330 | + stuNum = item.studentCount; | |
| 331 | + } | |
| 332 | + }); | |
| 333 | + if (stuNum) { | |
| 334 | + this.$message.warning("有学生的班级不能删除!"); | |
| 335 | + return; | |
| 336 | + } | |
| 337 | + const { data, status, info } = await this.$request.pDelClass({ | |
| 338 | + classId: this.formClass.classId, | |
| 339 | + }); | |
| 340 | + if (status === 0) { | |
| 341 | + this.$message.success("删除成功"); | |
| 342 | + this.diaClass = false; | |
| 343 | + this._QueryClass(); | |
| 344 | + } else { | |
| 345 | + this.$message.error(info); | |
| 346 | + } | |
| 347 | + }, | |
| 348 | + upSuccess(res) { | |
| 349 | + this.$message.closeAll(); | |
| 350 | + this.$message({ | |
| 351 | + showClose: true, | |
| 352 | + message: `成功(${res.data.success})`, | |
| 353 | + type: "success", | |
| 354 | + duration: 5000, | |
| 355 | + }); | |
| 356 | + //导入成功 | |
| 357 | + this.diaUp = false; | |
| 358 | + this._QueryClass() | |
| 359 | + this._QueryData(); | |
| 360 | + }, | |
| 361 | + async _QuerySubject() { | |
| 362 | + const { data, status, info } = await this.$request.pSubjectList(); | |
| 363 | + if (status === 0) { | |
| 364 | + this.subjectList = | |
| 365 | + data?.subjectNames.map((item) => { | |
| 366 | + return item.subjectName; | |
| 367 | + }) || []; | |
| 368 | + } else { | |
| 369 | + this.$message.error(info); | |
| 370 | + } | |
| 371 | + }, | |
| 372 | + | |
| 373 | + async removeStu(obj, index) { | |
| 374 | + const { data, status, info } = await this.$request.pDelStudent({ | |
| 375 | + studentId: obj.id, | |
| 376 | + }); | |
| 377 | + if (status === 0) { | |
| 378 | + this.$message.success("删除成功"); | |
| 379 | + this.studentList.splice(index, 1); | |
| 380 | + this._QueryClass(); | |
| 381 | + } else { | |
| 382 | + this.$message.error(info); | |
| 383 | + } | |
| 384 | + }, | |
| 385 | + addStu() { | |
| 386 | + let query = {}; | |
| 387 | + for (let key in this.formStu) { | |
| 388 | + if (key != "className" && this.formStu[key]) { | |
| 389 | + query[key] = this.formStu[key]; | |
| 390 | + } | |
| 391 | + } | |
| 392 | + this.loading = true; | |
| 393 | + this.$refs.formBox.validate(async (valid) => { | |
| 394 | + if (valid) { | |
| 395 | + let hasName = this.studentList.find((item) => { | |
| 396 | + return item.studentName == this.formStu.studentName; | |
| 397 | + }); | |
| 398 | + console.log(hasName); | |
| 399 | + if (hasName) { | |
| 400 | + this.$message.warning("学生姓名已存在"); | |
| 401 | + return; | |
| 402 | + } | |
| 403 | + const { data, status, info } = await this.$request.pAddStudent({ | |
| 404 | + classId: this.query.classId, | |
| 405 | + ...query, | |
| 406 | + }); | |
| 407 | + this.loading = false; | |
| 408 | + console.log(status); | |
| 409 | + if (status === 0) { | |
| 410 | + this.$message.success(info); | |
| 411 | + this.diaStu = false; | |
| 412 | + this._QueryClass(); | |
| 413 | + this._QueryData(); | |
| 414 | + } else { | |
| 415 | + this.$message.error(info); | |
| 416 | + } | |
| 417 | + } else { | |
| 418 | + this.$message.error("数据有误,请检查!"); | |
| 419 | + } | |
| 420 | + }); | |
| 421 | + }, | |
| 422 | + async _QueryData() { | |
| 423 | + this.loading = true; | |
| 424 | + const { data, status, info } = await this.$request.pStudentList({ | |
| 425 | + ...this.query, | |
| 426 | + }); | |
| 427 | + this.loading = false; | |
| 428 | + console.log(status); | |
| 429 | + if (status === 0) { | |
| 430 | + this.studentList = data.list || []; | |
| 431 | + } else { | |
| 432 | + this.$message.error(info); | |
| 433 | + } | |
| 434 | + }, | |
| 435 | + | |
| 436 | + async _QueryClass() { | |
| 437 | + const { data, status, info } = await this.$request.pClassList({ | |
| 438 | + needStudentCount: 1, | |
| 439 | + }); | |
| 440 | + if (status === 0) { | |
| 441 | + this.classList = [...data.list] || []; | |
| 442 | + this.query.classId = this.classList[0]?.id; | |
| 443 | + this.formStu.className = this.classList[0]?.className; | |
| 444 | + } else { | |
| 445 | + this.$message.error(info); | |
| 446 | + } | |
| 447 | + }, | |
| 448 | + async downExcel() { | |
| 449 | + this.loadingDown = true; | |
| 450 | + let { data, info, status } = await this.$request.studentTemplateUrl(); | |
| 451 | + this.loadingDown = false; | |
| 452 | + if (status == 0) { | |
| 453 | + const a = document.createElement("a"); | |
| 454 | + a.href = data.downloadUrl; | |
| 455 | + document.body.appendChild(a); | |
| 456 | + a.click(); | |
| 457 | + a.remove(); | |
| 458 | + } else { | |
| 459 | + this.$message.error(info); | |
| 460 | + } | |
| 461 | + }, | |
| 462 | + async exportStudentExl() { | |
| 463 | + this.loadingDown = true; | |
| 464 | + let data = await this.$request.exportStudent(); | |
| 465 | + this.loadingDown = false; | |
| 466 | + if (data) { | |
| 467 | + let blob = new Blob([data], { | |
| 468 | + type: "application/vnd.ms-excel;charset=utf-8", | |
| 469 | + }); | |
| 470 | + downloadFile(`学生名单.xlsx`, blob); | |
| 471 | + } else { | |
| 472 | + this.$message.error("下载失败"); | |
| 473 | + } | |
| 474 | + }, | |
| 475 | + }, | |
| 476 | +}; | |
| 477 | +</script> | |
| 478 | + | |
| 479 | +<style lang="scss" scoped> | |
| 480 | +.page-content { | |
| 481 | + padding: 20px; | |
| 482 | +} | |
| 483 | +.stu-box { | |
| 484 | + display: flex; | |
| 485 | + background: #f8f8f8; | |
| 486 | + border-radius: 10px; | |
| 487 | + overflow: hidden; | |
| 488 | + .stu-list { | |
| 489 | + min-width: 200px; | |
| 490 | + max-height: 80vh; | |
| 491 | + .h-title { | |
| 492 | + height: 40px; | |
| 493 | + line-height: 40px; | |
| 494 | + background: #eee; | |
| 495 | + } | |
| 496 | + .stu-item { | |
| 497 | + font-size: 16px; | |
| 498 | + color: #7f7f7f; | |
| 499 | + line-height: 36px; | |
| 500 | + cursor: pointer; | |
| 501 | + padding-left: 12px; | |
| 502 | + position: relative; | |
| 503 | + .el-icon-edit-outline { | |
| 504 | + position: absolute; | |
| 505 | + top: 8px; | |
| 506 | + right: 12px; | |
| 507 | + font-size: 20px; | |
| 508 | + display: none; | |
| 509 | + &:hover { | |
| 510 | + color: #667ffd; | |
| 511 | + } | |
| 512 | + } | |
| 513 | + &:hover { | |
| 514 | + background: #eee; | |
| 515 | + .el-icon-edit-outline { | |
| 516 | + display: block; | |
| 517 | + } | |
| 518 | + } | |
| 519 | + &.active { | |
| 520 | + color: #667ffd; | |
| 521 | + background: #eee; | |
| 522 | + } | |
| 523 | + } | |
| 524 | + .sel { | |
| 525 | + width: 180px; | |
| 526 | + :deep(.el-input__inner) { | |
| 527 | + font-size: 16px; | |
| 528 | + padding-left: 0; | |
| 529 | + border: none; | |
| 530 | + background: transparent; | |
| 531 | + } | |
| 532 | + :deep(.el-icon-arrow-up:before) { | |
| 533 | + content: "\e78f"; | |
| 534 | + } | |
| 535 | + } | |
| 536 | + } | |
| 537 | + .stu-detail { | |
| 538 | + flex: 1; | |
| 539 | + border-left: 0.5px solid #eee; | |
| 540 | + .stu-head { | |
| 541 | + padding: 12px 20px; | |
| 542 | + color: #7f7f7f; | |
| 543 | + position: relative; | |
| 544 | + .el-icon-circle-plus-outline { | |
| 545 | + position: absolute; | |
| 546 | + top: 10px; | |
| 547 | + right: 20px; | |
| 548 | + font-size: 24px; | |
| 549 | + color: #7f7f7f; | |
| 550 | + cursor: pointer; | |
| 551 | + } | |
| 552 | + } | |
| 553 | + .s-ul { | |
| 554 | + display: flex; | |
| 555 | + flex-wrap: wrap; | |
| 556 | + padding-left: 20px; | |
| 557 | + .s-li { | |
| 558 | + width: 180px; | |
| 559 | + height: 120px; | |
| 560 | + box-shadow: 2px 2px 5px #7f7f7f; | |
| 561 | + border-radius: 10px; | |
| 562 | + margin: 0 20px 20px 0; | |
| 563 | + padding: 0 12px 5px; | |
| 564 | + position: relative; | |
| 565 | + .el-icon-delete { | |
| 566 | + position: absolute; | |
| 567 | + top: 8px; | |
| 568 | + right: 8px; | |
| 569 | + font-size: 18px; | |
| 570 | + padding: 2px; | |
| 571 | + display: none; | |
| 572 | + cursor: pointer; | |
| 573 | + &:hover { | |
| 574 | + color: #667ffd; | |
| 575 | + } | |
| 576 | + } | |
| 577 | + &:hover { | |
| 578 | + .el-icon-delete { | |
| 579 | + display: block; | |
| 580 | + } | |
| 581 | + } | |
| 582 | + .name { | |
| 583 | + text-align: center; | |
| 584 | + font-size: 16px; | |
| 585 | + line-height: 18px; | |
| 586 | + padding: 10px 0; | |
| 587 | + } | |
| 588 | + .p1 { | |
| 589 | + color: #7f7f7f; | |
| 590 | + line-height: 20px; | |
| 591 | + padding-bottom: 5px; | |
| 592 | + } | |
| 593 | + } | |
| 594 | + } | |
| 595 | + } | |
| 596 | +} | |
| 597 | +.form-box { | |
| 598 | + .subject-box { | |
| 599 | + padding-right: 50px; | |
| 600 | + max-height: 90px; | |
| 601 | + overflow: hidden; | |
| 602 | + position: relative; | |
| 603 | + &.active { | |
| 604 | + max-height: auto; | |
| 605 | + overflow: auto; | |
| 606 | + } | |
| 607 | + .showAll { | |
| 608 | + position: absolute; | |
| 609 | + bottom: 0; | |
| 610 | + right: 10px; | |
| 611 | + font-size: 12px; | |
| 612 | + color: #7f7f7f; | |
| 613 | + cursor: pointer; | |
| 614 | + padding: 2px; | |
| 615 | + &:hover { | |
| 616 | + color: #667ffd; | |
| 617 | + } | |
| 618 | + } | |
| 619 | + } | |
| 620 | + .el-icon-plus { | |
| 621 | + cursor: pointer; | |
| 622 | + &:hover { | |
| 623 | + color: #667ffd; | |
| 624 | + } | |
| 625 | + } | |
| 626 | +} | |
| 627 | +</style> | |
| 0 | 628 | \ No newline at end of file | ... | ... |
src/views/basic/setUp/clazz.vue
| ... | ... | @@ -6,70 +6,39 @@ |
| 6 | 6 | </template> |
| 7 | 7 | <template slot="btns" v-if="!code"> |
| 8 | 8 | <el-tooltip effect="dark" content="导入班级名单" placement="bottom"> |
| 9 | - <el-button | |
| 10 | - type="primary" | |
| 11 | - icon="el-icon-upload2" | |
| 12 | - size="mini" | |
| 13 | - plain | |
| 14 | - circle | |
| 15 | - @click="diaUp = true" | |
| 16 | - ></el-button> | |
| 9 | + <el-button type="primary" icon="el-icon-upload2" size="mini" plain circle @click="diaUp = true"></el-button> | |
| 17 | 10 | </el-tooltip> |
| 18 | 11 | <el-tooltip effect="dark" content="导出班级名单" placement="bottom"> |
| 19 | - <el-button | |
| 20 | - type="primary" | |
| 21 | - icon="el-icon-download" | |
| 22 | - size="mini" | |
| 23 | - plain | |
| 24 | - circle | |
| 25 | - @click="exportTeacherExl" | |
| 26 | - ></el-button> | |
| 12 | + <el-button type="primary" icon="el-icon-download" size="mini" plain circle | |
| 13 | + @click="exportTeacherExl"></el-button> | |
| 27 | 14 | </el-tooltip> |
| 28 | 15 | <el-tooltip effect="dark" content="分班" placement="bottom"> |
| 29 | - <img | |
| 30 | - @click="toArchived" | |
| 31 | - src="../../../assets/images/fenban.png" | |
| 32 | - class="fenban" | |
| 33 | - alt="" | |
| 34 | - /> | |
| 16 | + <img @click="toArchived" src="../../../assets/images/fenban.png" class="fenban" alt="" /> | |
| 35 | 17 | </el-tooltip> |
| 36 | 18 | </template> |
| 37 | 19 | </back-box> |
| 38 | 20 | <div class="page-content"> |
| 39 | - <div class="grade-box"> | |
| 21 | + <div class="grade-box" v-loading="loading"> | |
| 22 | + <p class="tab-box"> | |
| 23 | + <el-radio-group v-model="type" @change="_QueryData"> | |
| 24 | + <el-radio-button :label="0">行政班</el-radio-button> | |
| 25 | + <el-radio-button :label="1">教学班</el-radio-button> | |
| 26 | + </el-radio-group> | |
| 27 | + </p> | |
| 40 | 28 | <div class="grade-item" v-for="(item, index) in dataList"> |
| 41 | 29 | <p class="h-title"> |
| 42 | 30 | <span>{{ item.gradeName }}</span> |
| 43 | - <span class="s-num" v-if="item.classList" | |
| 44 | - >(共{{ item.classList.length }}个班)</span | |
| 45 | - > | |
| 46 | - <el-button | |
| 47 | - class="sub-btn" | |
| 48 | - type="info" | |
| 49 | - size="mini" | |
| 50 | - round | |
| 51 | - plain | |
| 52 | - @click="openSubject(item)" | |
| 53 | - >科目管理({{ item.subjectNames.length }})</el-button | |
| 54 | - > | |
| 31 | + <span class="s-num" v-if="item.classList">(共{{ item.classList.length }}个班)</span> | |
| 32 | + <el-button class="sub-btn" type="info" size="mini" round plain @click="openSubject(item)">科目管理({{ | |
| 33 | + item.subjectNames.length }})</el-button> | |
| 55 | 34 | <span class="txt" v-if="index == 0">拖动班级进行排序</span> |
| 56 | 35 | </p> |
| 57 | - <draggable | |
| 58 | - tag="ul" | |
| 59 | - class="grade-info" | |
| 60 | - v-model="item.classList" | |
| 61 | - @start="start" | |
| 62 | - @end="end(item)" | |
| 63 | - v-bind="{ | |
| 64 | - animation: 300, | |
| 65 | - }" | |
| 66 | - > | |
| 36 | + <draggable tag="ul" class="grade-info" v-model="item.classList" @start="start" @end="end(item)" v-bind="{ | |
| 37 | + animation: 300, | |
| 38 | + }"> | |
| 67 | 39 | <li class="clazz-li" v-for="clazz in item.classList" :key="item.id"> |
| 68 | 40 | <div class="clazz-item"> |
| 69 | - <i | |
| 70 | - class="el-icon-edit" | |
| 71 | - @click.stop="setClass(clazz, item.gradeName)" | |
| 72 | - ></i> | |
| 41 | + <i class="el-icon-edit" @click.stop="setClass(clazz, item.gradeName)"></i> | |
| 73 | 42 | <p class="clazz-name ellipsis"> |
| 74 | 43 | {{ clazz.className }} |
| 75 | 44 | </p> |
| ... | ... | @@ -83,12 +52,7 @@ |
| 83 | 52 | </div> |
| 84 | 53 | </div> |
| 85 | 54 | </div> |
| 86 | - <el-dialog | |
| 87 | - :close-on-click-modal="false" | |
| 88 | - title="导入班级名单" | |
| 89 | - :visible.sync="diaUp" | |
| 90 | - width="600" | |
| 91 | - > | |
| 55 | + <el-dialog :close-on-click-modal="false" title="导入班级名单" :visible.sync="diaUp" width="600"> | |
| 92 | 56 | <upload :url="url" @upSuccess="upSuccess" fileName="班级名单"> |
| 93 | 57 | <p class="down-txt" slot="down"> |
| 94 | 58 | 通过Excel名单导入班级名单,点击 |
| ... | ... | @@ -99,18 +63,8 @@ |
| 99 | 63 | <el-button @click="diaUp = false">取 消</el-button> |
| 100 | 64 | </div> |
| 101 | 65 | </el-dialog> |
| 102 | - <el-dialog | |
| 103 | - :close-on-click-modal="false" | |
| 104 | - title="修改班级" | |
| 105 | - :visible.sync="diaClass" | |
| 106 | - width="400" | |
| 107 | - > | |
| 108 | - <el-form | |
| 109 | - ref="formClass" | |
| 110 | - :model="formClass" | |
| 111 | - :rules="rulesClass" | |
| 112 | - label-width="160px" | |
| 113 | - > | |
| 66 | + <el-dialog :close-on-click-modal="false" title="修改班级" :visible.sync="diaClass" width="400"> | |
| 67 | + <el-form ref="formClass" :model="formClass" :rules="rulesClass" label-width="160px"> | |
| 114 | 68 | <el-form-item label="所在年级:"> |
| 115 | 69 | <span>{{ formClass.gradeName }}</span> |
| 116 | 70 | </el-form-item> |
| ... | ... | @@ -126,34 +80,25 @@ |
| 126 | 80 | </el-form-item> |
| 127 | 81 | <el-form-item label="入学年份:"> |
| 128 | 82 | <el-col :span="10"> |
| 129 | - <el-date-picker | |
| 130 | - v-model="formClass.intoSchoolYear" | |
| 131 | - type="year" | |
| 132 | - placeholder="选择年" | |
| 133 | - > | |
| 83 | + <el-date-picker v-model="formClass.intoSchoolYear" type="year" placeholder="选择年"> | |
| 134 | 84 | </el-date-picker> |
| 135 | 85 | </el-col> |
| 136 | 86 | </el-form-item> |
| 137 | 87 | </el-form> |
| 138 | 88 | <div class="dialog-footer" slot="footer"> |
| 89 | + <el-popconfirm title="确定删除该班级吗?" @confirm="_RemoveClass"> | |
| 90 | + <el-button class="el-button-del" slot="reference" type="danger">删 除</el-button> | |
| 91 | + </el-popconfirm> | |
| 139 | 92 | <el-button @click="_SaveClass" type="primary">确 定</el-button> |
| 140 | 93 | <el-button @click="diaClass = false">取 消</el-button> |
| 141 | - <el-popconfirm | |
| 142 | - v-if="!formClass.teacherCount && !formClass.studentCount" | |
| 143 | - title="确定删除该班级吗?" | |
| 144 | - @confirm="_RemoveClass" | |
| 145 | - > | |
| 146 | - <el-button class="el-button-del" slot="reference" type="danger" plain | |
| 147 | - >删 除</el-button | |
| 148 | - > | |
| 149 | - </el-popconfirm> | |
| 94 | + <!-- <el-popconfirm v-if="!formClass.teacherCount && !formClass.studentCount" title="确定删除该班级吗?" | |
| 95 | + @confirm="_RemoveClass"> | |
| 96 | + <el-button class="el-button-del" slot="reference" type="danger" plain>删 除</el-button> | |
| 97 | + </el-popconfirm> --> | |
| 98 | + | |
| 150 | 99 | </div> |
| 151 | 100 | </el-dialog> |
| 152 | - <el-dialog | |
| 153 | - :close-on-click-modal="false" | |
| 154 | - :visible.sync="diaSubject" | |
| 155 | - width="400" | |
| 156 | - > | |
| 101 | + <el-dialog :close-on-click-modal="false" :visible.sync="diaSubject" width="400"> | |
| 157 | 102 | <p slot="title" class="dia-tit"> |
| 158 | 103 | {{ formClass.gradeName }} |
| 159 | 104 | <span class="tips">(默认科目和已经有任课老师的科目不能删除)</span> |
| ... | ... | @@ -162,54 +107,25 @@ |
| 162 | 107 | <el-form-item label="科目:"> |
| 163 | 108 | <div class="subject-box"> |
| 164 | 109 | <el-checkbox-group v-model="subjectNames"> |
| 165 | - <p | |
| 166 | - class="p1" | |
| 167 | - v-for="(item, index) in subjectList" | |
| 168 | - :key="item.default" | |
| 169 | - > | |
| 110 | + <p class="p1" v-for="(item, index) in subjectList" :key="item.default"> | |
| 170 | 111 | <el-checkbox v-if="!item.checked" :label="item.value">{{ |
| 171 | 112 | item.value |
| 172 | 113 | }}</el-checkbox> |
| 173 | - <el-input | |
| 174 | - class="sub-ipt" | |
| 175 | - v-else | |
| 176 | - v-model="item.value" | |
| 177 | - @keyup.enter.native="_EditSub(item)" | |
| 178 | - ></el-input> | |
| 179 | - <i | |
| 180 | - class="el-icon el-icon-edit" | |
| 181 | - v-show="!item.checked" | |
| 182 | - @click="item.checked = true" | |
| 183 | - ></i> | |
| 184 | - <i | |
| 185 | - class="el-icon el-icon-check" | |
| 186 | - v-show="item.checked" | |
| 187 | - @click="_EditSub(item)" | |
| 188 | - ></i> | |
| 114 | + <el-input class="sub-ipt" v-else v-model="item.value" @keyup.enter.native="_EditSub(item)"></el-input> | |
| 115 | + <i class="el-icon el-icon-edit" v-show="!item.checked" @click="item.checked = true"></i> | |
| 116 | + <i class="el-icon el-icon-check" v-show="item.checked" @click="_EditSub(item)"></i> | |
| 189 | 117 | <!-- <i |
| 190 | 118 | class="el-icon el-icon-close" |
| 191 | 119 | v-show="item.checked" |
| 192 | 120 | @click="resetSub(item)" |
| 193 | 121 | ></i> --> |
| 194 | - <i | |
| 195 | - v-show="!item.checked" | |
| 196 | - class="el-icon el-icon-delete" | |
| 197 | - @click="_DelSubject(item, index)" | |
| 198 | - ></i> | |
| 122 | + <i v-show="!item.checked" class="el-icon el-icon-delete" @click="_DelSubject(item, index)"></i> | |
| 199 | 123 | </p> |
| 200 | 124 | </el-checkbox-group> |
| 201 | 125 | </div> |
| 202 | 126 | <el-col :span="8"> |
| 203 | - <el-input | |
| 204 | - placeholder="添加科目" | |
| 205 | - v-model.trim="subjectName" | |
| 206 | - maxlength="30" | |
| 207 | - > | |
| 208 | - <i | |
| 209 | - slot="suffix" | |
| 210 | - class="el-input__icon el-icon-plus" | |
| 211 | - @click="addSubjectName" | |
| 212 | - ></i> | |
| 127 | + <el-input placeholder="添加科目" v-model.trim="subjectName" maxlength="30"> | |
| 128 | + <i slot="suffix" class="el-input__icon el-icon-plus" @click="addSubjectName"></i> | |
| 213 | 129 | </el-input> |
| 214 | 130 | </el-col> |
| 215 | 131 | </el-form-item> |
| ... | ... | @@ -249,7 +165,6 @@ export default { |
| 249 | 165 | diaClass: false, |
| 250 | 166 | diaSubject: false, |
| 251 | 167 | subjectLoading: false, |
| 252 | - url: "/api_html/school/manager/importClassAndStudent", | |
| 253 | 168 | formClass: { |
| 254 | 169 | //修改班级信息 |
| 255 | 170 | gradeName: "", |
| ... | ... | @@ -269,8 +184,21 @@ export default { |
| 269 | 184 | subjectNames: [], //已有科目 |
| 270 | 185 | subjectName: "", //要添加的科目 |
| 271 | 186 | dataList: [], |
| 187 | + | |
| 188 | + type: 0, //0-行政班/1-教学班(走班) | |
| 272 | 189 | }; |
| 273 | 190 | }, |
| 191 | + computed: { | |
| 192 | + url: function () { | |
| 193 | + let href = "" | |
| 194 | + if (this.type == 0) { | |
| 195 | + href = "/api_html/school/manager/importClassAndStudent" | |
| 196 | + } else { | |
| 197 | + href = "/api_html/school/manager/importTClassAndStudent" | |
| 198 | + } | |
| 199 | + return href | |
| 200 | + } | |
| 201 | + }, | |
| 274 | 202 | async created() { |
| 275 | 203 | this.code = localStorage.getItem("csCode") || ""; |
| 276 | 204 | this._QueryData(); |
| ... | ... | @@ -330,8 +258,8 @@ export default { |
| 330 | 258 | this.diaClass = true; |
| 331 | 259 | }, |
| 332 | 260 | async _RemoveClass() { |
| 333 | - const { data, status, info } = await this.$request.removeClass({ | |
| 334 | - classId: this.formClass.classId, | |
| 261 | + const { data, status, info } = await this.$request.deleteClass({ | |
| 262 | + id: this.formClass.classId, | |
| 335 | 263 | }); |
| 336 | 264 | if (status === 0) { |
| 337 | 265 | this.$message.success("删除成功"); |
| ... | ... | @@ -341,6 +269,7 @@ export default { |
| 341 | 269 | this.$message.error(info); |
| 342 | 270 | } |
| 343 | 271 | }, |
| 272 | + //保存班级信息 | |
| 344 | 273 | _SaveClass() { |
| 345 | 274 | this.$refs.formClass.validate(async (valid) => { |
| 346 | 275 | if (valid) { |
| ... | ... | @@ -363,8 +292,8 @@ export default { |
| 363 | 292 | } |
| 364 | 293 | }); |
| 365 | 294 | }, |
| 295 | + //添加科目 | |
| 366 | 296 | addSubjectName() { |
| 367 | - //添加科目 | |
| 368 | 297 | if (!this.subjectName) { |
| 369 | 298 | this.$message.warning("请填写科目名称"); |
| 370 | 299 | return; |
| ... | ... | @@ -405,6 +334,7 @@ export default { |
| 405 | 334 | this.$message.error(info); |
| 406 | 335 | } |
| 407 | 336 | }, |
| 337 | + //删除科目 | |
| 408 | 338 | async _DelSubject(obj, index) { |
| 409 | 339 | if (this.subjectLoading) return; |
| 410 | 340 | this.subjectLoading = true; |
| ... | ... | @@ -422,8 +352,8 @@ export default { |
| 422 | 352 | this.$message.error(info); |
| 423 | 353 | } |
| 424 | 354 | }, |
| 355 | + //保存修改年级信息 | |
| 425 | 356 | async _SaveSubject() { |
| 426 | - //保存修改年级信息 | |
| 427 | 357 | if (!this.subjectNames.length) { |
| 428 | 358 | this.$message.error("请选择科目!"); |
| 429 | 359 | return; |
| ... | ... | @@ -443,6 +373,7 @@ export default { |
| 443 | 373 | this.$message.error(info); |
| 444 | 374 | } |
| 445 | 375 | }, |
| 376 | + //保存排序 | |
| 446 | 377 | async _SaveComponents(classListIds) { |
| 447 | 378 | this.loading = true; |
| 448 | 379 | let { status, info } = await this.$request.classSort({ |
| ... | ... | @@ -457,7 +388,10 @@ export default { |
| 457 | 388 | }, |
| 458 | 389 | async _QueryData() { |
| 459 | 390 | this.loading = true; |
| 460 | - let { data, status, info } = await this.$request.classManager(); | |
| 391 | + this.dataList = [] | |
| 392 | + let { data, status, info } = await this.$request.classManager({ | |
| 393 | + type: this.type | |
| 394 | + }); | |
| 461 | 395 | this.loading = false; |
| 462 | 396 | if (status === 0) { |
| 463 | 397 | this.dataList = [...data.list] || []; |
| ... | ... | @@ -481,8 +415,10 @@ export default { |
| 481 | 415 | this.$message.error(info); |
| 482 | 416 | } |
| 483 | 417 | }, |
| 418 | + //班级名单模版下载 | |
| 484 | 419 | async downExcel() { |
| 485 | - let data = await this.$request.classAndStudentTemplate(); | |
| 420 | + const classAndStudentTemplate = this.type == 0 ? this.$request.classAndStudentTemplate : this.$request.tClassAndStudentTemplate | |
| 421 | + let data = await classAndStudentTemplate(); | |
| 486 | 422 | if (data && !data.code) { |
| 487 | 423 | let blob = new Blob([data], { |
| 488 | 424 | type: "application/vnd.ms-excel;charset=utf-8", |
| ... | ... | @@ -492,9 +428,11 @@ export default { |
| 492 | 428 | this.$message.error(data.info); |
| 493 | 429 | } |
| 494 | 430 | }, |
| 431 | + //班级名单下载 | |
| 495 | 432 | async exportTeacherExl() { |
| 433 | + const exportClassAndStudent = this.type == 0 ? this.$request.exportClassAndStudent : this.$request.exportTClassAndStudent | |
| 496 | 434 | this.loadingDown = true; |
| 497 | - let data = await this.$request.exportClassAndStudent(); | |
| 435 | + let data = await exportClassAndStudent(); | |
| 498 | 436 | this.loadingDown = false; |
| 499 | 437 | if (data) { |
| 500 | 438 | let blob = new Blob([data], { |
| ... | ... | @@ -510,61 +448,80 @@ export default { |
| 510 | 448 | </script> |
| 511 | 449 | |
| 512 | 450 | <style lang="scss" scoped> |
| 451 | +.tab-box { | |
| 452 | + margin-bottom: 16px; | |
| 453 | +} | |
| 454 | + | |
| 513 | 455 | .fenban { |
| 514 | 456 | width: 28px; |
| 515 | 457 | margin-left: 10px; |
| 516 | 458 | cursor: pointer; |
| 517 | 459 | } |
| 460 | + | |
| 518 | 461 | .page-tit { |
| 519 | 462 | margin-bottom: 20px; |
| 520 | 463 | } |
| 464 | + | |
| 521 | 465 | .page-content { |
| 522 | 466 | padding: 20px; |
| 523 | 467 | } |
| 468 | + | |
| 524 | 469 | .grade-box { |
| 525 | 470 | background: #f8f8f8; |
| 526 | 471 | padding: 12px 0; |
| 527 | 472 | } |
| 473 | + | |
| 528 | 474 | .el-button-del { |
| 529 | - margin-left: 10px; | |
| 475 | + float: left; | |
| 476 | + margin-left:80px | |
| 530 | 477 | } |
| 478 | + | |
| 531 | 479 | .h-title { |
| 532 | 480 | display: flex; |
| 533 | 481 | align-items: center; |
| 482 | + | |
| 534 | 483 | .s-num { |
| 535 | 484 | font-size: 13px; |
| 536 | 485 | } |
| 486 | + | |
| 537 | 487 | .sub-btn { |
| 538 | 488 | margin-left: 30px; |
| 539 | 489 | } |
| 490 | + | |
| 540 | 491 | .txt { |
| 541 | 492 | margin-left: 30px; |
| 542 | 493 | font-size: 13px; |
| 543 | 494 | color: #666; |
| 544 | 495 | } |
| 545 | 496 | } |
| 497 | + | |
| 546 | 498 | .dia-tit { |
| 547 | 499 | .tips { |
| 548 | 500 | font-size: 12px; |
| 549 | 501 | } |
| 550 | 502 | } |
| 503 | + | |
| 551 | 504 | .grade-item { |
| 552 | 505 | .grade-info { |
| 553 | 506 | display: flex; |
| 554 | 507 | flex-wrap: wrap; |
| 555 | 508 | padding: 10px 20px 0; |
| 509 | + | |
| 556 | 510 | .clazz-li { |
| 557 | 511 | margin-right: 20px; |
| 558 | 512 | margin-bottom: 18px; |
| 559 | 513 | position: relative; |
| 560 | 514 | background: #fff; |
| 515 | + | |
| 561 | 516 | .el-icon-edit { |
| 562 | 517 | cursor: pointer; |
| 563 | 518 | display: none; |
| 519 | + | |
| 564 | 520 | &:hover { |
| 565 | 521 | color: #667ffd; |
| 566 | 522 | } |
| 567 | 523 | } |
| 524 | + | |
| 568 | 525 | &:hover { |
| 569 | 526 | .el-icon-edit { |
| 570 | 527 | display: inline; |
| ... | ... | @@ -580,11 +537,13 @@ export default { |
| 580 | 537 | box-sizing: content-box; |
| 581 | 538 | position: relative; |
| 582 | 539 | } |
| 540 | + | |
| 583 | 541 | .el-icon-edit { |
| 584 | 542 | position: absolute; |
| 585 | 543 | right: 5px; |
| 586 | 544 | top: 5px; |
| 587 | 545 | } |
| 546 | + | |
| 588 | 547 | .clazz-name { |
| 589 | 548 | font-size: 16px; |
| 590 | 549 | font-weight: 700; |
| ... | ... | @@ -592,6 +551,7 @@ export default { |
| 592 | 551 | padding-bottom: 6px; |
| 593 | 552 | position: relative; |
| 594 | 553 | } |
| 554 | + | |
| 595 | 555 | .clazz-class { |
| 596 | 556 | // display: flex; |
| 597 | 557 | // justify-content: space-between; |
| ... | ... | @@ -599,32 +559,40 @@ export default { |
| 599 | 559 | } |
| 600 | 560 | } |
| 601 | 561 | } |
| 562 | + | |
| 602 | 563 | .subject-box { |
| 603 | 564 | overflow: hidden; |
| 604 | 565 | position: relative; |
| 566 | + | |
| 605 | 567 | .p1 { |
| 606 | 568 | line-height: 20px; |
| 607 | 569 | margin-bottom: 10px; |
| 608 | 570 | } |
| 609 | 571 | } |
| 572 | + | |
| 610 | 573 | :deep(.el-checkbox-group) { |
| 611 | 574 | display: flex; |
| 612 | 575 | flex-wrap: wrap; |
| 576 | + | |
| 613 | 577 | .p1 { |
| 614 | 578 | padding-right: 50px; |
| 615 | 579 | position: relative; |
| 580 | + | |
| 616 | 581 | &:hover { |
| 617 | 582 | .el-icon { |
| 618 | 583 | display: block; |
| 584 | + | |
| 619 | 585 | &:hover { |
| 620 | 586 | color: #667ffd; |
| 621 | 587 | } |
| 622 | 588 | } |
| 623 | - .is-checked ~ .el-icon-delete { | |
| 589 | + | |
| 590 | + .is-checked~.el-icon-delete { | |
| 624 | 591 | display: none; |
| 625 | 592 | } |
| 626 | 593 | } |
| 627 | 594 | } |
| 595 | + | |
| 628 | 596 | .el-icon { |
| 629 | 597 | font-size: 14px; |
| 630 | 598 | color: #999; |
| ... | ... | @@ -634,27 +602,33 @@ export default { |
| 634 | 602 | cursor: pointer; |
| 635 | 603 | display: none; |
| 636 | 604 | } |
| 605 | + | |
| 637 | 606 | .el-icon-check, |
| 638 | 607 | .el-icon-close { |
| 639 | 608 | display: block; |
| 640 | 609 | } |
| 610 | + | |
| 641 | 611 | .el-icon-edit, |
| 642 | 612 | .el-icon-check { |
| 643 | 613 | right: 28px; |
| 644 | 614 | } |
| 645 | 615 | } |
| 616 | + | |
| 646 | 617 | .sub-ipt { |
| 647 | 618 | :deep(.el-input__inner) { |
| 648 | 619 | height: 24px; |
| 649 | 620 | line-height: 24px; |
| 650 | 621 | } |
| 651 | 622 | } |
| 623 | + | |
| 652 | 624 | .form-box { |
| 653 | 625 | :deep(.el-form-item__label) { |
| 654 | 626 | line-height: 28px; |
| 655 | 627 | } |
| 628 | + | |
| 656 | 629 | .el-icon-plus { |
| 657 | 630 | cursor: pointer; |
| 631 | + | |
| 658 | 632 | &:hover { |
| 659 | 633 | color: #667ffd; |
| 660 | 634 | } | ... | ... |
src/views/basic/setUp/student.vue
| ... | ... | @@ -6,145 +6,72 @@ |
| 6 | 6 | </template> |
| 7 | 7 | <template slot="btns" v-if="role == 'ROLE_XUEXIAO'"> |
| 8 | 8 | <el-tooltip effect="dark" content="设置答题器" placement="bottom"> |
| 9 | - <el-button | |
| 10 | - type="primary" | |
| 11 | - icon="el-icon-upload2" | |
| 12 | - size="mini" | |
| 13 | - plain | |
| 14 | - circle | |
| 15 | - @click="diaUp = true" | |
| 16 | - ></el-button> | |
| 9 | + <el-button type="primary" icon="el-icon-upload2" size="mini" plain circle @click="diaUp = true"></el-button> | |
| 17 | 10 | </el-tooltip> |
| 18 | - <el-tooltip | |
| 19 | - v-if="!code" | |
| 20 | - effect="dark" | |
| 21 | - content="添加学生" | |
| 22 | - placement="bottom" | |
| 23 | - > | |
| 24 | - <el-button | |
| 25 | - type="primary" | |
| 26 | - icon="el-icon-plus" | |
| 27 | - size="mini" | |
| 28 | - plain | |
| 29 | - circle | |
| 30 | - @click="openAddDia" | |
| 31 | - ></el-button> | |
| 11 | + <el-tooltip v-if="!code" effect="dark" content="添加学生" placement="bottom"> | |
| 12 | + <el-button type="primary" icon="el-icon-plus" size="mini" plain circle @click="openAddDia"></el-button> | |
| 32 | 13 | </el-tooltip> |
| 33 | 14 | </template> |
| 34 | 15 | </back-box> |
| 35 | 16 | <div class="answer-header"> |
| 36 | 17 | <div class="sel-box"> |
| 37 | - <el-select | |
| 38 | - class="sel" | |
| 39 | - v-model="query.grade" | |
| 40 | - placeholder="选择年级" | |
| 41 | - @change="changeGrade" | |
| 42 | - > | |
| 18 | + <el-select class="sel" v-model="classType" @change="changeGrade(query.grade)" placeholder="选择类型"> | |
| 19 | + <el-option label="行政班" :value="0"></el-option> | |
| 20 | + <el-option label="教学班" :value="1"></el-option> | |
| 21 | + </el-select> | |
| 22 | + <el-select class="sel" v-model="query.grade" placeholder="选择年级" @change="changeGrade"> | |
| 43 | 23 | <el-option disabled label="全部" value=""></el-option> |
| 44 | - <el-option | |
| 45 | - v-for="item in gradeList" | |
| 46 | - :key="item.value" | |
| 47 | - :label="item.label" | |
| 48 | - :value="item.value" | |
| 49 | - > | |
| 24 | + <el-option v-for="item in gradeList" :key="item.value" :label="item.label" :value="item.value"> | |
| 50 | 25 | </el-option> |
| 51 | 26 | <el-option label="未分配" :value="80"></el-option> |
| 52 | 27 | <el-option label="已毕业" :value="81"></el-option> |
| 53 | 28 | </el-select> |
| 54 | - <el-input | |
| 55 | - placeholder="请输入学生姓名" | |
| 56 | - v-model="query.studentName" | |
| 57 | - class="input-with-select" | |
| 58 | - @keyup.enter.native="_QueryData(1)" | |
| 59 | - > | |
| 60 | - <el-button | |
| 61 | - slot="append" | |
| 62 | - icon="el-icon-search" | |
| 63 | - @click="_QueryData(1)" | |
| 64 | - ></el-button> | |
| 29 | + <el-input placeholder="请输入学生姓名" v-model="query.studentName" class="input-with-select" | |
| 30 | + @keyup.enter.native="_QueryData(1)"> | |
| 31 | + <el-button slot="append" icon="el-icon-search" @click="_QueryData(1)"></el-button> | |
| 65 | 32 | </el-input> |
| 66 | - <el-input | |
| 67 | - placeholder="请输入学生学号" | |
| 68 | - v-model="query.studentCode" | |
| 69 | - class="input-with-select" | |
| 70 | - @keyup.enter.native="_QueryData(2)" | |
| 71 | - > | |
| 72 | - <el-button | |
| 73 | - slot="append" | |
| 74 | - icon="el-icon-search" | |
| 75 | - @click="_QueryData(2)" | |
| 76 | - ></el-button> | |
| 33 | + <el-input placeholder="请输入学生学号" v-model="query.studentCode" class="input-with-select" | |
| 34 | + @keyup.enter.native="_QueryData(2)"> | |
| 35 | + <el-button slot="append" icon="el-icon-search" @click="_QueryData(2)"></el-button> | |
| 77 | 36 | </el-input> |
| 78 | 37 | </div> |
| 79 | 38 | </div> |
| 80 | - <p | |
| 81 | - class="total" | |
| 82 | - v-if=" | |
| 83 | - studentList.length && | |
| 84 | - (query.grade == 80 || query.grade == 81 || !query.grade) | |
| 85 | - " | |
| 86 | - > | |
| 39 | + <p class="total" v-if="studentList.length && | |
| 40 | + (query.grade == 80 || query.grade == 81 || !query.grade) | |
| 41 | + "> | |
| 87 | 42 | 共筛选出{{ studentList.length }}名学生。 |
| 88 | 43 | </p> |
| 89 | - <p | |
| 90 | - class="total" | |
| 91 | - v-if=" | |
| 92 | - getStuTotal && query.grade && query.grade != 80 && query.grade != 81 | |
| 93 | - " | |
| 94 | - > | |
| 44 | + <p class="total" v-if="getStuTotal && query.grade && query.grade != 80 && query.grade != 81 | |
| 45 | + "> | |
| 95 | 46 | 共筛选出{{ getStuTotal }}名学生。 |
| 96 | 47 | </p> |
| 97 | 48 | <div class="page-content"> |
| 98 | 49 | <div class="stu-box"> |
| 99 | - <div | |
| 100 | - class="stu-list" | |
| 101 | - v-show="query.grade && query.grade != 80 && query.grade != 81" | |
| 102 | - > | |
| 50 | + <div class="stu-list" v-show="query.grade && query.grade != 80 && query.grade != 81"> | |
| 103 | 51 | <div class="h-title">班级列表</div> |
| 104 | 52 | <ul class="stu-ul"> |
| 105 | - <li | |
| 106 | - class="stu-item" | |
| 107 | - v-for="(item, index) in classList" | |
| 108 | - :key="item.id" | |
| 109 | - :class="query.classId == item.id ? 'active' : ''" | |
| 110 | - @click="classDetail(item)" | |
| 111 | - > | |
| 53 | + <li class="stu-item" v-for="(item, index) in classList" :key="item.id" | |
| 54 | + :class="query.classId == item.id ? 'active' : ''" @click="classDetail(item)"> | |
| 112 | 55 | {{ item.className }}({{ item.studentCount }}) |
| 113 | 56 | </li> |
| 114 | 57 | </ul> |
| 115 | 58 | </div> |
| 116 | 59 | <div class="stu-detail" v-loading="loading"> |
| 117 | - <div | |
| 118 | - class="clazz-detail" | |
| 119 | - v-if=" | |
| 120 | - clazzDetail.stationSn && | |
| 121 | - query.grade && | |
| 122 | - query.grade != 80 && | |
| 123 | - query.grade != 81 | |
| 124 | - " | |
| 125 | - > | |
| 60 | + <div class="clazz-detail" v-if="clazzDetail.stationSn && | |
| 61 | + query.grade && | |
| 62 | + query.grade != 80 && | |
| 63 | + query.grade != 81 | |
| 64 | + "> | |
| 126 | 65 | <p>基站SN:{{ clazzDetail.stationSn }}</p> |
| 127 | 66 | <p>配对码:{{ clazzDetail.pairingCode }}</p> |
| 128 | 67 | <p>频点:{{ clazzDetail.frequency }}</p> |
| 129 | 68 | </div> |
| 130 | 69 | <ul class="s-ul"> |
| 131 | - <li | |
| 132 | - class="s-li" | |
| 133 | - v-for="(item, index) in studentList" | |
| 134 | - :key="item.id" | |
| 135 | - > | |
| 136 | - <el-popconfirm | |
| 137 | - v-if="!code" | |
| 138 | - title="确定删除吗?" | |
| 139 | - @confirm="removeStu(item, index, $event)" | |
| 140 | - > | |
| 70 | + <li class="s-li" v-for="(item, index) in studentList" :key="item.id"> | |
| 71 | + <el-popconfirm v-if="!code" title="确定删除吗?" @confirm="removeStu(item, index, $event)"> | |
| 141 | 72 | <i class="el-icon-delete" slot="reference"></i> |
| 142 | 73 | </el-popconfirm> |
| 143 | - <i | |
| 144 | - class="el-icon-user-solid" | |
| 145 | - v-if="!code && query.grade != 81" | |
| 146 | - @click.stop="openChangeClazz(item)" | |
| 147 | - ></i> | |
| 74 | + <i class="el-icon-user-solid" v-if="!code && query.grade != 81" @click.stop="openChangeClazz(item)"></i> | |
| 148 | 75 | <div class="s-li-box" @click="sayChange(item)"> |
| 149 | 76 | <p class="name"> |
| 150 | 77 | {{ item.studentName }} |
| ... | ... | @@ -153,15 +80,13 @@ |
| 153 | 80 | <template v-if="item.classList && item.classList.length"> |
| 154 | 81 | <template v-for="(clazz, index) in item.classList"> |
| 155 | 82 | <span v-if="index == 0"> |
| 156 | - {{ clazz.gradeName }}﹒{{ clazz.className }}</span | |
| 157 | - > | |
| 158 | - </template></template | |
| 159 | - > | |
| 83 | + {{ clazz.gradeName }}﹒{{ clazz.className }}</span> | |
| 84 | + </template></template> | |
| 160 | 85 | <template v-else> |
| 161 | 86 | {{ |
| 162 | 87 | item.status == 0 |
| 163 | - ? "未分配" | |
| 164 | - : item.status == 2 | |
| 88 | + ? "未分配" | |
| 89 | + : item.status == 2 | |
| 165 | 90 | ? "已毕业" |
| 166 | 91 | : "" |
| 167 | 92 | }} |
| ... | ... | @@ -173,58 +98,32 @@ |
| 173 | 98 | </div> |
| 174 | 99 | </li> |
| 175 | 100 | </ul> |
| 176 | - <el-empty | |
| 177 | - :image-size="100" | |
| 178 | - v-if="!studentList.length && loading == false" | |
| 179 | - description="没有更多数据" | |
| 180 | - ></el-empty> | |
| 101 | + <el-empty :image-size="100" v-if="!studentList.length && loading == false" description="没有更多数据"></el-empty> | |
| 181 | 102 | </div> |
| 182 | 103 | </div> |
| 183 | 104 | </div> |
| 184 | - <el-dialog | |
| 185 | - :close-on-click-modal="false" | |
| 186 | - title="学生调班" | |
| 187 | - :visible.sync="diaChangeClass" | |
| 188 | - width="400" | |
| 189 | - > | |
| 190 | - <el-form | |
| 191 | - class="form-box" | |
| 192 | - ref="formStuCla" | |
| 193 | - :model="formStuCla" | |
| 194 | - :rules="rulesStuCla" | |
| 195 | - label-width="160px" | |
| 196 | - > | |
| 105 | + <el-dialog :close-on-click-modal="false" title="学生调班" :visible.sync="diaChangeClass" width="400"> | |
| 106 | + <el-form class="form-box" ref="formStuCla" :model="formStuCla" :rules="rulesStuCla" label-width="160px"> | |
| 197 | 107 | <el-form-item label="学生姓名:"> |
| 198 | - <span>{{ formStuCla.studentName }}</span> | |
| 108 | + <el-col :span="10"> | |
| 109 | + <el-input v-model="formStuCla.studentName" maxlength="20"></el-input> | |
| 110 | + </el-col> | |
| 199 | 111 | </el-form-item> |
| 200 | 112 | <el-form-item label="当前班级:"> |
| 201 | 113 | <span>{{ formStuCla.className }}</span> |
| 202 | 114 | </el-form-item> |
| 203 | 115 | <el-form-item label="调到班级:" prop="classId"> |
| 204 | 116 | <el-col :span="10"> |
| 205 | - <el-select | |
| 206 | - class="sel" | |
| 207 | - v-model="formStuCla.classId" | |
| 208 | - placeholder="选择年级" | |
| 209 | - > | |
| 117 | + <el-select class="sel" v-model="formStuCla.classId" placeholder="选择年级"> | |
| 210 | 118 | <el-option disabled label="请选择" value=""></el-option> |
| 211 | - <el-option | |
| 212 | - v-for="item in classList" | |
| 213 | - :key="item.id" | |
| 214 | - :label="item.className" | |
| 215 | - :value="item.id" | |
| 216 | - > | |
| 119 | + <el-option v-for="item in classList" :key="item.id" :label="item.className" :value="item.id"> | |
| 217 | 120 | </el-option> |
| 218 | 121 | </el-select> |
| 219 | 122 | </el-col> |
| 220 | 123 | </el-form-item> |
| 221 | 124 | <el-form-item label="长学号:" prop="studentCode"> |
| 222 | 125 | <el-col :span="10"> |
| 223 | - <el-input | |
| 224 | - maxlength="12" | |
| 225 | - placeholder="输入学生长学号" | |
| 226 | - v-model.trim="formStuCla.studentCode" | |
| 227 | - /> | |
| 126 | + <el-input maxlength="12" placeholder="输入学生长学号" v-model.trim="formStuCla.studentCode" /> | |
| 228 | 127 | </el-col> |
| 229 | 128 | </el-form-item> |
| 230 | 129 | </el-form> |
| ... | ... | @@ -233,17 +132,8 @@ |
| 233 | 132 | <el-button @click="diaChangeClass = false">取 消</el-button> |
| 234 | 133 | </div> |
| 235 | 134 | </el-dialog> |
| 236 | - <el-dialog | |
| 237 | - :close-on-click-modal="false" | |
| 238 | - title="调班轨迹" | |
| 239 | - :visible.sync="diaChangeClassTrack" | |
| 240 | - width="400" | |
| 241 | - > | |
| 242 | - <el-form | |
| 243 | - :model="formClassTrack" | |
| 244 | - label-width="160px" | |
| 245 | - v-loading="loadingClassLogs" | |
| 246 | - > | |
| 135 | + <el-dialog :close-on-click-modal="false" title="调班轨迹" :visible.sync="diaChangeClassTrack" width="400"> | |
| 136 | + <el-form :model="formClassTrack" label-width="160px" v-loading="loadingClassLogs"> | |
| 247 | 137 | <el-form-item label="学生姓名:"> |
| 248 | 138 | <span>{{ formClassTrack.studentName }}</span> |
| 249 | 139 | </el-form-item> |
| ... | ... | @@ -260,38 +150,19 @@ |
| 260 | 150 | <el-button @click="diaChangeClassTrack = false">关 闭</el-button> |
| 261 | 151 | </div> |
| 262 | 152 | </el-dialog> |
| 263 | - <el-dialog | |
| 264 | - :close-on-click-modal="false" | |
| 265 | - title="添加学生" | |
| 266 | - :visible.sync="diaStu" | |
| 267 | - width="400" | |
| 268 | - > | |
| 269 | - <el-form | |
| 270 | - ref="formBox" | |
| 271 | - class="form-box" | |
| 272 | - :model="formStu" | |
| 273 | - :rules="rulesStu" | |
| 274 | - label-width="160px" | |
| 275 | - > | |
| 153 | + <el-dialog :close-on-click-modal="false" title="添加学生" :visible.sync="diaStu" width="400"> | |
| 154 | + <el-form ref="formBox" class="form-box" :model="formStu" :rules="rulesStu" label-width="160px"> | |
| 276 | 155 | <el-form-item label="所在班级:"> |
| 277 | 156 | <span>{{ formStu.className }}</span> |
| 278 | 157 | </el-form-item> |
| 279 | 158 | <el-form-item label="学生姓名:" prop="studentName"> |
| 280 | 159 | <el-col :span="10"> |
| 281 | - <el-input | |
| 282 | - maxlength="30" | |
| 283 | - placeholder="输入学生姓名" | |
| 284 | - v-model.trim="formStu.studentName" | |
| 285 | - /> | |
| 160 | + <el-input maxlength="30" placeholder="输入学生姓名" v-model.trim="formStu.studentName" /> | |
| 286 | 161 | </el-col> |
| 287 | 162 | </el-form-item> |
| 288 | 163 | <el-form-item label="长学号:" prop="studentCode"> |
| 289 | 164 | <el-col :span="10"> |
| 290 | - <el-input | |
| 291 | - maxlength="12" | |
| 292 | - placeholder="输入学生长学号" | |
| 293 | - v-model.trim="formStu.studentCode" | |
| 294 | - /> | |
| 165 | + <el-input maxlength="12" placeholder="输入学生长学号" v-model.trim="formStu.studentCode" /> | |
| 295 | 166 | </el-col> |
| 296 | 167 | </el-form-item> |
| 297 | 168 | <el-form-item label="短学号:"> |
| ... | ... | @@ -316,18 +187,8 @@ |
| 316 | 187 | <el-button @click="diaStu = false">取 消</el-button> |
| 317 | 188 | </div> |
| 318 | 189 | </el-dialog> |
| 319 | - <el-dialog | |
| 320 | - :close-on-click-modal="false" | |
| 321 | - title="学生答题器绑定" | |
| 322 | - :visible.sync="diaUp" | |
| 323 | - width="600" | |
| 324 | - > | |
| 325 | - <upload | |
| 326 | - id="downTeacher" | |
| 327 | - :url="url" | |
| 328 | - @upSuccess="upSuccess" | |
| 329 | - fileName="学生答题器绑定模板" | |
| 330 | - > | |
| 190 | + <el-dialog :close-on-click-modal="false" title="学生答题器绑定" :visible.sync="diaUp" width="600"> | |
| 191 | + <upload id="downTeacher" :url="url" @upSuccess="upSuccess" fileName="学生答题器绑定模板"> | |
| 331 | 192 | <p class="down-txt" slot="down"> |
| 332 | 193 | 通过Excel名单导入学生答题器绑定模板,点击 |
| 333 | 194 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 |
| ... | ... | @@ -394,6 +255,9 @@ export default { |
| 394 | 255 | studentCode: "", |
| 395 | 256 | }, |
| 396 | 257 | rulesStuCla: { |
| 258 | + studentName: [ | |
| 259 | + { required: true, message: "请输入学生名称", trigger: "blur" }, | |
| 260 | + ], | |
| 397 | 261 | classId: [{ required: true, message: "请选择班级", trigger: "blur" }], |
| 398 | 262 | studentCode: [ |
| 399 | 263 | { required: true, message: "请输入学生号", trigger: "blur" }, |
| ... | ... | @@ -412,7 +276,9 @@ export default { |
| 412 | 276 | teacherCourseList: [], |
| 413 | 277 | teacherGradeList: [], |
| 414 | 278 | }, |
| 279 | + classType: 0 //0行政 1教学班 | |
| 415 | 280 | }; |
| 281 | + | |
| 416 | 282 | }, |
| 417 | 283 | computed: { |
| 418 | 284 | getStuTotal: function () { |
| ... | ... | @@ -537,6 +403,7 @@ export default { |
| 537 | 403 | // } |
| 538 | 404 | const { data, status, info } = |
| 539 | 405 | await this.$request.studentChangeClass({ |
| 406 | + name: this.formStuCla.studentName, | |
| 540 | 407 | studentId: this.formStuCla.studentId, |
| 541 | 408 | oldClassId: this.formStuCla.oldClassId, |
| 542 | 409 | classId: this.formStuCla.classId, |
| ... | ... | @@ -675,6 +542,7 @@ export default { |
| 675 | 542 | this.classList = []; |
| 676 | 543 | const { data, status, info } = await this.$request.schoolClassList({ |
| 677 | 544 | grade: value || this.query.grade, |
| 545 | + type: this.classType | |
| 678 | 546 | }); |
| 679 | 547 | if (status === 0) { |
| 680 | 548 | this.classList = (data.list && [...data?.list]) || []; |
| ... | ... | @@ -721,6 +589,7 @@ export default { |
| 721 | 589 | .page-content { |
| 722 | 590 | padding: 0 20px; |
| 723 | 591 | } |
| 592 | + | |
| 724 | 593 | .tips { |
| 725 | 594 | display: flex; |
| 726 | 595 | line-height: 16px; |
| ... | ... | @@ -728,27 +597,33 @@ export default { |
| 728 | 597 | color: #999; |
| 729 | 598 | margin-bottom: 10px; |
| 730 | 599 | } |
| 600 | + | |
| 731 | 601 | .total { |
| 732 | 602 | padding: 0 20px 10px; |
| 733 | 603 | font-size: 14px; |
| 734 | 604 | color: #666; |
| 735 | 605 | } |
| 606 | + | |
| 736 | 607 | .stu-box { |
| 737 | 608 | display: flex; |
| 738 | 609 | background: #f8f8f8; |
| 739 | 610 | border-radius: 10px; |
| 740 | 611 | overflow: hidden; |
| 612 | + | |
| 741 | 613 | .answer-header { |
| 742 | 614 | padding-top: 10px; |
| 743 | 615 | } |
| 616 | + | |
| 744 | 617 | .stu-list { |
| 745 | 618 | min-width: 200px; |
| 746 | 619 | max-height: 80vh; |
| 620 | + | |
| 747 | 621 | .h-title { |
| 748 | 622 | height: 40px; |
| 749 | 623 | line-height: 40px; |
| 750 | 624 | background: #eee; |
| 751 | 625 | } |
| 626 | + | |
| 752 | 627 | .stu-item { |
| 753 | 628 | font-size: 16px; |
| 754 | 629 | color: #7f7f7f; |
| ... | ... | @@ -756,16 +631,19 @@ export default { |
| 756 | 631 | cursor: pointer; |
| 757 | 632 | padding-left: 12px; |
| 758 | 633 | position: relative; |
| 634 | + | |
| 759 | 635 | .el-icon-edit-outline { |
| 760 | 636 | position: absolute; |
| 761 | 637 | top: 8px; |
| 762 | 638 | right: 4px; |
| 763 | 639 | font-size: 20px; |
| 764 | 640 | display: none; |
| 641 | + | |
| 765 | 642 | &:hover { |
| 766 | 643 | color: #667ffd; |
| 767 | 644 | } |
| 768 | 645 | } |
| 646 | + | |
| 769 | 647 | .popconfirm-box { |
| 770 | 648 | position: absolute; |
| 771 | 649 | top: 6px; |
| ... | ... | @@ -773,41 +651,51 @@ export default { |
| 773 | 651 | font-size: 17px; |
| 774 | 652 | line-height: 24px; |
| 775 | 653 | display: none; |
| 654 | + | |
| 776 | 655 | &:hover { |
| 777 | 656 | color: #667ffd; |
| 778 | 657 | } |
| 779 | 658 | } |
| 659 | + | |
| 780 | 660 | &:hover { |
| 781 | 661 | background: #eee; |
| 662 | + | |
| 782 | 663 | .el-icon-edit-outline { |
| 783 | 664 | display: block; |
| 784 | 665 | } |
| 666 | + | |
| 785 | 667 | .popconfirm-box { |
| 786 | 668 | display: block; |
| 787 | 669 | } |
| 788 | 670 | } |
| 671 | + | |
| 789 | 672 | &.active { |
| 790 | 673 | color: #667ffd; |
| 791 | 674 | background: #eee; |
| 792 | 675 | } |
| 793 | 676 | } |
| 677 | + | |
| 794 | 678 | .sel { |
| 795 | 679 | width: 180px; |
| 680 | + | |
| 796 | 681 | :deep(.el-input__inner) { |
| 797 | 682 | font-size: 16px; |
| 798 | 683 | padding-left: 0; |
| 799 | 684 | border: none; |
| 800 | 685 | background: transparent; |
| 801 | 686 | } |
| 687 | + | |
| 802 | 688 | :deep(.el-icon-arrow-up:before) { |
| 803 | 689 | content: "\e78f"; |
| 804 | 690 | } |
| 805 | 691 | } |
| 806 | 692 | } |
| 693 | + | |
| 807 | 694 | .stu-detail { |
| 808 | 695 | flex: 1; |
| 809 | 696 | border-left: 0.5px solid #eee; |
| 810 | 697 | min-height: 200px; |
| 698 | + | |
| 811 | 699 | &-tit { |
| 812 | 700 | display: flex; |
| 813 | 701 | justify-content: space-between; |
| ... | ... | @@ -817,10 +705,12 @@ export default { |
| 817 | 705 | display: flex; |
| 818 | 706 | flex-wrap: wrap; |
| 819 | 707 | padding: 12px 0 0 20px; |
| 708 | + | |
| 820 | 709 | .s-li { |
| 821 | 710 | position: relative; |
| 822 | 711 | box-shadow: 2px 2px 5px #7f7f7f; |
| 823 | 712 | margin: 0 20px 20px 0; |
| 713 | + | |
| 824 | 714 | .s-li-box { |
| 825 | 715 | width: 160px; |
| 826 | 716 | border-radius: 10px; |
| ... | ... | @@ -828,6 +718,7 @@ export default { |
| 828 | 718 | padding: 0 12px 5px; |
| 829 | 719 | cursor: pointer; |
| 830 | 720 | } |
| 721 | + | |
| 831 | 722 | .el-icon-user-solid { |
| 832 | 723 | position: absolute; |
| 833 | 724 | top: 8px; |
| ... | ... | @@ -837,10 +728,12 @@ export default { |
| 837 | 728 | padding: 2px; |
| 838 | 729 | display: none; |
| 839 | 730 | cursor: pointer; |
| 731 | + | |
| 840 | 732 | &:hover { |
| 841 | 733 | color: #667ffd; |
| 842 | 734 | } |
| 843 | 735 | } |
| 736 | + | |
| 844 | 737 | .el-icon-delete { |
| 845 | 738 | position: absolute; |
| 846 | 739 | top: 8px; |
| ... | ... | @@ -849,29 +742,35 @@ export default { |
| 849 | 742 | padding: 2px; |
| 850 | 743 | display: none; |
| 851 | 744 | cursor: pointer; |
| 745 | + | |
| 852 | 746 | &:hover { |
| 853 | 747 | color: #667ffd; |
| 854 | 748 | } |
| 855 | 749 | } |
| 750 | + | |
| 856 | 751 | &:hover { |
| 857 | 752 | .el-icon-user-solid { |
| 858 | 753 | display: block; |
| 859 | 754 | } |
| 755 | + | |
| 860 | 756 | .el-icon-delete { |
| 861 | 757 | display: block; |
| 862 | 758 | } |
| 863 | 759 | } |
| 760 | + | |
| 864 | 761 | .name { |
| 865 | 762 | text-align: center; |
| 866 | 763 | font-size: 16px; |
| 867 | 764 | line-height: 18px; |
| 868 | 765 | padding: 10px 0; |
| 869 | 766 | } |
| 767 | + | |
| 870 | 768 | .p1 { |
| 871 | 769 | color: #7f7f7f; |
| 872 | 770 | line-height: 20px; |
| 873 | 771 | padding-bottom: 5px; |
| 874 | 772 | } |
| 773 | + | |
| 875 | 774 | .p2 { |
| 876 | 775 | color: #333; |
| 877 | 776 | line-height: 20px; |
| ... | ... | @@ -880,9 +779,11 @@ export default { |
| 880 | 779 | } |
| 881 | 780 | } |
| 882 | 781 | } |
| 782 | + | |
| 883 | 783 | .clazz-detail { |
| 884 | 784 | display: flex; |
| 885 | 785 | padding: 12px 12px 0 20px; |
| 786 | + | |
| 886 | 787 | p { |
| 887 | 788 | margin-right: 16px; |
| 888 | 789 | color: #666; | ... | ... |
src/views/basic/setUp/teacher.vue
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | |
| 21 | 21 | <div class="answer-header"> |
| 22 | 22 | <div class="sel-box"> |
| 23 | - <el-select class="sel" v-model="query.classType" @change="_QueryData()" placeholder="选择类型"> | |
| 23 | + <el-select class="sel" v-model="query.classType" @change="changeType" placeholder="选择类型"> | |
| 24 | 24 | <el-option label="行政班" :value="0"></el-option> |
| 25 | 25 | <el-option label="教学班" :value="1"></el-option> |
| 26 | 26 | </el-select> |
| ... | ... | @@ -55,8 +55,9 @@ |
| 55 | 55 | <div class="teacher-box" v-loading="loading" v-else> |
| 56 | 56 | <div class="teacher-list"> |
| 57 | 57 | <p class="h-title" v-loading="removeLoading"> |
| 58 | - <el-checkbox v-model="AllTeacher" :indeterminate="indeterminate" @change="handleCheckAllChange">{{ "" | |
| 59 | - }}</el-checkbox> | |
| 58 | + <el-checkbox v-show="showDel" v-model="AllTeacher" :indeterminate="indeterminate" | |
| 59 | + @change="handleCheckAllChange">{{ "" | |
| 60 | + }}</el-checkbox> | |
| 60 | 61 | <span class="txt">教师列表</span> |
| 61 | 62 | <img v-show="showDel" class="clear" @click="remove" src="../../../assets/images/shuazi.svg" alt=""> |
| 62 | 63 | </p> |
| ... | ... | @@ -64,7 +65,7 @@ |
| 64 | 65 | <ul class="teacher-ul"> |
| 65 | 66 | <li class="teacher-item" v-for="item in teacherList" :key="item.id" |
| 66 | 67 | :class="showTId == item.id ? 'active' : ''"> |
| 67 | - <el-checkbox :label="item.id">{{ "" }}</el-checkbox> | |
| 68 | + <el-checkbox v-show="showDel" :label="item.id">{{ "" }}</el-checkbox> | |
| 68 | 69 | <p @click="showTeacher(item)"> {{ item.realName |
| 69 | 70 | }}<template v-if="setClass(item)">({{ setClass(item) }})</template></p> |
| 70 | 71 | </li> |
| ... | ... | @@ -172,7 +173,7 @@ |
| 172 | 173 | </el-dialog> |
| 173 | 174 | <el-dialog :close-on-click-modal="false" :title="isAdd ? '添加教师' : setTercherType == 1 ? '编辑教师信息' : '管理班级' |
| 174 | 175 | " :visible.sync="diaTeacher" width="400" append-to-body> |
| 175 | - <el-form class="form-box" ref="formTeacher" :model="formTeacher" :rules="rulesTeacher" label="" -width="160px"> | |
| 176 | + <el-form class="form-box" ref="formTeacher" :model="formTeacher" :rules="rulesTeacher" label="" width="160px"> | |
| 176 | 177 | <el-form-item v-show="!isAdd && setTercherType == 2" label="教师姓名:"> |
| 177 | 178 | <span>{{ formTeacher.teacherName }}</span> |
| 178 | 179 | </el-form-item> |
| ... | ... | @@ -248,6 +249,7 @@ export default { |
| 248 | 249 | gradeList: [], |
| 249 | 250 | classList: [], |
| 250 | 251 | gradeClassSubList: [], |
| 252 | + gradeClassList: [], | |
| 251 | 253 | gradeSubListClass: [], |
| 252 | 254 | teacherList: [], |
| 253 | 255 | teacherRoleList: [ |
| ... | ... | @@ -299,6 +301,8 @@ export default { |
| 299 | 301 | indeterminate: false, |
| 300 | 302 | clearTeacher: [], |
| 301 | 303 | removeLoading: false |
| 304 | + | |
| 305 | + | |
| 302 | 306 | }; |
| 303 | 307 | }, |
| 304 | 308 | computed: { |
| ... | ... | @@ -313,9 +317,16 @@ export default { |
| 313 | 317 | this._QueryData(4); |
| 314 | 318 | await this._QueryDataGrade(); |
| 315 | 319 | this._RoleList(); |
| 316 | - await this._QueryClass(); | |
| 317 | 320 | }, |
| 318 | 321 | methods: { |
| 322 | + async changeType() { | |
| 323 | + this.query.gradeClassSub = [] | |
| 324 | + this.query.type = 0 | |
| 325 | + this.query.teacherName = "" | |
| 326 | + this.query.phone = "" | |
| 327 | + this._QueryData(6); | |
| 328 | + await this._QueryDataGrade(); | |
| 329 | + }, | |
| 319 | 330 | //选择删除 |
| 320 | 331 | handleCheckAllChange(val) { |
| 321 | 332 | this.clearTeacher = val |
| ... | ... | @@ -332,7 +343,7 @@ export default { |
| 332 | 343 | checkedCount > 0 && checkedCount < this.teacherList.length; |
| 333 | 344 | }, |
| 334 | 345 | async remove() { |
| 335 | - if (this.clearTeacher.length) { | |
| 346 | + if (!this.clearTeacher.length) { | |
| 336 | 347 | this.$message.warning("请选择要格式化的老师") |
| 337 | 348 | return |
| 338 | 349 | } |
| ... | ... | @@ -345,7 +356,7 @@ export default { |
| 345 | 356 | } |
| 346 | 357 | } |
| 347 | 358 | }) |
| 348 | - const { data, status, info } = await this.$request.teacherTemplate({ | |
| 359 | + const { data, status, info } = await this.$request.clearTeacherClasses({ | |
| 349 | 360 | ids: this.clearTeacher, |
| 350 | 361 | type: this.query.classType, |
| 351 | 362 | grades: grades |
| ... | ... | @@ -448,6 +459,7 @@ export default { |
| 448 | 459 | teacherName: this.formTeacher.teacherName, |
| 449 | 460 | loginName: this.formTeacher.loginName, |
| 450 | 461 | sex: this.formTeacher.sex, |
| 462 | + type: this.query.classType, | |
| 451 | 463 | ...obj, |
| 452 | 464 | }); |
| 453 | 465 | } else { |
| ... | ... | @@ -456,13 +468,14 @@ export default { |
| 456 | 468 | teacherName: this.formTeacher.teacherName, |
| 457 | 469 | loginName: this.formTeacher.loginName, |
| 458 | 470 | sex: this.formTeacher.sex, |
| 471 | + type: this.query.classType, | |
| 459 | 472 | ...obj, |
| 460 | 473 | }); |
| 461 | 474 | } |
| 462 | 475 | if (res.status === 0) { |
| 463 | 476 | this.$message.success(res.info); |
| 464 | 477 | this.diaTeacher = false; |
| 465 | - this._QueryData(5); | |
| 478 | + this._QueryData(6); | |
| 466 | 479 | } else { |
| 467 | 480 | this.$message.error(res.info); |
| 468 | 481 | } |
| ... | ... | @@ -531,7 +544,7 @@ export default { |
| 531 | 544 | (items) => |
| 532 | 545 | items.value == item.classId || |
| 533 | 546 | items.label.includes(item.className) |
| 534 | - ).grade, | |
| 547 | + )?.grade, | |
| 535 | 548 | item.classId, |
| 536 | 549 | ], |
| 537 | 550 | }); |
| ... | ... | @@ -594,7 +607,7 @@ export default { |
| 594 | 607 | ...query, |
| 595 | 608 | }); |
| 596 | 609 | if (status === 0) { |
| 597 | - this._QueryData(5); | |
| 610 | + this._QueryD6; | |
| 598 | 611 | } else { |
| 599 | 612 | this.$message.error(info); |
| 600 | 613 | } |
| ... | ... | @@ -707,6 +720,7 @@ export default { |
| 707 | 720 | this.loading = true; |
| 708 | 721 | let query = this.setQuery(type); |
| 709 | 722 | this.teacherList = []; |
| 723 | + this.clearTeacher = [] | |
| 710 | 724 | const { data, status, info } = await this.$request.teacherList({ |
| 711 | 725 | ...query, |
| 712 | 726 | }); |
| ... | ... | @@ -730,8 +744,11 @@ export default { |
| 730 | 744 | }, |
| 731 | 745 | async _QueryDataGrade() { |
| 732 | 746 | //年级数据 |
| 733 | - const { data, status, info } = await this.$request.gradeList(); | |
| 747 | + const { data, status, info } = await this.$request.gradeList({ | |
| 748 | + type: this.query.classType, | |
| 749 | + }); | |
| 734 | 750 | if (status === 0) { |
| 751 | + this.classList = [] | |
| 735 | 752 | this.gradeList = |
| 736 | 753 | data.list?.map((item) => { |
| 737 | 754 | let subList = item.subjectNames?.map((items) => { |
| ... | ... | @@ -740,6 +757,18 @@ export default { |
| 740 | 757 | label: items, |
| 741 | 758 | }; |
| 742 | 759 | }); |
| 760 | + this.gradeClassList.push({ | |
| 761 | + value: item.grade, | |
| 762 | + label: item.gradeName, | |
| 763 | + id: item.grade, | |
| 764 | + children: item.classList.map((clazz) => { | |
| 765 | + return { | |
| 766 | + value: clazz.id, | |
| 767 | + label: clazz.className, | |
| 768 | + id: clazz.id, | |
| 769 | + }; | |
| 770 | + }), | |
| 771 | + }); | |
| 743 | 772 | this.gradeClassSubList.push({ |
| 744 | 773 | value: item.grade, |
| 745 | 774 | label: item.gradeName, |
| ... | ... | @@ -770,6 +799,15 @@ export default { |
| 770 | 799 | }; |
| 771 | 800 | }), |
| 772 | 801 | }); |
| 802 | + let classList = item.classList.map((clazz) => { | |
| 803 | + return { | |
| 804 | + value: clazz.id, | |
| 805 | + label: `${clazz.className}(${item.gradeName})`, | |
| 806 | + grade: item.grade, | |
| 807 | + gradeName: item.gradeName, | |
| 808 | + }; | |
| 809 | + }) | |
| 810 | + this.classList = this.classList.concat(classList) | |
| 773 | 811 | return { |
| 774 | 812 | value: item.grade, |
| 775 | 813 | label: item.gradeName, |
| ... | ... | @@ -781,29 +819,6 @@ export default { |
| 781 | 819 | this.$message.error(info); |
| 782 | 820 | } |
| 783 | 821 | }, |
| 784 | - async _QueryClass() { | |
| 785 | - //班级数据 | |
| 786 | - const { data, status, info } = await this.$request.schoolClassList(); | |
| 787 | - if (status === 0) { | |
| 788 | - let gradeSubList = {}; | |
| 789 | - this.gradeList.map((item) => { | |
| 790 | - gradeSubList[item.label] = [...item.children]; | |
| 791 | - }); | |
| 792 | - this.classList = | |
| 793 | - data.list.map((item) => { | |
| 794 | - return { | |
| 795 | - value: item.id, | |
| 796 | - label: `${item.className}(${item.gradeName})`, | |
| 797 | - grade: item.grade, | |
| 798 | - gradeName: item.gradeName, | |
| 799 | - children: gradeSubList[item.gradeName], | |
| 800 | - }; | |
| 801 | - }) || []; | |
| 802 | - this.gradeClassList = formatGradeClass([...data.list]); | |
| 803 | - } else { | |
| 804 | - this.$message.error(info); | |
| 805 | - } | |
| 806 | - }, | |
| 807 | 822 | async downExcel() { |
| 808 | 823 | let data = await this.$request.teacherTemplate(); |
| 809 | 824 | if (data && !data.code) { | ... | ... |