Commit ee00775c8a49f23626ba5a1fe938b1d4e691d091
1 parent
4295ede6
测试bug
Showing
7 changed files
with
229 additions
and
113 deletions
src/api/apis/apis.js
| ... | ... | @@ -1593,6 +1593,15 @@ export default { |
| 1593 | 1593 | return service({ |
| 1594 | 1594 | url: setUpUrls.exportExamMultiReport, |
| 1595 | 1595 | method: "POST", |
| 1596 | + responseType: 'arraybuffer', | |
| 1597 | + data, | |
| 1598 | + }); | |
| 1599 | + }, | |
| 1600 | + // 查询即时测多班默认等级列表 | |
| 1601 | + defaultLevels(data) { | |
| 1602 | + return service({ | |
| 1603 | + url: setUpUrls.defaultLevels, | |
| 1604 | + method: "POST", | |
| 1596 | 1605 | data |
| 1597 | 1606 | }); |
| 1598 | 1607 | }, | ... | ... |
src/api/urls/apis.js
| ... | ... | @@ -415,4 +415,6 @@ export default { |
| 415 | 415 | examMultiClassReport: "/api_html/teaching/examMultiClassReport", |
| 416 | 416 | //导出即时测多班报表 |
| 417 | 417 | exportExamMultiReport: "/api_html/teaching/exportExamMultiReport", |
| 418 | + //查询即时测多班默认等级列表 | |
| 419 | + defaultLevels: "/api_html/teaching/defaultLevels", | |
| 418 | 420 | } | ... | ... |
src/views/standard/setUp/account.vue
| ... | ... | @@ -213,7 +213,12 @@ |
| 213 | 213 | </el-pagination> |
| 214 | 214 | </div> |
| 215 | 215 | </div> |
| 216 | - <el-dialog :close-on-click-modal="false" title="修改账号信息" :visible.sync="diaCount" width="400"> | |
| 216 | + <el-dialog | |
| 217 | + :close-on-click-modal="false" | |
| 218 | + title="修改账号信息" | |
| 219 | + :visible.sync="diaCount" | |
| 220 | + width="400" | |
| 221 | + > | |
| 217 | 222 | <el-form |
| 218 | 223 | class="form-box" |
| 219 | 224 | :model="formCount" |
| ... | ... | @@ -244,12 +249,17 @@ |
| 244 | 249 | </el-col> |
| 245 | 250 | </el-form-item> |
| 246 | 251 | </el-form> |
| 247 | - <div class="dialog-footer" slot="footer"> | |
| 252 | + <div class="dialog-footer" slot="footer" v-loading="loadingSave"> | |
| 248 | 253 | <el-button @click="saveCount">确 定</el-button> |
| 249 | 254 | <el-button @click="diaCount = false">取 消</el-button> |
| 250 | 255 | </div> |
| 251 | 256 | </el-dialog> |
| 252 | - <el-dialog :close-on-click-modal="false" title="添加账号" :visible.sync="diaAdd" width="400"> | |
| 257 | + <el-dialog | |
| 258 | + :close-on-click-modal="false" | |
| 259 | + title="添加账号" | |
| 260 | + :visible.sync="diaAdd" | |
| 261 | + width="400" | |
| 262 | + > | |
| 253 | 263 | <el-form |
| 254 | 264 | class="form-box" |
| 255 | 265 | :model="formAddCount" |
| ... | ... | @@ -344,12 +354,17 @@ |
| 344 | 354 | </el-col> |
| 345 | 355 | </el-form-item> |
| 346 | 356 | </el-form> |
| 347 | - <div class="dialog-footer" slot="footer"> | |
| 357 | + <div class="dialog-footer" slot="footer" v-loading="loadingSave"> | |
| 348 | 358 | <el-button @click="saveAddCount">确 定</el-button> |
| 349 | 359 | <el-button @click="diaAdd = false">取 消</el-button> |
| 350 | 360 | </div> |
| 351 | 361 | </el-dialog> |
| 352 | - <el-dialog :close-on-click-modal="false" title="导入账号名单" :visible.sync="diaUp" width="600"> | |
| 362 | + <el-dialog | |
| 363 | + :close-on-click-modal="false" | |
| 364 | + title="导入账号名单" | |
| 365 | + :visible.sync="diaUp" | |
| 366 | + width="600" | |
| 367 | + > | |
| 353 | 368 | <up-load |
| 354 | 369 | id="downTeacher" |
| 355 | 370 | :url="url" |
| ... | ... | @@ -380,6 +395,7 @@ export default { |
| 380 | 395 | url: "", //上传地址 |
| 381 | 396 | loading: false, |
| 382 | 397 | syncLoading: false, |
| 398 | + loadingSave: false, | |
| 383 | 399 | diaCount: false, |
| 384 | 400 | tenantRoleList: [], |
| 385 | 401 | regionList: [], |
| ... | ... | @@ -507,11 +523,13 @@ export default { |
| 507 | 523 | saveAddCount() { |
| 508 | 524 | this.$refs.formAddCount.validate(async (valid) => { |
| 509 | 525 | if (valid) { |
| 526 | + this.loadingSave = true; | |
| 510 | 527 | let params = { ...this.formAddCount }; |
| 511 | 528 | params.password = encryptLoginPassword(params.password); |
| 512 | 529 | const { data, status, info } = await this.$request.addUser({ |
| 513 | 530 | ...params, |
| 514 | 531 | }); |
| 532 | + this.loadingSave = false; | |
| 515 | 533 | if (status === 0) { |
| 516 | 534 | this.$message.success(info); |
| 517 | 535 | this._QueryData(4); |
| ... | ... | @@ -559,6 +577,7 @@ export default { |
| 559 | 577 | saveCount() { |
| 560 | 578 | this.$refs.formCount.validate(async (valid) => { |
| 561 | 579 | if (valid) { |
| 580 | + this.loadingSave = true; | |
| 562 | 581 | const { data, status, info } = |
| 563 | 582 | this.role != "ROLE_JITUAN" |
| 564 | 583 | ? await this.$request.updateUser({ |
| ... | ... | @@ -569,6 +588,7 @@ export default { |
| 569 | 588 | type: 3, |
| 570 | 589 | ...this.formCount, |
| 571 | 590 | }); |
| 591 | + this.loadingSave = false; | |
| 572 | 592 | if (status === 0) { |
| 573 | 593 | this.$message.success(info); |
| 574 | 594 | this.diaCount = false; | ... | ... |
src/views/standard/setUp/conglomerate.vue
| ... | ... | @@ -109,7 +109,7 @@ |
| 109 | 109 | </el-col> |
| 110 | 110 | </el-form-item> |
| 111 | 111 | </el-form> |
| 112 | - <div class="dialog-footer" slot="footer"> | |
| 112 | + <div class="dialog-footer" slot="footer" v-loading="loadingSave"> | |
| 113 | 113 | <el-button type="primary" round @click="saveFormCL">确 定</el-button> |
| 114 | 114 | <el-button round @click="diaCL = false">取 消</el-button> |
| 115 | 115 | </div> |
| ... | ... | @@ -159,7 +159,7 @@ |
| 159 | 159 | </el-col> |
| 160 | 160 | </el-form-item> |
| 161 | 161 | </el-form> |
| 162 | - <div class="dialog-footer" slot="footer"> | |
| 162 | + <div class="dialog-footer" slot="footer" v-loading="loadingSave"> | |
| 163 | 163 | <el-button type="primary" round @click="saveFormAdmin">确 定</el-button> |
| 164 | 164 | <el-button round @click="diaAdmin = false">取 消</el-button> |
| 165 | 165 | </div> |
| ... | ... | @@ -212,7 +212,7 @@ |
| 212 | 212 | </el-checkbox-group> |
| 213 | 213 | </el-form-item> |
| 214 | 214 | </el-form> |
| 215 | - <div class="dialog-footer" slot="footer"> | |
| 215 | + <div class="dialog-footer" slot="footer" v-loading="loadingSave"> | |
| 216 | 216 | <el-button type="primary" round @click="saveFormSchool" |
| 217 | 217 | >确 定</el-button |
| 218 | 218 | > |
| ... | ... | @@ -242,7 +242,7 @@ |
| 242 | 242 | </el-col> |
| 243 | 243 | </el-form-item> |
| 244 | 244 | </el-form> |
| 245 | - <div class="dialog-footer" slot="footer"> | |
| 245 | + <div class="dialog-footer" slot="footer" v-loading="loadingSave"> | |
| 246 | 246 | <el-button type="primary" round @click="saveSetFormSchool" |
| 247 | 247 | >确 定</el-button |
| 248 | 248 | > |
| ... | ... | @@ -319,6 +319,8 @@ export default { |
| 319 | 319 | schoolName: "", |
| 320 | 320 | }, |
| 321 | 321 | showDelSclBtn: false, |
| 322 | + | |
| 323 | + loadingSave: false, | |
| 322 | 324 | }; |
| 323 | 325 | }, |
| 324 | 326 | created() { |
| ... | ... | @@ -397,10 +399,12 @@ export default { |
| 397 | 399 | this.$refs["formCL"].validate(async (valid) => { |
| 398 | 400 | // 验证通过:保存 |
| 399 | 401 | if (valid) { |
| 402 | + this.loadingSave = true; | |
| 400 | 403 | const { data, status, info } = await this.$request.saveRegion({ |
| 401 | 404 | regionId: this.formCL.regionId, |
| 402 | 405 | regionName: this.formCL.regionName, |
| 403 | 406 | }); |
| 407 | + this.loadingSave = false; | |
| 404 | 408 | if (status === 0) { |
| 405 | 409 | this._QueryData(); |
| 406 | 410 | this.$message.success(info); |
| ... | ... | @@ -419,12 +423,14 @@ export default { |
| 419 | 423 | this.$refs["formAdmin"].validate(async (valid) => { |
| 420 | 424 | // 验证通过:保存 |
| 421 | 425 | if (valid) { |
| 426 | + this.loadingSave = true; | |
| 422 | 427 | let params = { ...this.formAdmin }; |
| 423 | 428 | params.password = encryptLoginPassword(this.formAdmin.password); |
| 424 | 429 | delete params.schoolName; |
| 425 | 430 | const { data, status, info } = await this.$request.addSchoolManager({ |
| 426 | 431 | ...params, |
| 427 | 432 | }); |
| 433 | + this.loadingSave = false; | |
| 428 | 434 | if (status === 0) { |
| 429 | 435 | this.$message.success(info); |
| 430 | 436 | this.diaAdmin = false; |
| ... | ... | @@ -442,11 +448,13 @@ export default { |
| 442 | 448 | this.$refs["formSchool"].validate(async (valid) => { |
| 443 | 449 | // 验证通过:保存 |
| 444 | 450 | if (valid) { |
| 451 | + this.loadingSave = true; | |
| 445 | 452 | let query = { ...this.formSchool }; |
| 446 | 453 | query.sections = query.sections.join(","); |
| 447 | 454 | const { data, status, info } = await this.$request.saveSchool({ |
| 448 | 455 | ...query, |
| 449 | 456 | }); |
| 457 | + this.loadingSave = false; | |
| 450 | 458 | if (status === 0) { |
| 451 | 459 | this.$message.success(info); |
| 452 | 460 | this.diaSchool = false; |
| ... | ... | @@ -466,9 +474,11 @@ export default { |
| 466 | 474 | this.$refs["formSchool2"].validate(async (valid) => { |
| 467 | 475 | // 验证通过:保存 |
| 468 | 476 | if (valid) { |
| 477 | + this.loadingSave = true; | |
| 469 | 478 | const { data, status, info } = await this.$request.saveSchool({ |
| 470 | 479 | ...this.setFormSchool, |
| 471 | 480 | }); |
| 481 | + this.loadingSave = false; | |
| 472 | 482 | if (status === 0) { |
| 473 | 483 | this.$message.success(info); |
| 474 | 484 | this.diaSchool2 = false; | ... | ... |
src/views/standard/test/analysis.vue
| ... | ... | @@ -482,8 +482,8 @@ |
| 482 | 482 | <el-form> |
| 483 | 483 | <el-form-item label="低分设置模式:"> |
| 484 | 484 | <el-select v-model="lowRange.type" @change="changeScore"> |
| 485 | - <el-option label="按已考人数比例" :value="0"></el-option> | |
| 486 | - <el-option label="按分数设置" :value="1"></el-option> | |
| 485 | + <el-option label="按分数设置" :value="0"></el-option> | |
| 486 | + <el-option label="按已考人数比例" :value="1"></el-option> | |
| 487 | 487 | </el-select> |
| 488 | 488 | </el-form-item> |
| 489 | 489 | <el-form-item label="低分区间:"> |
| ... | ... | @@ -494,8 +494,9 @@ |
| 494 | 494 | :min="0" |
| 495 | 495 | :max="100" |
| 496 | 496 | @input="lowRange.range[1] > 100 ? (lowRange.range[1] = 100) : ''" |
| 497 | + @keydown.native="keydownRange($event)" | |
| 497 | 498 | ></el-input |
| 498 | - >{{ lowRange.type == 0 ? "%" : "分" }}(含) | |
| 499 | + >{{ lowRange.type == 1 ? "%" : "分" }}(含) | |
| 499 | 500 | <el-input |
| 500 | 501 | class="score-ipt" |
| 501 | 502 | type="number" |
| ... | ... | @@ -503,12 +504,18 @@ |
| 503 | 504 | :min="0" |
| 504 | 505 | :max="100" |
| 505 | 506 | @input="lowRange.range[1] > 100 ? (lowRange.range[1] = 100) : ''" |
| 507 | + @keydown.native="keydownRange($event)" | |
| 506 | 508 | ></el-input |
| 507 | - >{{ lowRange.type == 0 ? "%" : "分" }}(含) | |
| 509 | + >{{ lowRange.type == 1 ? "%" : "分" }}(含) | |
| 508 | 510 | </el-form-item> |
| 509 | 511 | </el-form> |
| 510 | 512 | |
| 511 | - <div class="dialog-footer" slot="footer" align="center" v-loading="loadingTange"> | |
| 513 | + <div | |
| 514 | + class="dialog-footer" | |
| 515 | + slot="footer" | |
| 516 | + align="center" | |
| 517 | + v-loading="loadingTange" | |
| 518 | + > | |
| 512 | 519 | <el-button type="danger" @click="_SavelowRange">保存</el-button> |
| 513 | 520 | <el-button @click="diaMinScore = false">取 消</el-button> |
| 514 | 521 | </div> |
| ... | ... | @@ -565,12 +572,16 @@ export default { |
| 565 | 572 | size: 20, |
| 566 | 573 | total: 0, |
| 567 | 574 | // 设置低分值 |
| 568 | - loadingTange:false, | |
| 575 | + loadingTange: false, | |
| 569 | 576 | diaMinScore: false, |
| 570 | 577 | lowRange: { |
| 571 | - type: 1, | |
| 578 | + type: 0, | |
| 572 | 579 | range: [60, 0], |
| 573 | 580 | }, |
| 581 | + defaultLowRange: { | |
| 582 | + type: 0, | |
| 583 | + range: [], | |
| 584 | + }, | |
| 574 | 585 | }; |
| 575 | 586 | }, |
| 576 | 587 | created() { |
| ... | ... | @@ -637,26 +648,34 @@ export default { |
| 637 | 648 | }, |
| 638 | 649 | // 切换低分设置类型设置默认分值 |
| 639 | 650 | changeScore() { |
| 640 | - this.lowRange.range = [60, 0]; | |
| 651 | + this.lowRange.range = [...this.defaultLowRange.range]; | |
| 652 | + }, | |
| 653 | + // 禁止输入负数 | |
| 654 | + keydownRange(event) { | |
| 655 | + if (event.key == "-" || event.key == "e") { | |
| 656 | + event.returnValue = ""; | |
| 657 | + } | |
| 641 | 658 | }, |
| 642 | 659 | // 关闭低分设置 |
| 643 | 660 | closeDiaMinScore() { |
| 644 | - this.lowRange.type = 1; | |
| 645 | - this.lowRange.range = [60, 0]; | |
| 661 | + this.lowRange.type = this.defaultLowRange.type; | |
| 662 | + this.lowRange.range = [...this.defaultLowRange.range]; | |
| 646 | 663 | }, |
| 647 | 664 | // 保存低分设置 |
| 648 | 665 | async _SavelowRange() { |
| 649 | 666 | this.loadingTange = true; |
| 650 | - let data = await this.$request.setLowRange({ | |
| 667 | + let { data, status, info } = await this.$request.setLowRange({ | |
| 651 | 668 | classId: this.classId, |
| 652 | 669 | subjectName: this.subjectName, |
| 653 | 670 | ...this.lowRange, |
| 654 | 671 | }); |
| 655 | 672 | this.loadingTange = false; |
| 656 | - if (data && !data.code) { | |
| 657 | - this.$message.success(data.info); | |
| 673 | + if (status === 0) { | |
| 674 | + this.$message.success(info); | |
| 658 | 675 | this.diaMinScore = false; |
| 659 | - this.$message.error(data.info); | |
| 676 | + this.examDetail(); | |
| 677 | + } else { | |
| 678 | + this.$message.error(info); | |
| 660 | 679 | } |
| 661 | 680 | }, |
| 662 | 681 | async _QueryData() { |
| ... | ... | @@ -676,10 +695,12 @@ export default { |
| 676 | 695 | this.paperModifyLog = { ...data?.paperModifyLog }; |
| 677 | 696 | } |
| 678 | 697 | this.examReport = { ...data?.examReport }; |
| 679 | - this.lowRange = data.lowRange || { | |
| 698 | + this.defaultLowRange = data.lowRange || { | |
| 680 | 699 | type: 1, |
| 681 | 700 | range: [60, 0], |
| 682 | 701 | }; |
| 702 | + this.lowRange.type = this.defaultLowRange.type; | |
| 703 | + this.lowRange.range = [...this.defaultLowRange.range]; | |
| 683 | 704 | } else { |
| 684 | 705 | this.$message.error(info); |
| 685 | 706 | } | ... | ... |
src/views/standard/test/contrast.vue
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | <div ref="main" class="page-container"> |
| 3 | 3 | <back-box> |
| 4 | 4 | <template slot="title"> |
| 5 | - <span>多班分析_{{ subjectNames }}_{{ title }}_成绩对比分析</span> | |
| 5 | + <span>多班_{{ subjectNames }}_{{ title }}_测练成绩对比分析</span> | |
| 6 | 6 | </template> |
| 7 | 7 | </back-box> |
| 8 | 8 | <div class="page-content"> |
| ... | ... | @@ -36,6 +36,7 @@ |
| 36 | 36 | <el-table-column |
| 37 | 37 | type="index" |
| 38 | 38 | label="序号" |
| 39 | + fixed | |
| 39 | 40 | align="center" |
| 40 | 41 | width="60" |
| 41 | 42 | ></el-table-column> |
| ... | ... | @@ -44,36 +45,29 @@ |
| 44 | 45 | label="班级" |
| 45 | 46 | align="center" |
| 46 | 47 | fixed |
| 47 | - width="100" | |
| 48 | - ><</el-table-column | |
| 49 | - > | |
| 48 | + ></el-table-column> | |
| 50 | 49 | <el-table-column |
| 51 | 50 | prop="count" |
| 52 | - width="100" | |
| 53 | 51 | label="测验人数/班级人数" |
| 54 | 52 | align="center" |
| 55 | 53 | ></el-table-column> |
| 56 | 54 | <el-table-column |
| 57 | 55 | prop="percent" |
| 58 | - width="110" | |
| 59 | 56 | label="参与度" |
| 60 | 57 | align="center" |
| 61 | 58 | ></el-table-column> |
| 62 | 59 | <el-table-column |
| 63 | - width="110" | |
| 64 | 60 | prop="avg" |
| 65 | 61 | label="班平均分" |
| 66 | 62 | align="center" |
| 67 | 63 | ></el-table-column> |
| 68 | 64 | <el-table-column |
| 69 | - width="110" | |
| 70 | 65 | prop="max" |
| 71 | 66 | label="班最高分" |
| 72 | 67 | sortable |
| 73 | 68 | align="center" |
| 74 | 69 | ></el-table-column> |
| 75 | 70 | <el-table-column |
| 76 | - width="110" | |
| 77 | 71 | prop="min" |
| 78 | 72 | label="班最低分" |
| 79 | 73 | sortable |
| ... | ... | @@ -81,14 +75,13 @@ |
| 81 | 75 | ></el-table-column> |
| 82 | 76 | |
| 83 | 77 | <el-table-column |
| 84 | - v-for="(item, index) in tableData[0].levels" | |
| 85 | - width="120" | |
| 86 | - sortable | |
| 87 | - :label="item.name" | |
| 78 | + v-for="(item, index) in defaultLevels.levels" | |
| 79 | + :label="item[0] + '数(率)'" | |
| 88 | 80 | align="center" |
| 89 | - ><template slot-scope="scoped">{{ | |
| 90 | - `${scoped.row.levels[index].people}(${scoped.row.levels[index].percent})` | |
| 91 | - }}</template></el-table-column | |
| 81 | + ><template slot-scope="scoped"> | |
| 82 | + <p class="p1">{{ scoped.row.levels[index].people }}</p> | |
| 83 | + <p class="p1">({{ scoped.row.levels[index].percent }})</p> | |
| 84 | + </template></el-table-column | |
| 92 | 85 | > |
| 93 | 86 | </el-table> |
| 94 | 87 | <el-table |
| ... | ... | @@ -99,7 +92,7 @@ |
| 99 | 92 | style="width: 100%" |
| 100 | 93 | > |
| 101 | 94 | <el-table-column |
| 102 | - prop="studentCode" | |
| 95 | + prop="rank" | |
| 103 | 96 | label="排名" |
| 104 | 97 | align="center" |
| 105 | 98 | ></el-table-column> |
| ... | ... | @@ -131,6 +124,7 @@ |
| 131 | 124 | <div class="down"> |
| 132 | 125 | <div> |
| 133 | 126 | <el-button |
| 127 | + v-loading="exportLoading" | |
| 134 | 128 | @click="exportData" |
| 135 | 129 | type="primary" |
| 136 | 130 | plain |
| ... | ... | @@ -171,13 +165,9 @@ |
| 171 | 165 | </el-select> |
| 172 | 166 | </el-form-item> |
| 173 | 167 | <el-form-item label="等级设置模式:" class="use-form-item"> |
| 174 | - <el-select | |
| 175 | - size="small" | |
| 176 | - v-model="fromData.levelType" | |
| 177 | - @change="changeLevelType" | |
| 178 | - > | |
| 179 | - <el-option label="按已考人数比例" :value="0"></el-option> | |
| 180 | - <el-option label="按分数比例" :value="1"></el-option> | |
| 168 | + <el-select size="small" v-model="fromData.levelType"> | |
| 169 | + <el-option label="按分数比例" :value="0"></el-option> | |
| 170 | + <el-option label="按已考人数比例" :value="1"></el-option> | |
| 181 | 171 | </el-select> |
| 182 | 172 | </el-form-item> |
| 183 | 173 | </el-form-item> |
| ... | ... | @@ -200,6 +190,7 @@ |
| 200 | 190 | class="score-ipt" |
| 201 | 191 | v-model="item[0]" |
| 202 | 192 | :maxlength="12" |
| 193 | + @keydown.native="keydownRange($event)" | |
| 203 | 194 | ></el-input> |
| 204 | 195 | </p> |
| 205 | 196 | <p class="item2"> |
| ... | ... | @@ -209,6 +200,7 @@ |
| 209 | 200 | v-model="item[1]" |
| 210 | 201 | :min="item[2]" |
| 211 | 202 | :max="index == 0 ? 150 : fromData.levels[index - 1][2]" |
| 203 | + @keydown.native="keydownRange($event)" | |
| 212 | 204 | ></el-input> |
| 213 | 205 | {{ fromData.levelType == 1 ? "%" : "分" }} - |
| 214 | 206 | </p> |
| ... | ... | @@ -219,6 +211,7 @@ |
| 219 | 211 | v-model="item[2]" |
| 220 | 212 | :min="0" |
| 221 | 213 | :max="item[1]" |
| 214 | + @keydown.native="keydownRange($event)" | |
| 222 | 215 | ></el-input> |
| 223 | 216 | {{ fromData.levelType == 1 ? "%" : "分" }} |
| 224 | 217 | </p> |
| ... | ... | @@ -266,6 +259,7 @@ export default { |
| 266 | 259 | tabList: ["班级对比情况", "学生成绩排名"], |
| 267 | 260 | type: 0, |
| 268 | 261 | loading: false, |
| 262 | + exportLoading: false, | |
| 269 | 263 | diaLogBox: false, |
| 270 | 264 | fromData: { |
| 271 | 265 | type: 1, |
| ... | ... | @@ -277,7 +271,10 @@ export default { |
| 277 | 271 | ["不合格", 59.9, 0], |
| 278 | 272 | ], |
| 279 | 273 | }, |
| 280 | - | |
| 274 | + defaultLevels: { | |
| 275 | + levelType: 0, | |
| 276 | + levels: [], | |
| 277 | + }, | |
| 281 | 278 | tableMaxHeight: 600, |
| 282 | 279 | tableData: [], |
| 283 | 280 | tableData2: [], |
| ... | ... | @@ -285,13 +282,24 @@ export default { |
| 285 | 282 | }, |
| 286 | 283 | created() { |
| 287 | 284 | this.ids = this.$route.query.ids; |
| 288 | - this.title = this.$route.query.title || ""; | |
| 289 | - this.subjectNames = this.$route.query.subjectNames; | |
| 285 | + this._QueryDefaultLevels(); | |
| 290 | 286 | this._QueryData(); |
| 291 | 287 | }, |
| 288 | + destroyed() { | |
| 289 | + sessionStorage.setItem("levelFromData", ""); | |
| 290 | + }, | |
| 292 | 291 | methods: { |
| 292 | + // 禁止输入负数 | |
| 293 | + keydownRange(event) { | |
| 294 | + if (event.key == "-" || event.key == "e") { | |
| 295 | + event.returnValue = ""; | |
| 296 | + } | |
| 297 | + }, | |
| 293 | 298 | print() { |
| 294 | - tablePrint("print-content", this.title + "_成绩对比分析"); | |
| 299 | + tablePrint( | |
| 300 | + "print-content", | |
| 301 | + `多班_${this.subjectNames}_${this.title}_测练成绩对比分析` | |
| 302 | + ); | |
| 295 | 303 | }, |
| 296 | 304 | setType(type) { |
| 297 | 305 | console.log(this.$refs.main.offsetHeight - 50); |
| ... | ... | @@ -299,23 +307,21 @@ export default { |
| 299 | 307 | this.type = type; |
| 300 | 308 | }, |
| 301 | 309 | closeDia() { |
| 302 | - this.fromData.type = 1; | |
| 303 | - this.fromData.levelType = 0; | |
| 304 | - this.fromData.levels = [ | |
| 305 | - ["优秀", 100, 90], | |
| 306 | - ["良好", 89.9, 70], | |
| 307 | - ["合格", 69.9, 60], | |
| 308 | - ["不合格", 59.9, 0], | |
| 309 | - ]; | |
| 310 | + let levelFromData = sessionStorage.getItem("levelFromData"); | |
| 311 | + if (levelFromData) { | |
| 312 | + levelFromData = JSON.parse(levelFromData); | |
| 313 | + this.fromData.type = levelFromData.type; | |
| 314 | + this.fromData.levelType = levelFromData.levelType; | |
| 315 | + this.fromData.levels = [...levelFromData.levels]; | |
| 316 | + } else { | |
| 317 | + this.fromData.type = 1; | |
| 318 | + this.fromData.levelType = this.defaultLevels.levelType; | |
| 319 | + this.fromData.levels = [...this.defaultLevels.levels]; | |
| 320 | + } | |
| 310 | 321 | }, |
| 311 | 322 | changeType(val) { |
| 312 | 323 | if (val == 1) { |
| 313 | - this.fromData.levels = [ | |
| 314 | - ["优秀", 100, 90], | |
| 315 | - ["良好", 89.9, 70], | |
| 316 | - ["合格", 69.9, 60], | |
| 317 | - ["不合格", 59.9, 0], | |
| 318 | - ]; | |
| 324 | + this.fromData.levels = [...this.defaultLevels.levels]; | |
| 319 | 325 | } else if (val == 2) { |
| 320 | 326 | this.fromData.levels = [ |
| 321 | 327 | ["A", 100, 90], |
| ... | ... | @@ -332,7 +338,6 @@ export default { |
| 332 | 338 | ]; |
| 333 | 339 | } |
| 334 | 340 | }, |
| 335 | - changeLevelType() {}, | |
| 336 | 341 | savefrom() { |
| 337 | 342 | this.tableData = []; |
| 338 | 343 | this.tableData2 = []; |
| ... | ... | @@ -343,12 +348,34 @@ export default { |
| 343 | 348 | return; |
| 344 | 349 | } |
| 345 | 350 | } |
| 351 | + this.defaultLevels.levelType = this.fromData.levelType; | |
| 352 | + this.defaultLevels.levels = [...this.fromData.levels]; | |
| 353 | + sessionStorage.setItem("levelFromData", JSON.stringify(this.fromData)); | |
| 354 | + this.diaLogBox = false; | |
| 346 | 355 | this._QueryData({ |
| 347 | 356 | levelType: this.fromData.levelType, |
| 348 | 357 | levels: this.fromData.levels, |
| 349 | 358 | }); |
| 350 | 359 | }, |
| 351 | 360 | |
| 361 | + async _QueryDefaultLevels() { | |
| 362 | + const { data, info, status } = await this.$request.defaultLevels(); | |
| 363 | + if (status === 0) { | |
| 364 | + this.defaultLevels = { ...data } || { | |
| 365 | + levelType: 0, | |
| 366 | + levels: [ | |
| 367 | + ["优秀", 100, 90], | |
| 368 | + ["良好", 89.9, 70], | |
| 369 | + ["合格", 69.9, 60], | |
| 370 | + ["不合格", 59.9, 0], | |
| 371 | + ], | |
| 372 | + }; | |
| 373 | + this.fromData.levelType = this.defaultLevels.levelType; | |
| 374 | + this.fromData.levels = [...this.defaultLevels.levels]; | |
| 375 | + } else { | |
| 376 | + this.$message.error(info); | |
| 377 | + } | |
| 378 | + }, | |
| 352 | 379 | async _QueryData(params) { |
| 353 | 380 | let query = {}; |
| 354 | 381 | if (params) { |
| ... | ... | @@ -358,8 +385,10 @@ export default { |
| 358 | 385 | examIds: this.ids, |
| 359 | 386 | ...query, |
| 360 | 387 | }); |
| 361 | - if (status == 200) { | |
| 362 | - this.tableData = data.classs || []; | |
| 388 | + if (status === 0) { | |
| 389 | + this.title = data.title; | |
| 390 | + this.subjectNames = data.subjectName; | |
| 391 | + this.tableData = data.classes || []; | |
| 363 | 392 | this.tableData2 = data.students || []; |
| 364 | 393 | } else { |
| 365 | 394 | this.$message.error(info); |
| ... | ... | @@ -371,14 +400,19 @@ export default { |
| 371 | 400 | if (this.exportLoading == true) return; |
| 372 | 401 | this.exportLoading = true; |
| 373 | 402 | const data = await this.$request.exportExamMultiReport({ |
| 374 | - examId: this.id, | |
| 403 | + examIds: this.ids, | |
| 404 | + levels: this.fromData.levels, | |
| 405 | + levelType: this.fromData.levelType, | |
| 375 | 406 | }); |
| 376 | 407 | this.exportLoading = false; |
| 377 | 408 | if (data) { |
| 378 | 409 | let blob = new Blob([data], { |
| 379 | 410 | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", |
| 380 | 411 | }); |
| 381 | - downloadFile("即时测-单卷测练报表.xlsx", blob); | |
| 412 | + downloadFile( | |
| 413 | + `多班_${this.subjectNames}_${this.title}_测练成绩对比分析`, | |
| 414 | + blob | |
| 415 | + ); | |
| 382 | 416 | } else { |
| 383 | 417 | this.$message.error("下载失败"); |
| 384 | 418 | } |
| ... | ... | @@ -487,4 +521,7 @@ export default { |
| 487 | 521 | } |
| 488 | 522 | } |
| 489 | 523 | } |
| 524 | +.p1{ | |
| 525 | + line-height:18px; | |
| 526 | +} | |
| 490 | 527 | </style> |
| 491 | 528 | \ No newline at end of file | ... | ... |
src/views/standard/test/index.vue
| ... | ... | @@ -33,6 +33,9 @@ |
| 33 | 33 | collapse-tags |
| 34 | 34 | > |
| 35 | 35 | <el-option |
| 36 | + :disabled=" | |
| 37 | + query.classIds.length == 1 && query.classIds[0] == item.value | |
| 38 | + " | |
| 36 | 39 | v-for="item in classList" |
| 37 | 40 | :key="item.value" |
| 38 | 41 | :label="item.label" |
| ... | ... | @@ -135,7 +138,7 @@ |
| 135 | 138 | align="center" |
| 136 | 139 | ></el-table-column> |
| 137 | 140 | <el-table-column |
| 138 | - prop="clazz" | |
| 141 | + prop="className" | |
| 139 | 142 | label="考试班级" |
| 140 | 143 | align="center" |
| 141 | 144 | width="100" |
| ... | ... | @@ -427,7 +430,11 @@ |
| 427 | 430 | :label="index == 0 ? '总分' : '成绩'" |
| 428 | 431 | align="center" |
| 429 | 432 | :class-name="index % 2 == 0 ? 'bg' : ''" |
| 430 | - ></el-table-column> | |
| 433 | + > | |
| 434 | + <template slot-scope="scoped"> | |
| 435 | + {{ Number(scoped.row["score" + index]) }} | |
| 436 | + </template></el-table-column | |
| 437 | + > | |
| 431 | 438 | <el-table-column |
| 432 | 439 | :prop="'classRank' + index" |
| 433 | 440 | label="班名" |
| ... | ... | @@ -520,7 +527,7 @@ |
| 520 | 527 | <div v-show="query.classIds.length > 1" class="table-box"> |
| 521 | 528 | <el-empty |
| 522 | 529 | :imag-size="48" |
| 523 | - v-if="!classTableLen && loading" | |
| 530 | + v-if="!classTableLen && !loading" | |
| 524 | 531 | description="暂无数据" |
| 525 | 532 | ></el-empty> |
| 526 | 533 | <div class="head-box" v-if="classTableLen"> |
| ... | ... | @@ -547,9 +554,20 @@ |
| 547 | 554 | </div> |
| 548 | 555 | <ul class="tab-ul"> |
| 549 | 556 | <template v-for="(item, index) in classTable"> |
| 550 | - <li class="tab-li" v-if="item.length"> | |
| 551 | - <p class="tab-tit">{{ item[0].className }}</p> | |
| 552 | - <el-table :data="item" border style="width: 100%"> | |
| 557 | + <li class="tab-li"> | |
| 558 | + <p class="tab-tit"> | |
| 559 | + {{ | |
| 560 | + `${item[0].className} ${ | |
| 561 | + item.length ? "(" + item.length + "份已考试卷)" : "" | |
| 562 | + }` | |
| 563 | + }} | |
| 564 | + </p> | |
| 565 | + <el-table | |
| 566 | + :data="item" | |
| 567 | + border | |
| 568 | + style="width: 100%" | |
| 569 | + v-if="item.length" | |
| 570 | + > | |
| 553 | 571 | <el-table-column label="选择" align="center" width="60"> |
| 554 | 572 | <template slot-scope="scope"> |
| 555 | 573 | <el-checkbox |
| ... | ... | @@ -563,32 +581,29 @@ |
| 563 | 581 | </el-table-column> |
| 564 | 582 | <el-table-column |
| 565 | 583 | prop="title" |
| 566 | - label="试卷名称" | |
| 567 | - align="center" | |
| 568 | - ></el-table-column> | |
| 569 | - <el-table-column | |
| 570 | - prop="classPersonNum" | |
| 571 | - label="测验人数" | |
| 584 | + label="报表名称" | |
| 572 | 585 | align="center" |
| 573 | - width="80" | |
| 574 | 586 | ></el-table-column> |
| 587 | + <el-table-column label="测验人数" align="center" width="80"> | |
| 588 | + <template slot-scope="scope">{{ | |
| 589 | + `${scope.row.answeredNum}/${scope.row.classPersonNum}` | |
| 590 | + }}</template> | |
| 591 | + </el-table-column> | |
| 575 | 592 | <el-table-column |
| 576 | 593 | prop="examStartTime" |
| 577 | 594 | label="测验开始时间" |
| 578 | 595 | width="120" |
| 579 | 596 | align="center" |
| 580 | 597 | ></el-table-column> |
| 581 | - <el-table-column | |
| 582 | - prop="duration" | |
| 583 | - label="测验时长" | |
| 584 | - align="center" | |
| 585 | - width="80" | |
| 586 | - > | |
| 598 | + <el-table-column label="测验时长" align="center" width="80"> | |
| 587 | 599 | <template slot-scope="scope">{{ |
| 588 | - (scope.row.duration / 60).toFixed(2) | |
| 600 | + `${Math.floor(scope.row.duration / 60)}分${ | |
| 601 | + scope.row.duration % 60 | |
| 602 | + }` | |
| 589 | 603 | }}</template> |
| 590 | 604 | </el-table-column> |
| 591 | 605 | </el-table> |
| 606 | + <el-empty v-else :imag-size="32" description="暂无数据"></el-empty> | |
| 592 | 607 | </li> |
| 593 | 608 | </template> |
| 594 | 609 | </ul> |
| ... | ... | @@ -665,13 +680,13 @@ export default { |
| 665 | 680 | size: 20, |
| 666 | 681 | total: 0, |
| 667 | 682 | multipleSelection: [], //选中的试卷ID |
| 668 | - classTable: [[], []], //多班级数据 | |
| 683 | + classTable: [], //多班级数据 | |
| 669 | 684 | }; |
| 670 | 685 | }, |
| 671 | 686 | computed: { |
| 672 | 687 | classTableLen: function () { |
| 673 | 688 | let len = 0; |
| 674 | - this.classTable.map((item) => { | |
| 689 | + this.classTable?.map((item) => { | |
| 675 | 690 | item.length ? (len += 1) : ""; |
| 676 | 691 | }); |
| 677 | 692 | return len; |
| ... | ... | @@ -771,19 +786,11 @@ export default { |
| 771 | 786 | this.$message.warning("请选择同一份试卷多个班级进行对比!"); |
| 772 | 787 | return; |
| 773 | 788 | } |
| 774 | - let title = ""; | |
| 775 | - for (let i = 0; i < this.tableData.length; i++) { | |
| 776 | - if (this.tableData[i].id == this.multipleSelection[0]) { | |
| 777 | - title = this.tableData[i].title; | |
| 778 | - break; | |
| 779 | - } | |
| 780 | - } | |
| 781 | 789 | this.$router.push({ |
| 782 | 790 | path: "/testContrast", |
| 783 | 791 | query: { |
| 784 | 792 | ids: this.multipleSelection, |
| 785 | 793 | subjectNames: this.query.subjectNames, |
| 786 | - title: title, | |
| 787 | 794 | }, |
| 788 | 795 | }); |
| 789 | 796 | }, |
| ... | ... | @@ -835,7 +842,7 @@ export default { |
| 835 | 842 | }); |
| 836 | 843 | if (status == 200) { |
| 837 | 844 | this.$message.success("删除成功!"); |
| 838 | - this.tableData = this.tableData.splice(index, 1); | |
| 845 | + this.tableData.splice(index, 1); | |
| 839 | 846 | } else { |
| 840 | 847 | this.$message.error(info); |
| 841 | 848 | } |
| ... | ... | @@ -937,6 +944,12 @@ export default { |
| 937 | 944 | }, |
| 938 | 945 | //切换班级 |
| 939 | 946 | async changeclass() { |
| 947 | + if (this.query.classIds.length == 0) { | |
| 948 | + this.$message.warning("请至少选择一个班级!"); | |
| 949 | + } | |
| 950 | + if (this.query.classIds != 1) { | |
| 951 | + this.tabIndex = 1; | |
| 952 | + } | |
| 940 | 953 | await this._QuerySubjectList(); |
| 941 | 954 | this.page = 1; |
| 942 | 955 | this._QueryData(); |
| ... | ... | @@ -1020,6 +1033,7 @@ export default { |
| 1020 | 1033 | }, |
| 1021 | 1034 | //单卷测练 |
| 1022 | 1035 | async examReportList(msg) { |
| 1036 | + this.multipleSelection = []; | |
| 1023 | 1037 | this.loading = true; |
| 1024 | 1038 | let query = {}; |
| 1025 | 1039 | for (let key in this.query) { |
| ... | ... | @@ -1059,17 +1073,18 @@ export default { |
| 1059 | 1073 | }); |
| 1060 | 1074 | this.loading = false; |
| 1061 | 1075 | if (status === 0) { |
| 1062 | - if (query.classId) { | |
| 1063 | - //单班级 | |
| 1064 | - this.tableData = (data?.list && [...data?.list]) || []; | |
| 1065 | - this.total = data?.count || 0; | |
| 1066 | - } else { | |
| 1076 | + this.tableData = (data?.list && [...data?.list]) || []; | |
| 1077 | + this.total = data?.count || 0; | |
| 1078 | + if (!query.classId) { | |
| 1067 | 1079 | //多班级 |
| 1068 | 1080 | this.classTable = []; |
| 1081 | + let classIds = [] | |
| 1069 | 1082 | let tableData = []; |
| 1070 | - this.tableData = (data?.list && [...data?.list]) || []; | |
| 1071 | - data?.list.map((item) => { | |
| 1072 | - let idx = query.classIds.indexOf(item); | |
| 1083 | + data?.list?.map((item) => { | |
| 1084 | + if(!classIds.includes(item.classId)){ | |
| 1085 | + classIds.push(item.classId) | |
| 1086 | + } | |
| 1087 | + let idx = classIds.indexOf(item.classId); | |
| 1073 | 1088 | if (tableData[idx]) { |
| 1074 | 1089 | tableData[idx].push(item); |
| 1075 | 1090 | } else { |
| ... | ... | @@ -1205,6 +1220,8 @@ export default { |
| 1205 | 1220 | return; |
| 1206 | 1221 | } |
| 1207 | 1222 | } |
| 1223 | + query.classId = query.classIds[0]; | |
| 1224 | + delete query.classIds; | |
| 1208 | 1225 | const exportPhaseExamReport = |
| 1209 | 1226 | this.role == "ROLE_BANZHUREN" |
| 1210 | 1227 | ? this.$request.cTExportPhaseExamReport |
| ... | ... | @@ -1315,16 +1332,16 @@ div::-webkit-scrollbar-thumb { |
| 1315 | 1332 | display: flex; |
| 1316 | 1333 | flex-wrap: wrap; |
| 1317 | 1334 | .tab-li { |
| 1318 | - width: 50%; | |
| 1319 | - flex: 1; | |
| 1335 | + width: calc(50% - 12px); | |
| 1320 | 1336 | margin: 0 12px 12px 0; |
| 1321 | 1337 | &:nth-child(2n) { |
| 1322 | 1338 | margin-right: 0; |
| 1323 | 1339 | } |
| 1324 | 1340 | .tab-tit { |
| 1325 | - width: 100%; | |
| 1341 | + font-size: 15px; | |
| 1326 | 1342 | line-height: 40px; |
| 1327 | 1343 | border: 1px solid #ebeef5; |
| 1344 | + padding-left: 12px; | |
| 1328 | 1345 | } |
| 1329 | 1346 | } |
| 1330 | 1347 | } | ... | ... |