Commit 8ad809583561da64a7e032b6f9817295f19ba193

Authored by 梁保满
1 parent 29319cfb

教师学生管理,设备状态

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