Commit a736cb8b1b0fcc3154847febf1dc28ec80a2133e

Authored by 梁保满
1 parent ddcd75d7

fix:教师管理班级权限问题,删除随堂问问题

src/views/basic/ask/list.vue
... ... @@ -261,7 +261,7 @@ export default {
261 261 }
262 262 let subjectArr = [];
263 263 this.tableData.map((item) => {
264   - if(this.multipleSelection.includes(item.id)){
  264 + if (this.multipleSelection.includes(item.id)) {
265 265 subjectArr.push(item.subjectName);
266 266 }
267 267 });
... ... @@ -283,8 +283,8 @@ export default {
283 283 });
284 284 },
285 285 //删除
286   - remove(obj) {
287   - const { data, status, info } = this.$request.deletePaperReport({
  286 + async remove(obj) {
  287 + const { data, status, info } = await this.$request.deletePaperReport({
288 288 id: obj.id,
289 289 });
290 290 if (status === 0) {
... ...
src/views/basic/setUp/teacher.vue
... ... @@ -548,11 +548,11 @@ export default {
548 548 // this.query.type = 0;
549 549 this.query.teacherName = "";
550 550 this.query.phone = "";
551   - if (this.query.classType === 0) {
552   - this.teacherRoleList = [...this.RoleList];
553   - } else {
554   - this.teacherRoleList = this.RoleList.slice(1, 3);
555   - }
  551 + // if (this.query.classType === 0) {
  552 + // this.teacherRoleList = [...this.RoleList];
  553 + // } else {
  554 + // this.teacherRoleList = this.RoleList.slice(1, 3);
  555 + // }
556 556  
557 557 this._QueryData(6);
558 558 await this._QueryDataGrade(1);
... ... @@ -752,15 +752,16 @@ export default {
752 752 subjectName: clazz[1],
753 753 });
754 754 });
755   - } else {
756   - gradeGroupList.push({
757   - grade: item.classId[0],
758   - gradeName:
759   - this.gradeList.find((items) => items.id == item.classId[0])
760   - ?.label || "",
761   - subjectName: item.classId[1],
762   - });
763 755 }
  756 + // else {
  757 + // gradeGroupList.push({
  758 + // grade: item.classId[0],
  759 + // gradeName:
  760 + // this.gradeList.find((items) => items.id == item.classId[0])
  761 + // ?.label || "",
  762 + // subjectName: item.classId[1],
  763 + // });
  764 + // }
764 765 });
765 766 return {
766 767 managerList,
... ... @@ -807,16 +808,16 @@ export default {
807 808 classId: [...teacherClassId],
808 809 });
809 810 }
810   - this.formTeacher.gradeGroupList?.map((item) => {
811   - this.formTeacher.roleList.push({
812   - id: randomWord(true, 16, 20),
813   - roleId: 8,
814   - classId: [
815   - this.gradeList.find((items) => items.id == item.classId[0]).id,
816   - item.subjectName,
817   - ],
818   - });
819   - });
  811 + // this.formTeacher.gradeGroupList?.map((item) => {
  812 + // this.formTeacher.roleList.push({
  813 + // id: randomWord(true, 16, 20),
  814 + // roleId: 8,
  815 + // classId: [
  816 + // this.gradeList.find((items) => items.id == item.classId[0]).id,
  817 + // item.subjectName,
  818 + // ],
  819 + // });
  820 + // });
820 821 },
821 822 //删除教师角色
822 823 async delTeacherManager(obj, type) {
... ... @@ -987,12 +988,20 @@ export default {
987 988 let query = {};
988 989 if (type == 1) {
989 990 query.type = this.query.classType;
  991 + } else if (type == 3) {
  992 + query.type = 0;
990 993 }
991 994 //年级数据
992 995 const { data, status, info } = await this.$request.gradeList({
993 996 ...query,
994 997 });
995 998 if (status === 0) {
  999 + if (type == 1) {
  1000 + this.gradeClassSubList = [];
  1001 + if (this.query.classType == 0) {
  1002 + this.gradeClassList = [];
  1003 + }
  1004 + }
996 1005 this.gradeList =
997 1006 data.list?.map((item) => {
998 1007 let subList = item.subjectNames?.map((items) => {
... ... @@ -1002,19 +1011,6 @@ export default {
1002 1011 };
1003 1012 });
1004 1013 if (type == 2) {
1005   - // 学校-年级
1006   - this.gradeClassList.push({
1007   - value: item.grade,
1008   - label: item.gradeName,
1009   - id: item.grade,
1010   - children: item.classList.map((clazz) => {
1011   - return {
1012   - value: clazz.id,
1013   - label: clazz.className,
1014   - id: clazz.id,
1015   - };
1016   - }),
1017   - });
1018 1014 //学校-科目-班级
1019 1015 this.gradeSubListClass.push({
1020 1016 value: item.grade,
... ... @@ -1044,9 +1040,21 @@ export default {
1044 1040 };
1045 1041 }),
1046 1042 });
1047   - } else {
1048   - this.gradeClassSubList = [];
  1043 + } else if (type == 1) {
1049 1044 if (this.query.classType == 0) {
  1045 + // 学校-年级
  1046 + this.gradeClassList.push({
  1047 + value: item.grade,
  1048 + label: item.gradeName,
  1049 + id: item.grade,
  1050 + children: item.classList.map((clazz) => {
  1051 + return {
  1052 + value: clazz.id,
  1053 + label: clazz.className,
  1054 + id: clazz.id,
  1055 + };
  1056 + }),
  1057 + });
1050 1058 //学校-年级-科目
1051 1059 this.gradeClassSubList.push({
1052 1060 value: item.grade,
... ...
src/views/basic/test/list.vue
... ... @@ -415,7 +415,7 @@ export default {
415 415 });
416 416 if (status === 0) {
417 417 this.$message.success("删除成功!");
418   - this.tableData.splice(index, 1);
  418 + this._QueryData();
419 419 } else {
420 420 this.$message.error(info);
421 421 }
... ...