Commit 4623f67f025ac70245b70fe0d842e9505ee00c1f
1 parent
8ad80958
隋唐问以及教师学生设置
Showing
3 changed files
with
42 additions
and
28 deletions
src/views/basic/ask/index.vue
@@ -94,10 +94,10 @@ export default { | @@ -94,10 +94,10 @@ export default { | ||
94 | this.query.endDay = new Date(); | 94 | this.query.endDay = new Date(); |
95 | } | 95 | } |
96 | }, | 96 | }, |
97 | - | 97 | + |
98 | methods: { | 98 | methods: { |
99 | handleCheckAllChange(val) { | 99 | handleCheckAllChange(val) { |
100 | - this.checkedCities = val ? this.subjectList : []; | 100 | + this.query.subjectNames = val ? this.subjectList : []; |
101 | this.allSubject = false; | 101 | this.allSubject = false; |
102 | }, | 102 | }, |
103 | handleChecked(value) { | 103 | handleChecked(value) { |
src/views/basic/setUp/student.vue
@@ -8,14 +8,14 @@ | @@ -8,14 +8,14 @@ | ||
8 | <el-tooltip effect="dark" content="设置答题器" placement="bottom"> | 8 | <el-tooltip effect="dark" content="设置答题器" placement="bottom"> |
9 | <el-button type="primary" icon="el-icon-upload2" size="mini" plain circle @click="diaUp = true"></el-button> | 9 | <el-button type="primary" icon="el-icon-upload2" size="mini" plain circle @click="diaUp = true"></el-button> |
10 | </el-tooltip> | 10 | </el-tooltip> |
11 | - <el-tooltip v-if="!code" effect="dark" content="添加学生" placement="bottom"> | 11 | + <el-tooltip v-if="!code && query.classType == 0" effect="dark" content="添加学生" placement="bottom"> |
12 | <el-button type="primary" icon="el-icon-plus" size="mini" plain circle @click="openAddDia"></el-button> | 12 | <el-button type="primary" icon="el-icon-plus" size="mini" plain circle @click="openAddDia"></el-button> |
13 | </el-tooltip> | 13 | </el-tooltip> |
14 | </template> | 14 | </template> |
15 | </back-box> | 15 | </back-box> |
16 | <div class="answer-header"> | 16 | <div class="answer-header"> |
17 | <div class="sel-box"> | 17 | <div class="sel-box"> |
18 | - <el-select class="sel" v-model="classType" @change="changeGrade(query.grade)" placeholder="选择类型"> | 18 | + <el-select class="sel" v-model="query.classType" @change="changeGrade(query.grade)" placeholder="选择类型"> |
19 | <el-option label="行政班" :value="0"></el-option> | 19 | <el-option label="行政班" :value="0"></el-option> |
20 | <el-option label="教学班" :value="1"></el-option> | 20 | <el-option label="教学班" :value="1"></el-option> |
21 | </el-select> | 21 | </el-select> |
@@ -188,7 +188,7 @@ | @@ -188,7 +188,7 @@ | ||
188 | </div> | 188 | </div> |
189 | </el-dialog> | 189 | </el-dialog> |
190 | <el-dialog :close-on-click-modal="false" title="学生答题器绑定" :visible.sync="diaUp" width="600"> | 190 | <el-dialog :close-on-click-modal="false" title="学生答题器绑定" :visible.sync="diaUp" width="600"> |
191 | - <upload id="downTeacher" :url="url" @upSuccess="upSuccess" fileName="学生答题器绑定模板"> | 191 | + <upload id="downTeacher" :url="url" :params="{ type: query.classType }" @upSuccess="upSuccess" fileName="学生答题器绑定模板"> |
192 | <p class="down-txt" slot="down"> | 192 | <p class="down-txt" slot="down"> |
193 | 通过Excel名单导入学生答题器绑定模板,点击 | 193 | 通过Excel名单导入学生答题器绑定模板,点击 |
194 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 | 194 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 |
@@ -224,6 +224,7 @@ export default { | @@ -224,6 +224,7 @@ export default { | ||
224 | }, | 224 | }, |
225 | clazzDetail: { stationSn: "", pairingCode: "", frequency: "" }, | 225 | clazzDetail: { stationSn: "", pairingCode: "", frequency: "" }, |
226 | query: { | 226 | query: { |
227 | + classType: 0, //0行政 1教学班 | ||
227 | grade: "", | 228 | grade: "", |
228 | classId: "", | 229 | classId: "", |
229 | status: 0, | 230 | status: 0, |
@@ -276,7 +277,6 @@ export default { | @@ -276,7 +277,6 @@ export default { | ||
276 | teacherCourseList: [], | 277 | teacherCourseList: [], |
277 | teacherGradeList: [], | 278 | teacherGradeList: [], |
278 | }, | 279 | }, |
279 | - classType: 0 //0行政 1教学班 | ||
280 | }; | 280 | }; |
281 | 281 | ||
282 | }, | 282 | }, |
@@ -444,6 +444,7 @@ export default { | @@ -444,6 +444,7 @@ export default { | ||
444 | }, | 444 | }, |
445 | async removeStu(obj, index, $event) { | 445 | async removeStu(obj, index, $event) { |
446 | const { data, status, info } = await this.$request.delStudent({ | 446 | const { data, status, info } = await this.$request.delStudent({ |
447 | + type: this.query.classType, | ||
447 | studentId: obj.id, | 448 | studentId: obj.id, |
448 | }); | 449 | }); |
449 | if (status === 0) { | 450 | if (status === 0) { |
@@ -459,6 +460,11 @@ export default { | @@ -459,6 +460,11 @@ export default { | ||
459 | this.query.classId = ""; | 460 | this.query.classId = ""; |
460 | this.query.studentName = ""; | 461 | this.query.studentName = ""; |
461 | this.query.studentCode = ""; | 462 | this.query.studentCode = ""; |
463 | + | ||
464 | + this.formStu.className = ""; | ||
465 | + this.clazzDetail.stationSn = ""; | ||
466 | + this.clazzDetail.pairingCode = ""; | ||
467 | + this.clazzDetail.frequency = ""; | ||
462 | if (val != 80 && val != 81) { | 468 | if (val != 80 && val != 81) { |
463 | await this._QueryClass(val); | 469 | await this._QueryClass(val); |
464 | } | 470 | } |
@@ -512,6 +518,7 @@ export default { | @@ -512,6 +518,7 @@ export default { | ||
512 | this.loading = true; | 518 | this.loading = true; |
513 | this.studentList = []; | 519 | this.studentList = []; |
514 | const { data, status, info } = await this.$request.studentList({ | 520 | const { data, status, info } = await this.$request.studentList({ |
521 | + type: this.query.classType, | ||
515 | ...query, | 522 | ...query, |
516 | }); | 523 | }); |
517 | this.loading = false; | 524 | this.loading = false; |
@@ -542,7 +549,7 @@ export default { | @@ -542,7 +549,7 @@ export default { | ||
542 | this.classList = []; | 549 | this.classList = []; |
543 | const { data, status, info } = await this.$request.schoolClassList({ | 550 | const { data, status, info } = await this.$request.schoolClassList({ |
544 | grade: value || this.query.grade, | 551 | grade: value || this.query.grade, |
545 | - type: this.classType | 552 | + type: this.query.classType |
546 | }); | 553 | }); |
547 | if (status === 0) { | 554 | if (status === 0) { |
548 | this.classList = (data.list && [...data?.list]) || []; | 555 | this.classList = (data.list && [...data?.list]) || []; |
@@ -559,6 +566,7 @@ export default { | @@ -559,6 +566,7 @@ export default { | ||
559 | this.classList = []; | 566 | this.classList = []; |
560 | const { data, status, info } = await this.$request.schoolClassList({ | 567 | const { data, status, info } = await this.$request.schoolClassList({ |
561 | grade: value, | 568 | grade: value, |
569 | + type: this.query.classType | ||
562 | }); | 570 | }); |
563 | if (status === 0) { | 571 | if (status === 0) { |
564 | this.classList = (data.list && [...data?.list]) || []; | 572 | this.classList = (data.list && [...data?.list]) || []; |
src/views/basic/setUp/teacher.vue
@@ -316,7 +316,7 @@ export default { | @@ -316,7 +316,7 @@ export default { | ||
316 | this.code = localStorage.getItem("csCode") || ""; | 316 | this.code = localStorage.getItem("csCode") || ""; |
317 | this._QueryData(4); | 317 | this._QueryData(4); |
318 | await this._QueryDataGrade(); | 318 | await this._QueryDataGrade(); |
319 | - this._RoleList(); | 319 | + // this._RoleList(); |
320 | }, | 320 | }, |
321 | methods: { | 321 | methods: { |
322 | async changeType() { | 322 | async changeType() { |
@@ -342,6 +342,7 @@ export default { | @@ -342,6 +342,7 @@ export default { | ||
342 | this.indeterminate = | 342 | this.indeterminate = |
343 | checkedCount > 0 && checkedCount < this.teacherList.length; | 343 | checkedCount > 0 && checkedCount < this.teacherList.length; |
344 | }, | 344 | }, |
345 | + //清除教师绑定班级信息 | ||
345 | async remove() { | 346 | async remove() { |
346 | if (!this.clearTeacher.length) { | 347 | if (!this.clearTeacher.length) { |
347 | this.$message.warning("请选择要格式化的老师") | 348 | this.$message.warning("请选择要格式化的老师") |
@@ -374,8 +375,8 @@ export default { | @@ -374,8 +375,8 @@ export default { | ||
374 | gradeName(type) { | 375 | gradeName(type) { |
375 | return setGradeName(type); | 376 | return setGradeName(type); |
376 | }, | 377 | }, |
378 | + //导入成功 | ||
377 | upSuccess(res) { | 379 | upSuccess(res) { |
378 | - //导入成功 | ||
379 | this.$message.closeAll(); | 380 | this.$message.closeAll(); |
380 | this.$message({ | 381 | this.$message({ |
381 | showClose: true, | 382 | showClose: true, |
@@ -386,20 +387,20 @@ export default { | @@ -386,20 +387,20 @@ export default { | ||
386 | this.diaUp = false; | 387 | this.diaUp = false; |
387 | this._QueryData(5); | 388 | this._QueryData(5); |
388 | }, | 389 | }, |
390 | + //添加教师角色 | ||
389 | addRoleList() { | 391 | addRoleList() { |
390 | - //添加教师角色 | ||
391 | this.formTeacher.roleList.push({ | 392 | this.formTeacher.roleList.push({ |
392 | id: randomWord(true, 16, 20), | 393 | id: randomWord(true, 16, 20), |
393 | roleId: "", | 394 | roleId: "", |
394 | classId: [], | 395 | classId: [], |
395 | }); | 396 | }); |
396 | }, | 397 | }, |
398 | + //删除教师角色 | ||
397 | removeRoleList(index) { | 399 | removeRoleList(index) { |
398 | - //删除教师角色 | ||
399 | this.formTeacher.roleList.splice(index, 1); | 400 | this.formTeacher.roleList.splice(index, 1); |
400 | }, | 401 | }, |
402 | + //添加教师弹窗 | ||
401 | addTeacherDia() { | 403 | addTeacherDia() { |
402 | - //添加教师弹窗 | ||
403 | this.isAdd = true; | 404 | this.isAdd = true; |
404 | this.formTeacher = { | 405 | this.formTeacher = { |
405 | teacherName: "", | 406 | teacherName: "", |
@@ -409,8 +410,8 @@ export default { | @@ -409,8 +410,8 @@ export default { | ||
409 | }; | 410 | }; |
410 | this.diaTeacher = true; | 411 | this.diaTeacher = true; |
411 | }, | 412 | }, |
413 | + //教师角色数量 | ||
412 | setClass(obj) { | 414 | setClass(obj) { |
413 | - //教师角色数量 | ||
414 | return ( | 415 | return ( |
415 | obj.managerList?.length + | 416 | obj.managerList?.length + |
416 | obj.teacherCourseList?.length + | 417 | obj.teacherCourseList?.length + |
@@ -426,8 +427,8 @@ export default { | @@ -426,8 +427,8 @@ export default { | ||
426 | }); | 427 | }); |
427 | return name; | 428 | return name; |
428 | }, | 429 | }, |
430 | + //教师详细数据 | ||
429 | showTeacher(obj) { | 431 | showTeacher(obj) { |
430 | - //教师详细数据 | ||
431 | this.showTId = obj.id; | 432 | this.showTId = obj.id; |
432 | this.teacherDetail = { ...obj }; | 433 | this.teacherDetail = { ...obj }; |
433 | }, | 434 | }, |
@@ -444,8 +445,8 @@ export default { | @@ -444,8 +445,8 @@ export default { | ||
444 | } | 445 | } |
445 | this.toTeacherForm(); | 446 | this.toTeacherForm(); |
446 | }, | 447 | }, |
448 | + //添加教师 | ||
447 | addTeacher() { | 449 | addTeacher() { |
448 | - //添加教师 | ||
449 | this.$refs.formTeacher.validate(async (valid) => { | 450 | this.$refs.formTeacher.validate(async (valid) => { |
450 | if (valid) { | 451 | if (valid) { |
451 | let obj = this.setTeacharForm(); | 452 | let obj = this.setTeacharForm(); |
@@ -485,8 +486,8 @@ export default { | @@ -485,8 +486,8 @@ export default { | ||
485 | } | 486 | } |
486 | }); | 487 | }); |
487 | }, | 488 | }, |
489 | + //转换保存教师数据格式 | ||
488 | setTeacharForm() { | 490 | setTeacharForm() { |
489 | - //转换保存教师数据格式 | ||
490 | let ERR_OK = true; | 491 | let ERR_OK = true; |
491 | this.formTeacher.roleList.map((item) => { | 492 | this.formTeacher.roleList.map((item) => { |
492 | if (item.classId.length == 0) { | 493 | if (item.classId.length == 0) { |
@@ -532,8 +533,8 @@ export default { | @@ -532,8 +533,8 @@ export default { | ||
532 | return false; | 533 | return false; |
533 | } | 534 | } |
534 | }, | 535 | }, |
536 | + //教师角色数据转换为form格式数据 | ||
535 | toTeacherForm() { | 537 | toTeacherForm() { |
536 | - //教师角色数据转换为form格式数据 | ||
537 | this.formTeacher.roleList = []; | 538 | this.formTeacher.roleList = []; |
538 | this.formTeacher.managerList?.map((item) => { | 539 | this.formTeacher.managerList?.map((item) => { |
539 | this.formTeacher.roleList.push({ | 540 | this.formTeacher.roleList.push({ |
@@ -579,6 +580,7 @@ export default { | @@ -579,6 +580,7 @@ export default { | ||
579 | }); | 580 | }); |
580 | }); | 581 | }); |
581 | }, | 582 | }, |
583 | + //删除教师角色 | ||
582 | async delTeacherManager(obj, type) { | 584 | async delTeacherManager(obj, type) { |
583 | let query; | 585 | let query; |
584 | switch (type) { | 586 | switch (type) { |
@@ -604,23 +606,24 @@ export default { | @@ -604,23 +606,24 @@ export default { | ||
604 | //角色 | 606 | //角色 |
605 | const { data, status, info } = await this.$request.delTeacherManager({ | 607 | const { data, status, info } = await this.$request.delTeacherManager({ |
606 | teacherId: obj.teacherId, | 608 | teacherId: obj.teacherId, |
609 | + type: this.query.classType, | ||
607 | ...query, | 610 | ...query, |
608 | }); | 611 | }); |
609 | if (status === 0) { | 612 | if (status === 0) { |
610 | - this._QueryD6; | ||
611 | - } else { | ||
612 | - this.$message.error(info); | ||
613 | - } | ||
614 | - }, | ||
615 | - async _RoleList() { | ||
616 | - //角色 | ||
617 | - const { data, status, info } = await this.$request.roleList(); | ||
618 | - if (status === 0) { | ||
619 | - this.roleList = data.list || []; | 613 | + this._QueryData(6); |
620 | } else { | 614 | } else { |
621 | this.$message.error(info); | 615 | this.$message.error(info); |
622 | } | 616 | } |
623 | }, | 617 | }, |
618 | + //角色列表 | ||
619 | + // async _RoleList() { | ||
620 | + // const { data, status, info } = await this.$request.roleList(); | ||
621 | + // if (status === 0) { | ||
622 | + // this.roleList = data.list || []; | ||
623 | + // } else { | ||
624 | + // this.$message.error(info); | ||
625 | + // } | ||
626 | + // }, | ||
624 | setQuery(type) { | 627 | setQuery(type) { |
625 | let query = {}; | 628 | let query = {}; |
626 | if (type == 1) { | 629 | if (type == 1) { |
@@ -701,7 +704,7 @@ export default { | @@ -701,7 +704,7 @@ export default { | ||
701 | query.teacherName.length ? "" : delete query.teacherName; | 704 | query.teacherName.length ? "" : delete query.teacherName; |
702 | query.phone.length ? "" : delete query.phone; | 705 | query.phone.length ? "" : delete query.phone; |
703 | } | 706 | } |
704 | - | 707 | + query.classType = this.query.classType |
705 | return query; | 708 | return query; |
706 | }, | 709 | }, |
707 | async _QueryData(type) { | 710 | async _QueryData(type) { |
@@ -749,6 +752,9 @@ export default { | @@ -749,6 +752,9 @@ export default { | ||
749 | }); | 752 | }); |
750 | if (status === 0) { | 753 | if (status === 0) { |
751 | this.classList = [] | 754 | this.classList = [] |
755 | + this.gradeClassList = [] | ||
756 | + this.gradeClassSubList = [] | ||
757 | + this.gradeSubListClass = [] | ||
752 | this.gradeList = | 758 | this.gradeList = |
753 | data.list?.map((item) => { | 759 | data.list?.map((item) => { |
754 | let subList = item.subjectNames?.map((items) => { | 760 | let subList = item.subjectNames?.map((items) => { |