Commit c3c2b1278c72b719a667e58680804afbfbb56754
1 parent
58744c8c
即时测多班汇总
Showing
2 changed files
with
55 additions
and
21 deletions
src/views/basic/test/components/multipleClass.vue
0 → 100644
src/views/basic/test/list.vue
| ... | ... | @@ -36,11 +36,13 @@ |
| 36 | 36 | style="width: 100%" |
| 37 | 37 | @selection-change="handleSelectionChange" |
| 38 | 38 | > |
| 39 | - <el-table-column width="40" v-if="role == 'ROLE_BANZHUREN'"> | |
| 39 | + <el-table-column width="36" v-if="role == 'ROLE_BANZHUREN'"> | |
| 40 | 40 | <template slot-scope="scope"> |
| 41 | 41 | <el-checkbox |
| 42 | 42 | v-model="multipleSelection" |
| 43 | 43 | :label="scope.row.id" |
| 44 | + :disabled="checkboxDisabled(scope.row)" | |
| 45 | + ><span></span | |
| 44 | 46 | ></el-checkbox> |
| 45 | 47 | </template> |
| 46 | 48 | </el-table-column> |
| ... | ... | @@ -249,6 +251,7 @@ export default { |
| 249 | 251 | endDay: "", |
| 250 | 252 | }, |
| 251 | 253 | multipleSelection: [], |
| 254 | + multipleSelectionClassId: [], | |
| 252 | 255 | tableData: [], |
| 253 | 256 | page: 1, |
| 254 | 257 | size: 20, |
| ... | ... | @@ -333,31 +336,45 @@ export default { |
| 333 | 336 | }); |
| 334 | 337 | subjectArr = [...new Set(subjectArr)]; |
| 335 | 338 | console.log(subjectArr); |
| 336 | - if (ids.length == 1) { | |
| 337 | - this.$router.push({ | |
| 338 | - path: "/testAnalysis", | |
| 339 | - query: { | |
| 340 | - id: ids[0], | |
| 341 | - title: this.multipleSelection[0].title, | |
| 342 | - score: this.multipleSelection[0].examPaperScore || 0, | |
| 343 | - type: 1, | |
| 344 | - subjectName: subjectArr.join(), | |
| 345 | - classId: this.query.classId[0], | |
| 346 | - params: this.$route.query.params, | |
| 347 | - }, | |
| 348 | - }); | |
| 349 | - } else { | |
| 339 | + if (this.multipleSelectionClassId.length > 1) { | |
| 350 | 340 | //去详情 |
| 351 | 341 | this.$router.push({ |
| 352 | 342 | path: "/testAnalysis", |
| 353 | 343 | query: { |
| 354 | 344 | ids: ids.join(), |
| 355 | - classId: this.query.classId[0], | |
| 356 | - type: subjectArr.length == 1 ? 2 : 3, | |
| 345 | + classId: this.multipleSelectionClassId.join(), | |
| 346 | + type: 5, | |
| 357 | 347 | subjectName: subjectArr.join(), |
| 358 | 348 | params: this.$route.query.params, |
| 359 | 349 | }, |
| 360 | 350 | }); |
| 351 | + } else { | |
| 352 | + if (ids.length == 1) { | |
| 353 | + this.$router.push({ | |
| 354 | + path: "/testAnalysis", | |
| 355 | + query: { | |
| 356 | + id: ids[0], | |
| 357 | + title: this.multipleSelection[0].title, | |
| 358 | + score: this.multipleSelection[0].examPaperScore || 0, | |
| 359 | + type: 1, | |
| 360 | + subjectName: subjectArr.join(), | |
| 361 | + classId: this.query.classId[0], | |
| 362 | + params: this.$route.query.params, | |
| 363 | + }, | |
| 364 | + }); | |
| 365 | + } else { | |
| 366 | + //去详情 | |
| 367 | + this.$router.push({ | |
| 368 | + path: "/testAnalysis", | |
| 369 | + query: { | |
| 370 | + ids: ids.join(), | |
| 371 | + classId: this.query.classId[0], | |
| 372 | + type: subjectArr.length == 1 ? 2 : 3, | |
| 373 | + subjectName: subjectArr.join(), | |
| 374 | + params: this.$route.query.params, | |
| 375 | + }, | |
| 376 | + }); | |
| 377 | + } | |
| 361 | 378 | } |
| 362 | 379 | }, |
| 363 | 380 | // 多班对比 |
| ... | ... | @@ -376,6 +393,22 @@ export default { |
| 376 | 393 | }, |
| 377 | 394 | }); |
| 378 | 395 | }, |
| 396 | + // 班主任教学班不能与行政班汇总 | |
| 397 | + checkboxDisabled(obj) { | |
| 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 | + } | |
| 406 | + } | |
| 407 | + return obj.classId == classId ? false : true; | |
| 408 | + } else { | |
| 409 | + return false; | |
| 410 | + } | |
| 411 | + }, | |
| 379 | 412 | handleSelectionChange(val) { |
| 380 | 413 | this.multipleSelection = val; |
| 381 | 414 | }, |
| ... | ... | @@ -464,13 +497,14 @@ export default { |
| 464 | 497 | this.total = data?.count || 0; |
| 465 | 498 | } else { |
| 466 | 499 | this.isMultipleClass = true; |
| 467 | - let classArr = []; | |
| 500 | + this.multipleSelectionClassId = []; | |
| 468 | 501 | data?.list?.map((item) => { |
| 469 | - if (!classArr.includes(item.classId)) { | |
| 470 | - classArr.push(item.classId); | |
| 502 | + if (!this.multipleSelectionClassId.includes(item.classId)) { | |
| 503 | + this.multipleSelectionClassId.push(item.classId); | |
| 471 | 504 | } |
| 472 | 505 | }); |
| 473 | - if (classArr.length > 1) { | |
| 506 | + | |
| 507 | + if (this.multipleSelectionClassId.length > 1) { | |
| 474 | 508 | //多班级 |
| 475 | 509 | let tableObj = {}; |
| 476 | 510 | data?.list?.map((item) => { | ... | ... |