Commit d3ca55ac5f419d120eb3160057afd4fdbd2efea0

Authored by 梁保满
1 parent fcb9ef36

等级设置

package.json
... ... @@ -20,7 +20,6 @@
20 20 "script-ext-html-webpack-plugin": "^2.1.5",
21 21 "vue": "^2.6.11",
22 22 "vue-i18n": "^8.4.0",
23   - "vue-masonry": "^0.16.0",
24 23 "vue-router": "^3.5.1",
25 24 "vuedraggable": "^2.24.3",
26 25 "vuex": "^3.6.2"
... ...
src/main.js
... ... @@ -20,13 +20,11 @@ import "@/router/permission"
20 20 import "@/assets/css/base.css"
21 21 import "@/assets/css/index.scss"
22 22  
23   -import { VueMasonryPlugin } from 'vue-masonry'
24 23  
25 24 Vue.config.productionTip = false
26 25 Vue.use(ElementUI)
27 26 Vue.use(globalPlugin)
28 27 Vue.use(permission)
29   -Vue.use(VueMasonryPlugin)
30 28  
31 29 NProgress.inc(0.2)
32 30 NProgress.configure({ easing: "ease", speed: 500, showSpinner: false })
... ...
src/views/standard/test/contrast.vue
... ... @@ -8,40 +8,15 @@
8 8 <div class="page-content">
9 9 <div class="content-header">
10 10 <div class="tab-box">
11   - <span
12   - v-for="(item, index) in tabList"
13   - :key="item"
14   - class="tab-item"
15   - :class="type == index ? 'active' : ''"
16   - @click="setType(index)"
17   - >{{ item }}</span
18   - >
  11 + <span v-for="(item, index) in tabList" :key="item" class="tab-item" :class="type == index ? 'active' : ''"
  12 + @click="setType(index)">{{ item }}</span>
19 13 </div>
20   - <el-button class="setMinScore" @click="openDia" round size="small"
21   - >对比成绩等级设置</el-button
22   - >
  14 + <el-button class="setMinScore" @click="openDia" round size="small">对比成绩等级设置</el-button>
23 15 </div>
24 16 <div id="print-content" class="table-box" v-loading="loading">
25   - <el-table
26   - :max-height="tableMaxHeight"
27   - v-show="type == 0"
28   - :data="tableData"
29   - border
30   - style="width: 100%"
31   - >
32   - <el-table-column
33   - type="index"
34   - label="序号"
35   - fixed
36   - align="center"
37   - width="60"
38   - ></el-table-column>
39   - <el-table-column
40   - prop="className"
41   - label="班级"
42   - align="center"
43   - fixed
44   - ></el-table-column>
  17 + <el-table :max-height="tableMaxHeight" v-show="type == 0" :data="tableData" border style="width: 100%">
  18 + <el-table-column type="index" label="序号" fixed align="center" width="60"></el-table-column>
  19 + <el-table-column prop="className" label="班级" align="center" fixed></el-table-column>
45 20 <el-table-column label="测验人数/班级人数" align="center" width="84">
46 21 <template slot-scope="scope">
47 22 <p v-for="(item, index) in scope.row.count.split('/')">
... ... @@ -49,113 +24,39 @@
49 24 </p>
50 25 </template>
51 26 </el-table-column>
52   - <el-table-column
53   - prop="percent"
54   - label="参与度"
55   - align="center"
56   - ></el-table-column>
57   - <el-table-column
58   - prop="avg"
59   - label="班平均分"
60   - align="center"
61   - ></el-table-column>
62   - <el-table-column
63   - prop="max"
64   - label="班最高分"
65   - sortable
66   - align="center"
67   - ></el-table-column>
68   - <el-table-column
69   - prop="min"
70   - label="班最低分"
71   - sortable
72   - align="center"
73   - ></el-table-column>
74   -
75   - <el-table-column
76   - v-for="(item, index) in defaultLevels.levels"
77   - :label="item[0] + '数(率)'"
78   - align="center"
79   - ><template slot-scope="scoped">
  27 + <el-table-column prop="percent" label="参与度" align="center"></el-table-column>
  28 + <el-table-column prop="avg" label="班平均分" align="center"></el-table-column>
  29 + <el-table-column prop="max" label="班最高分" sortable align="center"></el-table-column>
  30 + <el-table-column prop="min" label="班最低分" sortable align="center"></el-table-column>
  31 +
  32 + <el-table-column v-for="(item, index) in defaultLevels.levels" :label="item[0] + '数(率)'"
  33 + align="center"><template slot-scope="scoped">
80 34 <p class="p1">{{ scoped.row.levels[index].people }}</p>
81 35 <p class="p1">({{ scoped.row.levels[index].percent }})</p>
82   - </template></el-table-column
83   - >
  36 + </template></el-table-column>
84 37 </el-table>
85   - <el-table
86   - v-show="type == 1"
87   - :max-height="tableMaxHeight"
88   - :data="tableData2"
89   - border
90   - style="width: 100%"
91   - >
92   - <el-table-column
93   - prop="rank"
94   - label="排名"
95   - sortable
96   - align="center"
97   - ></el-table-column>
98   - <el-table-column
99   - prop="name"
100   - label="姓名"
101   - align="center"
102   - ></el-table-column>
103   - <el-table-column
104   - prop="className"
105   - label="班级"
106   - align="center"
107   - ></el-table-column>
108   - <el-table-column
109   - prop="score"
110   - label="总分"
111   - sortable
112   - align="center"
113   - ></el-table-column>
114   - <el-table-column
115   - prop="levelName"
116   - label="成绩等级"
117   - align="center"
118   - ></el-table-column>
  38 + <el-table v-show="type == 1" :max-height="tableMaxHeight" :data="tableData2" border style="width: 100%">
  39 + <el-table-column prop="rank" label="排名" sortable align="center"></el-table-column>
  40 + <el-table-column prop="name" label="姓名" align="center"></el-table-column>
  41 + <el-table-column prop="className" label="班级" align="center"></el-table-column>
  42 + <el-table-column prop="score" label="总分" sortable align="center"></el-table-column>
  43 + <el-table-column prop="levelName" label="成绩等级" align="center"></el-table-column>
119 44 </el-table>
120 45 </div>
121 46 <div class="down">
122 47 <div>
123   - <el-button
124   - v-loading="exportLoading"
125   - @click="exportData"
126   - type="primary"
127   - plain
128   - round
129   - icon="fa fa-cloud-download"
130   - >导出报表</el-button
131   - >
132   - <el-button
133   - v-if="!this.$store.getters.code"
134   - @click="print"
135   - type="primary"
136   - plain
137   - round
138   - icon="el-icon-printer"
139   - >打印</el-button
140   - >
  48 + <el-button v-loading="exportLoading" @click="exportData" type="primary" plain round
  49 + icon="fa fa-cloud-download">导出报表</el-button>
  50 + <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round
  51 + icon="el-icon-printer">打印</el-button>
141 52 </div>
142 53 </div>
143 54  
144   - <el-dialog
145   - :close-on-click-modal="false"
146   - title="等级设置"
147   - :visible.sync="diaLogBox"
148   - width="800px"
149   - @closed="closeDia"
150   - >
  55 + <el-dialog :close-on-click-modal="false" title="等级设置" :visible.sync="diaLogBox" width="800px" @closed="closeDia">
151 56 <el-form class="use-form">
152 57 <el-form-item class="use-form-item-box">
153 58 <el-form-item label="等级名称:" class="use-form-item">
154   - <el-select
155   - size="small"
156   - v-model="fromData.type"
157   - @change="changeType"
158   - >
  59 + <el-select size="small" v-model="fromData.type" @change="changeType">
159 60 <el-option label="优良合格不合格" :value="0"></el-option>
160 61 <el-option label="ABCD" :value="1"></el-option>
161 62 <el-option label="自定义" :value="2"></el-option>
... ... @@ -177,47 +78,29 @@
177 78 <span class="item3"><i>*</i>等级最低</span>
178 79 <span class="item"></span>
179 80 </p>
180   - <div
181   - class="dia-tab-item"
182   - v-for="(item, index) in fromData.levels"
183   - >
  81 + <div class="dia-tab-item" v-for="(item, index) in fromData.levels">
184 82 <span class="item1">{{ index + 1 }}</span>
185 83 <p class="item2">
186   - <el-input
187   - class="score-ipt"
188   - v-model="item[0]"
189   - :maxlength="12"
190   - @keydown.native="keydownRange($event)"
191   - ></el-input>
  84 + <el-input class="score-ipt" v-model="item[0]" :maxlength="12"
  85 + @keydown.native="keydownRange($event)"></el-input>
192 86 </p>
193 87 <p class="item3">
194   - <el-input
195   - class="score-ipt"
196   - type="number"
197   - v-model="item[1]"
198   - :min="item[2]"
  88 + <el-input class="score-ipt" type="number" v-model="item[1]" :min="item[2]"
199 89 :max="index == 0 ? 100 : fromData.levels[index - 1][2]"
200   - @keydown.native="keydownRange($event)"
201   - ></el-input>
  90 + @keydown.native="keydownRange($event)"></el-input>
202 91 %
203 92 <template v-if="fromData.levelType == 0">
204 93 ({{ index != 0 ? "不含" : ""
205 94 }}{{
206   - Number(((item[1] / 100) * examPaperScore).toFixed(1))
207   - }}分)
  95 + Number(((item[1] / 100) * examPaperScore).toFixed(1))
  96 +}}分)
208 97 </template>
209 98 <template v-else>{{ index != 0 ? "不含" : "" }}</template>
210 99 </p>
211 100 <p>~</p>
212 101 <p class="item3">
213   - <el-input
214   - class="score-ipt"
215   - type="number"
216   - v-model="item[2]"
217   - :min="0"
218   - :max="item[1]"
219   - @keydown.native="keydownRange($event)"
220   - ></el-input>
  102 + <el-input class="score-ipt" type="number" v-model="item[2]" :min="0" :max="item[1]"
  103 + @keydown.native="keydownRange($event)"></el-input>
221 104 %
222 105 <template v-if="fromData.levelType == 0">
223 106 ({{
... ... @@ -226,23 +109,12 @@
226 109 </template>
227 110 </p>
228 111 <p class="item">
229   - <el-link
230   - type="danger"
231   - :underline="false"
232   - @click="fromData.levels.splice(index, 1)"
233   - >删除</el-link
234   - >
  112 + <el-link type="danger" :underline="false" @click="fromData.levels.splice(index, 1)">删除</el-link>
235 113 </p>
236 114 </div>
237 115 <div class="add">
238 116 <p @click="fromData.levels.push(['', '', ''])">
239   - <el-button
240   - size="mini"
241   - icon="el-icon-plus"
242   - circle
243   - type="primary"
244   - ></el-button
245   - >添加一行
  117 + <el-button size="mini" icon="el-icon-plus" circle type="primary"></el-button>添加一行
246 118 </p>
247 119 </div>
248 120 </div>
... ... @@ -293,8 +165,9 @@ export default {
293 165 },
294 166 async created() {
295 167 this.ids = this.$route.query.ids;
296   - await this._QueryData();
  168 + this.examPaperScore = Number(this.$route.query.examPaperScore || 100);
297 169 await this._QueryDefaultLevels();
  170 + await this._QueryData();
298 171 },
299 172 destroyed() {
300 173 sessionStorage.setItem("levelFromData", "");
... ... @@ -416,19 +289,17 @@ export default {
416 289 this.$message.error(info);
417 290 }
418 291 },
419   - async _QueryData(params) {
  292 + async _QueryData() {
420 293 let query = {};
421   - if (params) {
422   - let paramObj = JSON.parse(JSON.stringify(params))
423   - if (paramObj.levelType == 0) {
424   - paramObj.levels = paramObj.levels.map((item) => {
425   - item[1] = ((item[1] / 100) * this.examPaperScore).toFixed(1);
426   - item[2] = ((item[2] / 100) * this.examPaperScore).toFixed(1);
427   - return item;
428   - });
429   - }
430   - query = { ...paramObj };
  294 + let paramObj = JSON.parse(JSON.stringify(this.fromData))
  295 + if (paramObj.levelType == 0) {
  296 + paramObj.levels = paramObj.levels.map((item) => {
  297 + item[1] = ((item[1] / 100) * this.examPaperScore).toFixed(1);
  298 + item[2] = ((item[2] / 100) * this.examPaperScore).toFixed(1);
  299 + return item;
  300 + });
431 301 }
  302 + query = { ...paramObj };
432 303 const { data, info, status } = await this.$request.examMultiClassReport({
433 304 examIds: this.ids,
434 305 ...query,
... ... @@ -455,7 +326,6 @@ export default {
455 326 let params = { ...this.fromData };
456 327 if (params.levelType == 0) {
457 328 params.levels = params.levels.map((item) => {
458   - console.log(item);
459 329 item[1] = ((item[1] / 100) * this.examPaperScore).toFixed(1);
460 330 item[2] = ((item[2] / 100) * this.examPaperScore).toFixed(1);
461 331 return item;
... ... @@ -487,25 +357,31 @@ export default {
487 357 .page-container {
488 358 position: relative;
489 359 height: 100%;
  360 +
490 361 .table-box {
491 362 min-height: 100%;
492 363 }
  364 +
493 365 &.active {
494 366 overflow: hidden;
495 367 }
  368 +
496 369 .content-header {
497 370 width: 100%;
498 371 position: relative;
  372 +
499 373 .setMinScore {
500 374 position: absolute;
501 375 bottom: 0;
502 376 right: 0;
503 377 }
504 378 }
  379 +
505 380 .page-content {
506 381 padding: 20px 20px 0;
507 382 }
508 383 }
  384 +
509 385 .tab-box {
510 386 width: 400px;
511 387 margin: 0 auto 12px;
... ... @@ -513,6 +389,7 @@ export default {
513 389 border-radius: 20px;
514 390 display: flex;
515 391 user-select: none;
  392 +
516 393 .tab-item {
517 394 flex: 1;
518 395 height: 40px;
... ... @@ -524,72 +401,91 @@ export default {
524 401 background: transparent;
525 402 border-radius: 20px;
526 403 cursor: pointer;
  404 +
527 405 &.active {
528 406 background: #667ffd;
529 407 color: #fff;
530 408 }
531 409 }
532 410 }
  411 +
533 412 .down {
534 413 padding-top: 20px;
535 414 width: 100%;
536 415 display: flex;
537 416 justify-content: space-between;
538 417 }
  418 +
539 419 .use-form {
540 420 padding: 0 12px;
  421 +
541 422 .use-form-item-box {
542 423 :deep(.el-form-item__content) {
543 424 display: flex;
544 425 }
  426 +
545 427 .use-form-item {
546 428 width: 40%;
547 429 margin-right: 20px;
548 430 }
549 431 }
550 432 }
  433 +
551 434 .dia-tab-box {
  435 +
552 436 .dia-tab-tit,
553 437 .dia-tab-item {
554 438 margin-bottom: 10px;
  439 +
555 440 i {
556 441 color: #f30;
557 442 padding-right: 5px;
558 443 }
  444 +
559 445 display: flex;
  446 +
560 447 .item {
561 448 width: 40px;
562 449 }
  450 +
563 451 .item1 {
564 452 padding-left: 10px;
565 453 width: 10%;
566 454 }
  455 +
567 456 .item2 {
568 457 width: 18%;
569 458 }
  459 +
570 460 .item3 {
571 461 padding-left: 12px;
572 462 flex: 1;
573 463 }
  464 +
574 465 .score-ipt {
575 466 width: 100px;
576 467 }
577 468 }
  469 +
578 470 .dia-tab-tit {
579 471 background: rgba(243, 243, 243, 1);
580 472 }
  473 +
581 474 .add {
582 475 display: flex;
583 476 justify-content: center;
584 477 margin: 0 auto;
  478 +
585 479 p {
586 480 cursor: pointer;
587 481 }
  482 +
588 483 .el-button {
589 484 margin-right: 6px;
590 485 }
591 486 }
592 487 }
  488 +
593 489 .p1 {
594 490 line-height: 18px;
595 491 }
... ...
src/views/standard/test/index.vue
... ... @@ -5,122 +5,51 @@
5 5 <span>即时测-数据报表</span>
6 6 </template>
7 7 <template slot="btns">
8   - <el-tooltip
9   - v-if="!code && gdClass"
10   - effect="dark"
11   - content="已归档试卷"
12   - placement="bottom"
13   - >
14   - <el-button
15   - type="primary"
16   - icon="fa fa-archive"
17   - size="mini"
18   - plain
19   - circle
20   - @click="toArchiving"
21   - ></el-button>
  8 + <el-tooltip v-if="!code && gdClass" effect="dark" content="已归档试卷" placement="bottom">
  9 + <el-button type="primary" icon="fa fa-archive" size="mini" plain circle @click="toArchiving"></el-button>
22 10 </el-tooltip>
23 11 </template>
24 12 </back-box>
25 13 <div class="answer-header">
26 14 <div class="sel-box">
27   - <el-select
28   - class="sel"
29   - v-model="query.classIds"
30   - placeholder="选择班级"
31   - @change="changeclass"
32   - multiple
33   - collapse-tags
34   - >
  15 + <el-select class="sel" v-model="query.classIds" placeholder="选择班级" @change="changeclass" multiple collapse-tags>
35 16 <p class="select-all">
36   - <el-checkbox v-model="classAll" @change="selectAll"
37   - >全选</el-checkbox
38   - >
  17 + <el-checkbox v-model="classAll" @change="selectAll">全选</el-checkbox>
39 18 </p>
40   - <el-option
41   - :disabled="
42   - query.classIds.length == 1 && query.classIds[0] == item.value
43   - "
44   - v-for="item in classList"
45   - :key="item.value"
46   - :label="item.label"
47   - :value="item.value"
48   - >
  19 + <el-option :disabled="query.classIds.length == 1 && query.classIds[0] == item.value
  20 + " v-for="item in classList" :key="item.value" :label="item.label" :value="item.value">
49 21 </el-option>
50 22 </el-select>
51   - <el-select
52   - v-if="role == 'ROLE_BANZHUREN'"
53   - class="sel sel2"
54   - multiple
55   - v-model="query.subjectNames"
56   - placeholder="选择科目"
57   - @change="changeSub"
58   - >
59   - <el-option
60   - v-for="item in subjectList"
61   - :key="item.value"
62   - :label="item.label"
63   - :value="item.value"
64   - >
  23 + <el-select v-if="role == 'ROLE_BANZHUREN'" class="sel sel2" multiple v-model="query.subjectNames"
  24 + placeholder="选择科目" @change="changeSub">
  25 + <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">
65 26 </el-option>
66 27 </el-select>
67   - <el-select
68   - v-else
69   - class="sel sel2"
70   - v-model="query.subjectNames"
71   - placeholder="选择科目"
72   - >
73   - <el-option
74   - v-for="item in subjectList"
75   - :key="item.value"
76   - :label="item.label"
77   - :value="item.value"
78   - >
  28 + <el-select v-else class="sel sel2" v-model="query.subjectNames" placeholder="选择科目">
  29 + <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">
79 30 </el-option>
80 31 </el-select>
81 32 <div class="d1">
82   - <el-date-picker
83   - v-model="query.startDay"
84   - type="date"
85   - @change="handleChangeTimeStart"
86   - placeholder="选择日期时间"
87   - value-format="yyyy-MM-dd"
88   - >
  33 + <el-date-picker v-model="query.startDay" type="date" @change="handleChangeTimeStart" placeholder="选择日期时间"
  34 + value-format="yyyy-MM-dd">
89 35 </el-date-picker>
90 36 ~
91   - <el-date-picker
92   - v-model="query.endDay"
93   - type="date"
94   - placeholder="选择日期时间"
95   - @change="handleChangeTimeEnd"
96   - value-format="yyyy-MM-dd"
97   - >
  37 + <el-date-picker v-model="query.endDay" type="date" placeholder="选择日期时间" @change="handleChangeTimeEnd"
  38 + value-format="yyyy-MM-dd">
98 39 </el-date-picker>
99 40 </div>
100 41 <p class="p1">
101   - <span @click="setDate(1)" :class="[date == 1 ? 'active' : '', 's1']"
102   - >今天</span
103   - >
104   - <span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']"
105   - >本周</span
106   - >
107   - <span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']"
108   - >本月</span
109   - >
110   - <span @click="setDate(4)" :class="[date == 4 ? 'active' : '', 's1']"
111   - >本季度</span
112   - >
  42 + <span @click="setDate(1)" :class="[date == 1 ? 'active' : '', 's1']">今天</span>
  43 + <span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']">本周</span>
  44 + <span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']">本月</span>
  45 + <span @click="setDate(4)" :class="[date == 4 ? 'active' : '', 's1']">本季度</span>
113 46 </p>
114 47 <el-button type="primary" round @click="_QueryData()">筛选</el-button>
115 48 </div>
116 49 </div>
117 50 <div v-show="query.classIds.length == 1" class="table-box">
118   - <el-radio-group
119   - v-if="query.startDay != query.endDay"
120   - v-model="tabIndex"
121   - @change="changeTab"
122   - style="margin-bottom: 20px"
123   - >
  51 + <el-radio-group v-if="query.startDay != query.endDay" v-model="tabIndex" @change="changeTab"
  52 + style="margin-bottom: 20px">
124 53 <template v-for="(item, index) in tabList">
125 54 <el-radio-button :label="index + 1">{{ item }}</el-radio-button>
126 55 </template>
... ... @@ -132,50 +61,15 @@
132 61 </div>
133 62 <div v-show="tabIndex == 1" v-loading="loading">
134 63 <el-table :data="tableData" border style="width: 100%">
135   - <el-table-column
136   - prop="subjectName"
137   - label="科目"
138   - align="center"
139   - width="100"
140   - ></el-table-column>
141   - <el-table-column
142   - prop="title"
143   - label="试卷名称"
144   - align="center"
145   - ></el-table-column>
146   - <el-table-column
147   - prop="className"
148   - label="考试班级"
149   - align="center"
150   - width="100"
151   - ></el-table-column>
152   - <el-table-column
153   - prop="examPaperScore"
154   - label="卷面分"
155   - align="center"
156   - width="68"
157   - ></el-table-column>
158   - <el-table-column
159   - width="80"
160   - prop="answeredNum"
161   - label="测验人数"
162   - align="center"
163   - ><template slot-scope="scoped">{{
164   - `${scoped.row.answeredNum}/${scoped.row.classPersonNum}`
165   - }}</template></el-table-column
166   - >
167   - <el-table-column
168   - prop="examStartTime"
169   - label="测验开始时间"
170   - width="160"
171   - align="center"
172   - ></el-table-column>
173   - <el-table-column
174   - prop="examEndTime"
175   - label="测验结束时间"
176   - width="160"
177   - align="center"
178   - ></el-table-column>
  64 + <el-table-column prop="subjectName" label="科目" align="center" width="100"></el-table-column>
  65 + <el-table-column prop="title" label="试卷名称" align="center"></el-table-column>
  66 + <el-table-column prop="className" label="考试班级" align="center" width="100"></el-table-column>
  67 + <el-table-column prop="examPaperScore" label="卷面分" align="center" width="68"></el-table-column>
  68 + <el-table-column width="80" prop="answeredNum" label="测验人数" align="center"><template slot-scope="scoped">{{
  69 + `${scoped.row.answeredNum}/${scoped.row.classPersonNum}`
  70 + }}</template></el-table-column>
  71 + <el-table-column prop="examStartTime" label="测验开始时间" width="160" align="center"></el-table-column>
  72 + <el-table-column prop="examEndTime" label="测验结束时间" width="160" align="center"></el-table-column>
179 73 <!-- 添加对比删除 -->
180 74 <!-- <el-table-column prop="avgScore" label="班平均分" align="center"
181 75 ><template slot-scope="scoped">{{
... ... @@ -306,324 +200,134 @@
306 200 > -->
307 201 <el-table-column label="操作" width="100" align="center">
308 202 <template slot-scope="scoped">
309   - <el-tooltip
310   - v-if="
311   - scoped.row.answerNum != 0 ||
  203 + <el-tooltip v-if="scoped.row.answerNum != 0 ||
312 204 (scoped.row.recordStatus != 0 &&
313 205 scoped.row.subjectiveScore == scoped.row.examPaperScore)
314   - "
315   - effect="dark"
316   - content="详情"
317   - placement="top"
318   - >
319   - <el-button
320   - type="primary"
321   - circle
322   - size="mini"
323   - icon="fa fa-arrow-right"
324   - @click="linkTo(scoped.row)"
325   - ></el-button>
  206 + " effect="dark" content="详情" placement="top">
  207 + <el-button type="primary" circle size="mini" icon="fa fa-arrow-right"
  208 + @click="linkTo(scoped.row)"></el-button>
326 209 </el-tooltip>
327   - <template
328   - v-if="
329   - scoped.row.answerNum == 0 &&
330   - scoped.row.subjectiveScore != scoped.row.examPaperScore
331   - "
332   - >
333   - <el-tooltip
334   - v-if="role == 'ROLE_JIAOSHI'"
335   - effect="dark"
336   - content="设置答案"
337   - placement="top"
338   - >
339   - <el-button
340   - type="primary"
341   - circle
342   - size="mini"
343   - icon="fa fa-file-text"
344   - @click="edit(scoped.row)"
345   - ></el-button>
  210 + <template v-if="scoped.row.answerNum == 0 &&
  211 + scoped.row.subjectiveScore != scoped.row.examPaperScore
  212 + ">
  213 + <el-tooltip v-if="role == 'ROLE_JIAOSHI'" effect="dark" content="设置答案" placement="top">
  214 + <el-button type="primary" circle size="mini" icon="fa fa-file-text"
  215 + @click="edit(scoped.row)"></el-button>
346 216 </el-tooltip>
347 217 <template v-else>未设置答案</template>
348 218 </template>
349   - <el-tooltip
350   - v-if="
351   - scoped.row.subjectiveScore == scoped.row.examPaperScore &&
352   - scoped.row.recordStatus == 0
353   - "
354   - effect="dark"
355   - content="导入主观题"
356   - placement="top"
357   - >
358   - <el-button
359   - type="primary"
360   - circle
361   - size="mini"
362   - icon="fa fa-cloud"
363   - @click="uploadSJ(scoped.row)"
364   - ></el-button>
  219 + <el-tooltip v-if="scoped.row.subjectiveScore == scoped.row.examPaperScore &&
  220 + scoped.row.recordStatus == 0
  221 + " effect="dark" content="导入主观题" placement="top">
  222 + <el-button type="primary" circle size="mini" icon="fa fa-cloud" @click="uploadSJ(scoped.row)"></el-button>
365 223 </el-tooltip>
366   - <el-popconfirm
367   - v-if="role != 'ROLE_BANZHUREN'"
368   - title="确定删除吗?"
369   - @confirm="removeReport(scoped.row, scoped.$index)"
370   - >
371   - <el-button
372   - class="remove-test"
373   - slot="reference"
374   - type="danger"
375   - circle
376   - size="mini"
377   - icon="el-icon-delete"
378   - :loading="scoped.row.loading"
379   - ></el-button>
  224 + <el-popconfirm v-if="role != 'ROLE_BANZHUREN'" title="确定删除吗?"
  225 + @confirm="removeReport(scoped.row, scoped.$index)">
  226 + <el-button class="remove-test" slot="reference" type="danger" circle size="mini" icon="el-icon-delete"
  227 + :loading="scoped.row.loading"></el-button>
380 228 </el-popconfirm>
381 229 </template>
382 230 </el-table-column>
383 231 </el-table>
384 232 <div class="pagination-box">
385   - <el-pagination
386   - small=""
387   - layout="total,prev, pager, next"
388   - :hide-on-single-page="true"
389   - :total="total"
390   - @current-change="changePage"
391   - :current-page="page"
392   - :page-size="size"
393   - >
  233 + <el-pagination small="" layout="total,prev, pager, next" :hide-on-single-page="true" :total="total"
  234 + @current-change="changePage" :current-page="page" :page-size="size">
394 235 </el-pagination>
395 236 </div>
396 237 </div>
397 238 <div v-show="tabIndex == 2" v-loading="loading">
398   - <el-empty
399   - :image-size="100"
400   - v-if="!tableData.length && loading == false"
401   - description="没有更多数据"
402   - ></el-empty>
  239 + <el-empty :image-size="100" v-if="!tableData.length && loading == false" description="没有更多数据"></el-empty>
403 240 <template v-if="tableData.length && loading == false">
404 241 <div id="print-content">
405   - <el-table
406   - :max-height="tableMaxHeight"
407   - v-if="role == 'ROLE_JIAOSHI'"
408   - :data="tableData"
409   - border
410   - style="width: 100%"
411   - >
412   - <el-table-column
413   - prop="studentCode"
414   - label="学号"
415   - align="center"
416   - fixed
417   - ></el-table-column>
418   - <el-table-column
419   - prop="studentName"
420   - label="姓名"
421   - fixed
422   - align="center"
423   - >
424   - <template slot-scope="scoped"
425   - ><span class="click-b" @click="toPortrait(scoped.row)">
  242 + <el-table :max-height="tableMaxHeight" v-if="role == 'ROLE_JIAOSHI'" :data="tableData" border
  243 + style="width: 100%">
  244 + <el-table-column prop="studentCode" label="学号" align="center" fixed></el-table-column>
  245 + <el-table-column prop="studentName" label="姓名" fixed align="center">
  246 + <template slot-scope="scoped"><span class="click-b" @click="toPortrait(scoped.row)">
426 247 {{ scoped.row.studentName }}
427   - </span></template
428   - ></el-table-column
429   - >
430   - <el-table-column
431   - align="center"
432   - v-for="(item, index) in answerList"
433   - :key="index"
434   - :label="item.title"
435   - >
436   - <el-table-column
437   - :prop="'score' + index"
438   - :label="index == 0 ? '总分' : '成绩'"
439   - align="center"
440   - :class-name="index % 2 == 0 ? 'bg' : ''"
441   - >
  248 + </span></template></el-table-column>
  249 + <el-table-column align="center" v-for="(item, index) in answerList" :key="index" :label="item.title">
  250 + <el-table-column :prop="'score' + index" :label="index == 0 ? '总分' : '成绩'" align="center"
  251 + :class-name="index % 2 == 0 ? 'bg' : ''">
442 252 <template slot-scope="scoped">
443 253 {{ Number(scoped.row["score" + index]) }}
444   - </template></el-table-column
445   - >
446   - <el-table-column
447   - :prop="'classRank' + index"
448   - label="班名"
449   - align="center"
450   - :class-name="index % 2 == 0 ? 'bg' : ''"
451   - ></el-table-column>
  254 + </template></el-table-column>
  255 + <el-table-column :prop="'classRank' + index" label="班名" align="center"
  256 + :class-name="index % 2 == 0 ? 'bg' : ''"></el-table-column>
452 257 </el-table-column>
453 258 </el-table>
454   - <el-table
455   - v-else
456   - :data="tableData"
457   - :max-height="tableMaxHeight"
458   - border
459   - style="width: 100%"
460   - >
461   - <el-table-column
462   - prop="studentCode"
463   - label="学号"
464   - align="center"
465   - fixed
466   - ></el-table-column>
  259 + <el-table v-else :data="tableData" :max-height="tableMaxHeight" border style="width: 100%">
  260 + <el-table-column prop="studentCode" label="学号" align="center" fixed></el-table-column>
467 261  
468   - <el-table-column
469   - prop="studentName"
470   - label="姓名"
471   - fixed
472   - align="center"
473   - >
474   - <template slot-scope="scoped"
475   - ><span class="click-b" @click="toPortrait(scoped.row)">
  262 + <el-table-column prop="studentName" label="姓名" fixed align="center">
  263 + <template slot-scope="scoped"><span class="click-b" @click="toPortrait(scoped.row)">
476 264 {{ scoped.row.studentName }}
477   - </span></template
478   - >
  265 + </span></template>
479 266 </el-table-column>
480   - <el-table-column
481   - align="center"
482   - v-for="(item, index) in answerList"
483   - :key="index"
484   - :label="item"
485   - >
486   - <el-table-column
487   - :prop="'examCount' + item"
488   - label="测练数"
489   - align="center"
490   - :class-name="index % 2 == 0 ? 'bg' : ''"
491   - ></el-table-column>
492   - <el-table-column
493   - :prop="'participationCount' + item"
494   - label="参与数"
495   - align="center"
496   - :class-name="index % 2 == 0 ? 'bg' : ''"
497   - ></el-table-column>
498   - <el-table-column
499   - :prop="'score' + item"
500   - label="总分"
501   - align="center"
502   - :class-name="index % 2 == 0 ? 'bg' : ''"
503   - ></el-table-column>
504   - <el-table-column
505   - :prop="'classRank' + item"
506   - label="班名"
507   - align="center"
508   - :class-name="index % 2 == 0 ? 'bg' : ''"
509   - ></el-table-column>
  267 + <el-table-column align="center" v-for="(item, index) in answerList" :key="index" :label="item">
  268 + <el-table-column :prop="'examCount' + item" label="测练数" align="center"
  269 + :class-name="index % 2 == 0 ? 'bg' : ''"></el-table-column>
  270 + <el-table-column :prop="'participationCount' + item" label="参与数" align="center"
  271 + :class-name="index % 2 == 0 ? 'bg' : ''"></el-table-column>
  272 + <el-table-column :prop="'score' + item" label="总分" align="center"
  273 + :class-name="index % 2 == 0 ? 'bg' : ''"></el-table-column>
  274 + <el-table-column :prop="'classRank' + item" label="班名" align="center"
  275 + :class-name="index % 2 == 0 ? 'bg' : ''"></el-table-column>
510 276 </el-table-column>
511 277 </el-table>
512 278 </div>
513 279 </template>
514 280 </div>
515 281 <p class="down" v-if="tabIndex == 2 && tableData.length">
516   - <el-button
517   - type="primary"
518   - plain
519   - round
520   - icon="fa fa-cloud-download"
521   - @click="downExl"
522   - >导出报表</el-button
523   - >
524   - <el-button
525   - v-if="!this.$store.getters.code"
526   - @click="print"
527   - type="primary"
528   - plain
529   - round
530   - icon="el-icon-printer"
531   - >打印</el-button
532   - >
  282 + <el-button type="primary" plain round icon="fa fa-cloud-download" @click="downExl">导出报表</el-button>
  283 + <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round
  284 + icon="el-icon-printer">打印</el-button>
533 285 </p>
534 286 </div>
535   - <div
536   - v-show="query.classIds.length > 1"
537   - class="table-box"
538   - v-loading="loading"
539   - >
  287 + <div v-show="query.classIds.length > 1" class="table-box" v-loading="loading">
540 288 <div class="head-box">
541 289 <div class="tit">
542 290 <p class="txt">
543 291 已考试卷信息
544   - <em class="red"
545   - >(相同报表名称后的数字代表同一份试卷的考试次数,例如:模拟卷_1指模拟卷第1次考试成绩,模拟卷_2指模拟卷第2次考试成绩)</em
546   - >
  292 + <em class="red">(相同报表名称后的数字代表同一份试卷的考试次数,例如:模拟卷_1指模拟卷第1次考试成绩,模拟卷_2指模拟卷第2次考试成绩)</em>
547 293 </p>
548 294 <p>
549   - 共筛选出{{ classTable.length }}个班级的已考试卷,<em class="red"
550   - >不同班级请选择同一份试卷进行对比</em
551   - >
  295 + 共筛选出{{ classTable.length }}个班级的已考试卷,<em class="red">不同班级请选择同一份试卷进行对比</em>
552 296 </p>
553 297 </div>
554   - <el-input
555   - placeholder="输入试卷名称"
556   - v-model="examReportName"
557   - class="input-with-select"
558   - @keyup.enter.native="examReportList(examReportName)"
559   - >
560   - <el-button
561   - slot="append"
562   - icon="el-icon-search"
563   - @click="examReportList(examReportName)"
564   - ></el-button>
  298 + <el-input placeholder="输入试卷名称" v-model="examReportName" class="input-with-select"
  299 + @keyup.enter.native="examReportList(examReportName)">
  300 + <el-button slot="append" icon="el-icon-search" @click="examReportList(examReportName)"></el-button>
565 301 </el-input>
566 302 </div>
567   - <el-empty
568   - :imag-size="48"
569   - v-if="total === 0 && !loading"
570   - description="暂无数据"
571   - ></el-empty>
572   - <ul
573   - class="tab-ul"
574   - v-if="classTable.length"
575   - v-masonry
576   - transition-duration="0.5s"
577   - gutter="0"
578   - item-selector=".tab-li"
579   - >
  303 + <el-empty :imag-size="48" v-if="total === 0 && !loading" description="暂无数据"></el-empty>
  304 + <ul class="tab-ul" v-if="classTable.length" v-masonry transition-duration="0.5s" gutter="0" item-selector=".tab-li">
580 305 <template v-for="(item, index) in classTable">
581 306 <li class="tab-li">
582 307 <p class="tab-tit">
583 308 {{
584   - `${item[0].className} ${
585   - item.length ? "(" + item.length + "份已考试卷)" : ""
586   - }`
  309 + `${item[0].className} ${item.length ? "(" + item.length + "份已考试卷)" : ""
  310 + }`
587 311 }}
588 312 </p>
589   - <el-table
590   - :data="item"
591   - border
592   - style="width: 100%"
593   - v-if="item.length"
594   - >
  313 + <el-table :data="item" border style="width: 100%" v-if="item.length">
595 314 <el-table-column label="选择" align="center" width="60">
596 315 <template slot-scope="scope">
597   - <el-checkbox
598   - v-model="multipleSelection"
599   - :label="scope.row.id"
600   - :disabled="checkboxDisabled(scope.row)"
601   - >
602   - {{ ` ` }}</el-checkbox
603   - >
  316 + <el-checkbox v-model="multipleSelection" :label="scope.row.id" :disabled="checkboxDisabled(scope.row)">
  317 + {{ ` ` }}</el-checkbox>
604 318 </template>
605 319 </el-table-column>
606   - <el-table-column
607   - prop="title"
608   - label="报表名称"
609   - align="center"
610   - ></el-table-column>
  320 + <el-table-column prop="title" label="报表名称" align="center"></el-table-column>
611 321 <el-table-column label="测验人数" align="center" width="80">
612 322 <template slot-scope="scope">{{
613 323 `${scope.row.answeredNum}/${scope.row.classPersonNum}`
614 324 }}</template>
615 325 </el-table-column>
616   - <el-table-column
617   - prop="examStartTime"
618   - label="测验开始时间"
619   - width="120"
620   - align="center"
621   - ></el-table-column>
  326 + <el-table-column prop="examStartTime" label="测验开始时间" width="120" align="center"></el-table-column>
622 327 <el-table-column label="测验时长" align="center" width="80">
623 328 <template slot-scope="scope">{{
624   - `${Math.floor(scope.row.duration / 60)}分${
625   - scope.row.duration % 60
626   - }`
  329 + `${Math.floor(scope.row.duration / 60)}分${scope.row.duration % 60
  330 + }`
627 331 }}</template>
628 332 </el-table-column>
629 333 </el-table>
... ... @@ -635,19 +339,8 @@
635 339 <el-button @click="linkToContrast">生成对比报表</el-button>
636 340 </p>
637 341 </div>
638   - <el-dialog
639   - :close-on-click-modal="false"
640   - title="导入主观题分数"
641   - :visible.sync="diaUp"
642   - width="600"
643   - >
644   - <up-load
645   - :url="url"
646   - :examId="examId"
647   - @upSuccess="upSuccess"
648   - fileName="主观题分数"
649   - v-loading="loadingDown"
650   - >
  342 + <el-dialog :close-on-click-modal="false" title="导入主观题分数" :visible.sync="diaUp" width="600">
  343 + <up-load :url="url" :examId="examId" @upSuccess="upSuccess" fileName="主观题分数" v-loading="loadingDown">
651 344 <template slot="down">
652 345 <p class="down-txt">
653 346 第一步:下载模板并编辑完成学生分数
... ... @@ -814,11 +507,21 @@ export default {
814 507 this.$message.warning("请选择同一份试卷多个班级进行对比!");
815 508 return;
816 509 }
  510 + let examPaperScore
  511 + console.log(this.multipleSelection[0])
  512 + this.tableData.map(item => {
  513 + console.log(item.id)
  514 + if (item.id == this.multipleSelection[0]) {
  515 + examPaperScore = item.examPaperScore
  516 + }
  517 + })
  518 + console.log(examPaperScore)
817 519 this.$router.push({
818 520 path: "/testContrast",
819 521 query: {
820 522 ids: this.multipleSelection,
821 523 subjectNames: this.query.subjectNames,
  524 + examPaperScore: examPaperScore
822 525 },
823 526 });
824 527 },
... ... @@ -1302,6 +1005,7 @@ div::-webkit-scrollbar {
1302 1005 width: 3px;
1303 1006 height: 10px;
1304 1007 }
  1008 +
1305 1009 div::-webkit-scrollbar-thumb {
1306 1010 border-radius: 10px;
1307 1011 background-color: #ccc;
... ... @@ -1311,42 +1015,51 @@ div::-webkit-scrollbar-thumb {
1311 1015 .page-container {
1312 1016 position: relative;
1313 1017 height: 100%;
  1018 +
1314 1019 &.active {
1315 1020 overflow: hidden;
1316 1021 }
1317 1022 }
  1023 +
1318 1024 .table-box {
1319 1025 margin: 0 20px;
1320 1026 padding: 16px;
1321 1027 background: #f8f8f8;
1322 1028 border-radius: 5px;
1323 1029 min-height: 300px;
  1030 +
1324 1031 :deep(.fa-arrow-right) {
1325 1032 padding-left: 2px;
1326 1033 }
  1034 +
1327 1035 :deep(.fa-file-text) {
1328 1036 padding-left: 2px;
1329 1037 }
1330 1038 }
  1039 +
1331 1040 .down {
1332 1041 padding-top: 16px;
1333 1042 }
  1043 +
1334 1044 .click-b {
1335 1045 cursor: pointer;
1336 1046 color: #409eff;
1337 1047 text-decoration: underline;
1338 1048 }
  1049 +
1339 1050 .head-box {
1340 1051 display: flex;
1341 1052 justify-content: space-between;
1342 1053 font-size: 12px;
1343 1054 color: #999;
  1055 +
1344 1056 .txt {
1345 1057 font-size: 16px;
1346 1058 color: #333;
1347 1059 line-height: 20px;
1348 1060 position: relative;
1349 1061 margin-bottom: 6px;
  1062 +
1350 1063 &:after {
1351 1064 content: "";
1352 1065 position: absolute;
... ... @@ -1357,27 +1070,34 @@ div::-webkit-scrollbar-thumb {
1357 1070 background: #409eff;
1358 1071 }
1359 1072 }
  1073 +
1360 1074 .red {
1361 1075 font-style: normal;
1362 1076 font-size: 12px;
1363 1077 color: #f30;
1364 1078 }
  1079 +
1365 1080 .sel {
1366 1081 width: 200px;
  1082 +
1367 1083 :deep(.el-input__inner) {
1368 1084 border-radius: 20px;
1369 1085 }
1370 1086 }
1371 1087 }
  1088 +
1372 1089 .tab-ul {
1373 1090 display: flex;
1374 1091 flex-wrap: wrap;
  1092 +
1375 1093 .tab-li {
1376 1094 width: calc(50% - 12px);
1377 1095 margin: 0 12px 12px 0;
  1096 +
1378 1097 &:nth-child(2n) {
1379 1098 margin-right: 0;
1380 1099 }
  1100 +
1381 1101 .tab-tit {
1382 1102 font-size: 15px;
1383 1103 line-height: 40px;
... ... @@ -1386,13 +1106,16 @@ div::-webkit-scrollbar-thumb {
1386 1106 }
1387 1107 }
1388 1108 }
  1109 +
1389 1110 .btn-box {
1390 1111 padding-top: 12px;
1391 1112 text-align: right;
1392 1113 }
  1114 +
1393 1115 .remove-test {
1394 1116 margin-left: 10px;
1395 1117 }
  1118 +
1396 1119 .input-with-select {
1397 1120 width: 200px;
1398 1121 height: 36px;
... ... @@ -1401,6 +1124,7 @@ div::-webkit-scrollbar-thumb {
1401 1124 border: 1px solid #e2e2e2;
1402 1125 box-sizing: border-box;
1403 1126 background: #fff;
  1127 +
1404 1128 :deep(.el-input__inner) {
1405 1129 border-radius: 20px;
1406 1130 border: none;
... ... @@ -1408,6 +1132,7 @@ div::-webkit-scrollbar-thumb {
1408 1132 line-height: 34px;
1409 1133 padding-right: 0;
1410 1134 }
  1135 +
1411 1136 :deep(.el-button) {
1412 1137 padding: 12px;
1413 1138 }
... ... @@ -1418,6 +1143,7 @@ div::-webkit-scrollbar-thumb {
1418 1143 background: transparent;
1419 1144 }
1420 1145 }
  1146 +
1421 1147 .select-all {
1422 1148 padding-left: 16px;
1423 1149 padding-bottom: 10px;
... ...