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,17 +430,19 @@ | ||
| 430 | >打印</el-button | 430 | >打印</el-button |
| 431 | > | 431 | > |
| 432 | </div> | 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 | <el-button type="primary" round @click="openScoreSet" | 440 | <el-button type="primary" round @click="openScoreSet" |
| 435 | >答卷录分</el-button | 441 | >答卷录分</el-button |
| 436 | > | 442 | > |
| 437 | 443 | ||
| 438 | <template v-if="role != 'ROLE_BANZHUREN'"> | 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 | >查看题目</el-button | 446 | >查看题目</el-button |
| 445 | ></template | 447 | ></template |
| 446 | > | 448 | > |
src/views/basic/test/list.vue
| @@ -155,8 +155,9 @@ | @@ -155,8 +155,9 @@ | ||
| 155 | </template> | 155 | </template> |
| 156 | <el-tooltip | 156 | <el-tooltip |
| 157 | v-if=" | 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 | effect="dark" | 162 | effect="dark" |
| 162 | content="答卷录分" | 163 | content="答卷录分" |
| @@ -392,26 +393,26 @@ export default { | @@ -392,26 +393,26 @@ export default { | ||
| 392 | }, | 393 | }, |
| 393 | // 班主任教学班不能与行政班汇总 | 394 | // 班主任教学班不能与行政班汇总 |
| 394 | checkboxDisabled(obj) { | 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 | } else { | 411 | } else { |
| 407 | return false; | 412 | return false; |
| 408 | } | 413 | } |
| 409 | } else { | 414 | } else { |
| 410 | - if (obj.examStartTime) { | ||
| 411 | - return false; | ||
| 412 | - } else { | ||
| 413 | - return true; | ||
| 414 | - } | 415 | + return true; |
| 415 | } | 416 | } |
| 416 | }, | 417 | }, |
| 417 | handleSelectionChange(val) { | 418 | handleSelectionChange(val) { |
| @@ -512,7 +513,11 @@ export default { | @@ -512,7 +513,11 @@ export default { | ||
| 512 | this.isMultipleClass = true; | 513 | this.isMultipleClass = true; |
| 513 | //多班级 | 514 | //多班级 |
| 514 | let tableObj = {}; | 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 | if (tableObj[item.examPaperId] && item.examPaperId != 0) { | 521 | if (tableObj[item.examPaperId] && item.examPaperId != 0) { |
| 517 | // 没有班级考试的添加 | 522 | // 没有班级考试的添加 |
| 518 | if ( | 523 | if ( |
src/views/examinationPaper/addQs.vue
| @@ -945,7 +945,7 @@ export default { | @@ -945,7 +945,7 @@ export default { | ||
| 945 | //整理问题 | 945 | //整理问题 |
| 946 | formateQuestion() { | 946 | formateQuestion() { |
| 947 | this.formatQuestionList(); | 947 | this.formatQuestionList(); |
| 948 | - if (this.form.questionList[0]?.subQuestions) { | 948 | + if (questionList[0]?.subQuestions) { |
| 949 | this.form.questionList?.map((item) => { | 949 | this.form.questionList?.map((item) => { |
| 950 | let types = [{}]; | 950 | let types = [{}]; |
| 951 | let addndex = 0; | 951 | let addndex = 0; |
| @@ -1005,7 +1005,8 @@ export default { | @@ -1005,7 +1005,8 @@ export default { | ||
| 1005 | } else { | 1005 | } else { |
| 1006 | let types = [{}]; | 1006 | let types = [{}]; |
| 1007 | let addndex = 0; | 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 | if (!!sub.questionType) { | 1010 | if (!!sub.questionType) { |
| 1010 | if ( | 1011 | if ( |
| 1011 | sub.questionType == types[addndex].qusType && | 1012 | sub.questionType == types[addndex].qusType && |
| @@ -1023,7 +1024,7 @@ export default { | @@ -1023,7 +1024,7 @@ export default { | ||
| 1023 | // sub.correctAnswer | 1024 | // sub.correctAnswer |
| 1024 | // ); | 1025 | // ); |
| 1025 | types[addndex].answerList = ""; | 1026 | types[addndex].answerList = ""; |
| 1026 | - if (index == this.form.questionList.length - 1) { | 1027 | + if (index == questionList.length - 1) { |
| 1027 | //循环最后类型数量大于等于5,保存批量答案 | 1028 | //循环最后类型数量大于等于5,保存批量答案 |
| 1028 | if (types[addndex].subNum && types[addndex].subNum >= 5) { | 1029 | if (types[addndex].subNum && types[addndex].subNum >= 5) { |
| 1029 | types[addndex].endIndex = sub.questionIndex; | 1030 | types[addndex].endIndex = sub.questionIndex; |
| @@ -1033,8 +1034,7 @@ export default { | @@ -1033,8 +1034,7 @@ export default { | ||
| 1033 | } else { | 1034 | } else { |
| 1034 | if (types[addndex].subNum && types[addndex].subNum >= 5) { | 1035 | if (types[addndex].subNum && types[addndex].subNum >= 5) { |
| 1035 | //不同类型时如果原有类型数量大于等于5,保存批量答案 | 1036 | //不同类型时如果原有类型数量大于等于5,保存批量答案 |
| 1036 | - types[addndex].endIndex = | ||
| 1037 | - this.form.questionList[index - 1].questionIndex; | 1037 | + types[addndex].endIndex = questionList[index - 1].questionIndex; |
| 1038 | types[addndex].index = index - 1; | 1038 | types[addndex].index = index - 1; |
| 1039 | addndex += 1; | 1039 | addndex += 1; |
| 1040 | types[addndex] = {}; | 1040 | types[addndex] = {}; |
src/views/examinationPaper/edit.vue
| @@ -1102,6 +1102,7 @@ export default { | @@ -1102,6 +1102,7 @@ export default { | ||
| 1102 | ) { | 1102 | ) { |
| 1103 | //同类型批量答案+1 | 1103 | //同类型批量答案+1 |
| 1104 | types[addndex].subNum += 1; | 1104 | types[addndex].subNum += 1; |
| 1105 | + //最大选项 | ||
| 1105 | if ( | 1106 | if ( |
| 1106 | types[addndex].answerOptions.length < sub.answerOptions.length | 1107 | types[addndex].answerOptions.length < sub.answerOptions.length |
| 1107 | ) { | 1108 | ) { |
| @@ -1111,7 +1112,8 @@ export default { | @@ -1111,7 +1112,8 @@ export default { | ||
| 1111 | sub.questionType, | 1112 | sub.questionType, |
| 1112 | sub.correctAnswer | 1113 | sub.correctAnswer |
| 1113 | ); | 1114 | ); |
| 1114 | - if (index == this.questionList.length - 1) { | 1115 | + |
| 1116 | + if (index == arr.length - 1) { | ||
| 1115 | //循环最后类型数量大于等于5,保存批量答案 | 1117 | //循环最后类型数量大于等于5,保存批量答案 |
| 1116 | if (types[addndex].subNum && types[addndex].subNum >= 5) { | 1118 | if (types[addndex].subNum && types[addndex].subNum >= 5) { |
| 1117 | types[addndex].endIndex = sub.questionIndex; | 1119 | types[addndex].endIndex = sub.questionIndex; |
| @@ -1139,6 +1141,7 @@ export default { | @@ -1139,6 +1141,7 @@ export default { | ||
| 1139 | } | 1141 | } |
| 1140 | return sub; | 1142 | return sub; |
| 1141 | }); | 1143 | }); |
| 1144 | + console.log(types); | ||
| 1142 | for (let i = 0; i < types.length; i++) { | 1145 | for (let i = 0; i < types.length; i++) { |
| 1143 | if (types[i].qusType == 3) { | 1146 | if (types[i].qusType == 3) { |
| 1144 | types[i].answerList = types[i].answerList.slice(0, -1); | 1147 | types[i].answerList = types[i].answerList.slice(0, -1); |