Commit c3c2b1278c72b719a667e58680804afbfbb56754

Authored by 梁保满
1 parent 58744c8c

即时测多班汇总

src/views/basic/test/components/multipleClass.vue 0 → 100644
src/views/basic/test/list.vue
@@ -36,11 +36,13 @@ @@ -36,11 +36,13 @@
36 style="width: 100%" 36 style="width: 100%"
37 @selection-change="handleSelectionChange" 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 <template slot-scope="scope"> 40 <template slot-scope="scope">
41 <el-checkbox 41 <el-checkbox
42 v-model="multipleSelection" 42 v-model="multipleSelection"
43 :label="scope.row.id" 43 :label="scope.row.id"
  44 + :disabled="checkboxDisabled(scope.row)"
  45 + ><span></span
44 ></el-checkbox> 46 ></el-checkbox>
45 </template> 47 </template>
46 </el-table-column> 48 </el-table-column>
@@ -249,6 +251,7 @@ export default { @@ -249,6 +251,7 @@ export default {
249 endDay: "", 251 endDay: "",
250 }, 252 },
251 multipleSelection: [], 253 multipleSelection: [],
  254 + multipleSelectionClassId: [],
252 tableData: [], 255 tableData: [],
253 page: 1, 256 page: 1,
254 size: 20, 257 size: 20,
@@ -333,31 +336,45 @@ export default { @@ -333,31 +336,45 @@ export default {
333 }); 336 });
334 subjectArr = [...new Set(subjectArr)]; 337 subjectArr = [...new Set(subjectArr)];
335 console.log(subjectArr); 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 this.$router.push({ 341 this.$router.push({
352 path: "/testAnalysis", 342 path: "/testAnalysis",
353 query: { 343 query: {
354 ids: ids.join(), 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 subjectName: subjectArr.join(), 347 subjectName: subjectArr.join(),
358 params: this.$route.query.params, 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,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 handleSelectionChange(val) { 412 handleSelectionChange(val) {
380 this.multipleSelection = val; 413 this.multipleSelection = val;
381 }, 414 },
@@ -464,13 +497,14 @@ export default { @@ -464,13 +497,14 @@ export default {
464 this.total = data?.count || 0; 497 this.total = data?.count || 0;
465 } else { 498 } else {
466 this.isMultipleClass = true; 499 this.isMultipleClass = true;
467 - let classArr = []; 500 + this.multipleSelectionClassId = [];
468 data?.list?.map((item) => { 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 let tableObj = {}; 509 let tableObj = {};
476 data?.list?.map((item) => { 510 data?.list?.map((item) => {