Commit e93f86366d6cf681fdc245cfadab07ee94218b72
1 parent
e9713b69
即使测列表角色权限操作问题
Showing
4 changed files
with
39 additions
and
29 deletions
src/views/basic/test/components/test.vue
... | ... | @@ -430,17 +430,19 @@ |
430 | 430 | >打印</el-button |
431 | 431 | > |
432 | 432 | </div> |
433 | - <div v-if="!status"> | |
433 | + <div | |
434 | + v-if=" | |
435 | + (!status && | |
436 | + examReport.subjectiveScore != examReport.examPaperScore) || | |
437 | + examReport.examPaperId != 0 | |
438 | + " | |
439 | + > | |
434 | 440 | <el-button type="primary" round @click="openScoreSet" |
435 | 441 | >答卷录分</el-button |
436 | 442 | > |
437 | 443 | |
438 | 444 | <template v-if="role != 'ROLE_BANZHUREN'"> |
439 | - <el-button | |
440 | - @click="edit" | |
441 | - type="primary" | |
442 | - v-if="examReport.subjectiveScore != examReport.examPaperScore" | |
443 | - round | |
445 | + <el-button @click="edit" type="primary" round | |
444 | 446 | >查看题目</el-button |
445 | 447 | ></template |
446 | 448 | > | ... | ... |
src/views/basic/test/list.vue
... | ... | @@ -155,8 +155,9 @@ |
155 | 155 | </template> |
156 | 156 | <el-tooltip |
157 | 157 | v-if=" |
158 | - scoped.row.subjectiveScore == scoped.row.examPaperScore || | |
159 | - scoped.row.answerNum != 0 | |
158 | + role != 'ROLE_BANZHUREN' && | |
159 | + scoped.row.subjectiveScore != scoped.row.examPaperScore && | |
160 | + scoped.row.examPaperId != 0 | |
160 | 161 | " |
161 | 162 | effect="dark" |
162 | 163 | content="答卷录分" |
... | ... | @@ -392,26 +393,26 @@ export default { |
392 | 393 | }, |
393 | 394 | // 班主任教学班不能与行政班汇总 |
394 | 395 | checkboxDisabled(obj) { |
395 | - if (this.role == "ROLE_BANZHUREN") { | |
396 | - let id = this.multipleSelection[0] || ""; | |
397 | - if (id) { | |
398 | - let classId; | |
399 | - for (let i = 0; i < this.tableData.length; i++) { | |
400 | - if (this.tableData[i].id == id) { | |
401 | - classId = this.tableData[i].classId; | |
402 | - break; | |
396 | + if (obj.examStartTime) { | |
397 | + if (this.role == "ROLE_BANZHUREN") { | |
398 | + let id = this.multipleSelection[0] || ""; | |
399 | + if (id) { | |
400 | + let classId; | |
401 | + for (let i = 0; i < this.tableData.length; i++) { | |
402 | + if (this.tableData[i].id == id) { | |
403 | + classId = this.tableData[i].classId; | |
404 | + break; | |
405 | + } | |
403 | 406 | } |
407 | + return obj.classId == classId ? false : true; | |
408 | + } else { | |
409 | + return false; | |
404 | 410 | } |
405 | - return obj.classId == classId ? false : true; | |
406 | 411 | } else { |
407 | 412 | return false; |
408 | 413 | } |
409 | 414 | } else { |
410 | - if (obj.examStartTime) { | |
411 | - return false; | |
412 | - } else { | |
413 | - return true; | |
414 | - } | |
415 | + return true; | |
415 | 416 | } |
416 | 417 | }, |
417 | 418 | handleSelectionChange(val) { |
... | ... | @@ -512,7 +513,11 @@ export default { |
512 | 513 | this.isMultipleClass = true; |
513 | 514 | //多班级 |
514 | 515 | let tableObj = {}; |
515 | - data?.list?.map((item) => { | |
516 | + let dataList = | |
517 | + data?.list?.filter((item) => { | |
518 | + return item.examStatus == 2; | |
519 | + }) || []; | |
520 | + dataList?.map((item) => { | |
516 | 521 | if (tableObj[item.examPaperId] && item.examPaperId != 0) { |
517 | 522 | // 没有班级考试的添加 |
518 | 523 | if ( | ... | ... |
src/views/examinationPaper/addQs.vue
... | ... | @@ -945,7 +945,7 @@ export default { |
945 | 945 | //整理问题 |
946 | 946 | formateQuestion() { |
947 | 947 | this.formatQuestionList(); |
948 | - if (this.form.questionList[0]?.subQuestions) { | |
948 | + if (questionList[0]?.subQuestions) { | |
949 | 949 | this.form.questionList?.map((item) => { |
950 | 950 | let types = [{}]; |
951 | 951 | let addndex = 0; |
... | ... | @@ -1005,7 +1005,8 @@ export default { |
1005 | 1005 | } else { |
1006 | 1006 | let types = [{}]; |
1007 | 1007 | let addndex = 0; |
1008 | - this.form.questionList = this.form.questionList.map((sub, index) => { | |
1008 | + let questionList = [...this.form.questionList]; | |
1009 | + this.form.questionList = questionList.map((sub, index) => { | |
1009 | 1010 | if (!!sub.questionType) { |
1010 | 1011 | if ( |
1011 | 1012 | sub.questionType == types[addndex].qusType && |
... | ... | @@ -1023,7 +1024,7 @@ export default { |
1023 | 1024 | // sub.correctAnswer |
1024 | 1025 | // ); |
1025 | 1026 | types[addndex].answerList = ""; |
1026 | - if (index == this.form.questionList.length - 1) { | |
1027 | + if (index == questionList.length - 1) { | |
1027 | 1028 | //循环最后类型数量大于等于5,保存批量答案 |
1028 | 1029 | if (types[addndex].subNum && types[addndex].subNum >= 5) { |
1029 | 1030 | types[addndex].endIndex = sub.questionIndex; |
... | ... | @@ -1033,8 +1034,7 @@ export default { |
1033 | 1034 | } else { |
1034 | 1035 | if (types[addndex].subNum && types[addndex].subNum >= 5) { |
1035 | 1036 | //不同类型时如果原有类型数量大于等于5,保存批量答案 |
1036 | - types[addndex].endIndex = | |
1037 | - this.form.questionList[index - 1].questionIndex; | |
1037 | + types[addndex].endIndex = questionList[index - 1].questionIndex; | |
1038 | 1038 | types[addndex].index = index - 1; |
1039 | 1039 | addndex += 1; |
1040 | 1040 | types[addndex] = {}; | ... | ... |
src/views/examinationPaper/edit.vue
... | ... | @@ -1102,6 +1102,7 @@ export default { |
1102 | 1102 | ) { |
1103 | 1103 | //同类型批量答案+1 |
1104 | 1104 | types[addndex].subNum += 1; |
1105 | + //最大选项 | |
1105 | 1106 | if ( |
1106 | 1107 | types[addndex].answerOptions.length < sub.answerOptions.length |
1107 | 1108 | ) { |
... | ... | @@ -1111,7 +1112,8 @@ export default { |
1111 | 1112 | sub.questionType, |
1112 | 1113 | sub.correctAnswer |
1113 | 1114 | ); |
1114 | - if (index == this.questionList.length - 1) { | |
1115 | + | |
1116 | + if (index == arr.length - 1) { | |
1115 | 1117 | //循环最后类型数量大于等于5,保存批量答案 |
1116 | 1118 | if (types[addndex].subNum && types[addndex].subNum >= 5) { |
1117 | 1119 | types[addndex].endIndex = sub.questionIndex; |
... | ... | @@ -1139,6 +1141,7 @@ export default { |
1139 | 1141 | } |
1140 | 1142 | return sub; |
1141 | 1143 | }); |
1144 | + console.log(types); | |
1142 | 1145 | for (let i = 0; i < types.length; i++) { |
1143 | 1146 | if (types[i].qusType == 3) { |
1144 | 1147 | types[i].answerList = types[i].answerList.slice(0, -1); | ... | ... |