f45b3c05
LH_PC
云平台新UI界面
|
1
2
3
|
<template>
<div style="margin-right: 20px;width: 100%">
<div v-if="status == 'select'">
|
ef16e57e
LH_PC
fix:前端版本迭代
|
4
|
<el-row class="row-type print-hidden">
|
f45b3c05
LH_PC
云平台新UI界面
|
5
6
7
8
9
10
11
|
<div style="float: right;">
<el-button type="primary" :disabled="multipleSelection.length < 1" class="opration-btn"
@click="handlerTotal">查看汇总报表</el-button>
</div>
</el-row>
<el-row class="row-table">
|
6bca489d
LH_PC
云平台二期UI
|
12
13
14
15
16
|
<el-table class="default-table" :data="$props.list" @selection-change="_tableSelectedChange">
<el-table-column type="selection" width="48" :selectable="_checkboxDisabled" />
<el-table-column prop="subjectName" label="科目" width="100"></el-table-column>
<el-table-column prop="className" label="班级" width="100"></el-table-column>
|
f45b3c05
LH_PC
云平台新UI界面
|
17
|
<el-table-column prop="title" label="试卷名称"></el-table-column>
|
6bca489d
LH_PC
云平台二期UI
|
18
19
|
<el-table-column prop="examPaperScore" label="卷面分" width="100"></el-table-column>
<el-table-column label="测验人数/班级人数" width="200">
|
f45b3c05
LH_PC
云平台新UI界面
|
20
21
22
23
|
<template slot-scope="scoped">
{{ `${scoped.row.answeredNum}/${scoped.row.classPersonNum}` }}
</template>
</el-table-column>
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
24
25
26
27
28
|
<el-table-column label="测验时长">
<template slot-scope="scoped">
{{ _formatTimeWithHours(scoped.row.duration) }}
</template>
</el-table-column>
|
f45b3c05
LH_PC
云平台新UI界面
|
29
30
31
32
33
34
|
</el-table>
</el-row>
</div>
<div v-if="status == 'selected'">
<el-container style="height: 100%;width: 100%;">
<el-main id="print-content">
|
ef16e57e
LH_PC
fix:前端版本迭代
|
35
|
<el-row class="row-type print-hidden">
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
36
37
|
<div style="float: left;">
<el-button @click="_backa">返回</el-button>
|
ef16e57e
LH_PC
fix:前端版本迭代
|
38
|
</div>
|
f45b3c05
LH_PC
云平台新UI界面
|
39
40
41
42
43
44
45
46
|
<div style="float: right;">
<el-button type="primary" @click="_import" class="opration-btn"
icon="el-icon-upload2">导出报表</el-button>
<el-button type="primary" @click="_print" class="opration-btn"
icon="el-icon-printer">打印报表</el-button>
</div>
</el-row>
<el-row class="row-table">
|
6bca489d
LH_PC
云平台二期UI
|
47
|
<el-table :data="selectedList" style="width: 100%" class="default-table">
|
f45b3c05
LH_PC
云平台新UI界面
|
48
49
50
51
52
53
54
55
56
57
58
|
<el-table-column prop="studentCode" label="学号" fixed></el-table-column>
<el-table-column prop="studentName" label="姓名" fixed>
<template slot-scope="scoped"><span class="click-b" @click="toPortrait(scoped.row)">
{{ scoped.row.studentName }}
</span></template>
</el-table-column>
<el-table-column v-for="(item, index) in answerList" :key="index" :label="item">
<el-table-column :prop="'examCount' + item" label="测练数"
:class-name="index % 2 == 0 ? 'bg' : ''">
<template slot-scope="scoped">{{
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
59
60
61
62
63
|
scoped.row["examCount" + item] ||
Number(scoped.row["examCount" + item]) === 0
? scoped.row["examCount" + item]
: "-"
}}</template>
|
f45b3c05
LH_PC
云平台新UI界面
|
64
65
66
67
|
</el-table-column>
<el-table-column :prop="'participationCount' + item" label="参与数"
:class-name="index % 2 == 0 ? 'bg' : ''">
<template slot-scope="scoped">{{
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
68
69
70
71
72
|
scoped.row["participationCount" + item] ||
Number(scoped.row["participationCount" + item]) === 0
? scoped.row["participationCount" + item]
: "-"
}}</template>
|
f45b3c05
LH_PC
云平台新UI界面
|
73
74
75
76
|
</el-table-column>
<el-table-column :prop="'score' + item" label="总分"
:class-name="index % 2 == 0 ? 'bg' : ''">
<template slot-scope="scoped">{{
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
77
78
79
80
81
|
scoped.row["score" + item] ||
Number(scoped.row["score" + item]) === 0
? scoped.row["score" + item]
: "-"
}}</template>
|
f45b3c05
LH_PC
云平台新UI界面
|
82
83
84
85
|
</el-table-column>
<el-table-column :prop="'classRank' + item" label="班名"
:class-name="index % 2 == 0 ? 'bg' : ''">
<template slot-scope="scoped">{{
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
86
87
88
89
|
scoped.row["classRank" + item] ||
Number(scoped.row["classRank" + item]) === 0
? scoped.row["classRank" + item]
: "-"
|
f45b3c05
LH_PC
云平台新UI界面
|
90
91
92
|
}}</template>
</el-table-column>
</el-table-column>
|
ef16e57e
LH_PC
fix:前端版本迭代
|
93
|
<el-table-column label="查看雷达图" class-name="print-hidden">
|
f45b3c05
LH_PC
云平台新UI界面
|
94
95
96
97
98
99
|
<template slot-scope="scoped">
<el-button type="text" @click="openRandarChart(scoped.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
100
|
</el-main>
|
f45b3c05
LH_PC
云平台新UI界面
|
101
102
103
|
</el-container>
</div>
|
6bca489d
LH_PC
云平台二期UI
|
104
|
<el-dialog class="chart-dia" :visible.sync="redarVisible" :title="radarChart.title" width="800"
|
f45b3c05
LH_PC
云平台新UI界面
|
105
106
|
:append-to-body="true">
<div class="chart-box">
|
ef16e57e
LH_PC
fix:前端版本迭代
|
107
|
<RadarChart id="testRadarChart" :params="radarChart" />
|
f45b3c05
LH_PC
云平台新UI界面
|
108
109
110
111
112
|
</div>
</el-dialog>
</div>
</template>
<script>
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
113
|
import { formatDate, formatTimeWithHours } from "utils";
|
f45b3c05
LH_PC
云平台新UI界面
|
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
import { downloadFile, tablePrint } from "@/utils";
import RadarChart from "@/components/charts/radarChart";
export default {
name: "askbzrMutli",
components: {
RadarChart
},
props: {
askReportIds: Array,
queryParams: Object,
list: Array
},
watch: {
currentType: {
handler: async function (val) {
},
deep: false,
},
$props: {
handler: async function (val) {
},
deep: false,
}
},
data() {
return {
selectedList: [],
status: "select",
checkedAll: 0,
answerList: [],
multipleSelection: [],
multipleSelectionObj: {},
|
6bca489d
LH_PC
云平台二期UI
|
149
|
redarVisible: false,
|
f45b3c05
LH_PC
云平台新UI界面
|
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
radarChart: {
title: "",
indicator: [
{
name: "",
max: 100,
axisLabel: {
show: true,
showMaxLabel: true,
formatter: "{value}%",
},
},
],
seriesData: []
},
//题干数据对象
stem: {
visible: false,
src: null
}
};
},
async created() {
},
methods: {
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
175
176
177
|
_formatTimeWithHours(seconds) {
return formatTimeWithHours(seconds);
},
|
f45b3c05
LH_PC
云平台新UI界面
|
178
|
_print() {
|
ef16e57e
LH_PC
fix:前端版本迭代
|
179
180
181
182
183
184
185
186
|
tablePrint({
id: "print-content",
title: this.currentType,
lindex: 1,
splitParam: 16,
fixedColumn: 2,
diffNumber: 2,
diffStNumber: 15
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
187
|
});
|
6bca489d
LH_PC
云平台二期UI
|
188
189
190
191
192
|
},
_checkAll() {
// this.multipleSelection = [...]
},
_tableSelectedChange(values) {
|
f45b3c05
LH_PC
云平台新UI界面
|
193
|
|
6bca489d
LH_PC
云平台二期UI
|
194
195
196
|
this.multipleSelection = values.map(items => items.id);
},
async _import() {
|
f45b3c05
LH_PC
云平台新UI界面
|
197
|
|
6bca489d
LH_PC
云平台二期UI
|
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
|
var testReport = this.$request.cTExportPhaseExamReport;
var classIds = [];
var subjects = [];
var ids = [];
this.$props.list?.map((item) => {
if (this.multipleSelection.includes(item.id)) {
subjects.push(item.subjectName);
classIds.push(item.classId);
}
});
ids = [...this.multipleSelection];
const data = await testReport({
classIds: classIds,
examIds: ids,
subjectNames: subjects
});
if (data) {
let blob = new Blob([data], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
});
downloadFile(`即时测-多科汇总分析报表.xlsx`, blob);
} else {
this.$message.error("下载失败");
}
|
f45b3c05
LH_PC
云平台新UI界面
|
228
|
},
|
f45b3c05
LH_PC
云平台新UI界面
|
229
230
|
_checkboxDisabled(obj) {
if (obj.examStartTime) {
|
f45b3c05
LH_PC
云平台新UI界面
|
231
|
return true;
|
6bca489d
LH_PC
云平台二期UI
|
232
233
|
} else {
return false;
|
f45b3c05
LH_PC
云平台新UI界面
|
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
}
},
async refresh() {
},
async handlerTotal() {
if (this.multipleSelection.length == 0) {
this.$message.warning("请选择试卷!");
return;
}
this.status = 'selected'
await this._loadData();
},
setSubPro(type) {
let tit;
switch (type) {
case 2:
tit = "单选题";
break;
case 3:
tit = "多选题";
break;
case 4:
tit = "判断题";
break;
case 5:
tit = "主观题";
break;
default:
tit = "其他";
}
return tit;
},
setDuration(times) {
let m = parseInt(times / 1000 / 60);
let s = parseInt((times / 1000) % 60);
let ms = times;
let aTime;
if (times == 0) {
aTime = `0`;
} else {
if (m == 0 && s == 0) {
aTime = `${ms}毫秒`;
} else if (m == 0 && s != 0) {
aTime = `${s}秒`;
} else if (m != 0 && s != 0) {
aTime = `${m}分${s}秒`;
}
}
return aTime;
},
_backa() {
this.status = 'select'
this.answerList = [];
this.exportStudent = [];
},
openRandarChart(obj) {
|
ef16e57e
LH_PC
fix:前端版本迭代
|
292
|
|
6bca489d
LH_PC
云平台二期UI
|
293
|
let max = 0;
|
ef16e57e
LH_PC
fix:前端版本迭代
|
294
|
|
6bca489d
LH_PC
云平台二期UI
|
295
296
297
298
299
300
|
const dataList = obj.dataList.slice(1, obj.dataList.length);
let subjectList = dataList.map((item) => {
let score = Number(item.highestScore || item.score);
max = score > max ? score : max;
return item.subjectName;
});
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
301
|
max += 10;
|
f45b3c05
LH_PC
云平台新UI界面
|
302
303
304
305
|
this.radarChart = {
indicator: [
{
name: "",
|
6bca489d
LH_PC
云平台二期UI
|
306
|
max: max,
|
f45b3c05
LH_PC
云平台新UI界面
|
307
308
309
|
axisLabel: {
show: true,
showMaxLabel: true,
|
f45b3c05
LH_PC
云平台新UI界面
|
310
311
312
313
314
|
},
},
],
seriesData: [],
};
|
f45b3c05
LH_PC
云平台新UI界面
|
315
316
317
|
subjectList.map((item, index) => {
if (index < 1) {
this.radarChart.indicator[index].name = item;
|
6bca489d
LH_PC
云平台二期UI
|
318
|
this.radarChart.indicator[index].max = max;
|
f45b3c05
LH_PC
云平台新UI界面
|
319
|
} else {
|
6bca489d
LH_PC
云平台二期UI
|
320
|
this.radarChart.indicator.push({ name: item, max: max });
|
f45b3c05
LH_PC
云平台新UI界面
|
321
322
323
324
325
326
327
|
}
});
// 为了美观
if (this.radarChart.indicator.length < 3) {
let num = this.radarChart.indicator.length;
for (let i = 0; i < 6; i++) {
if (i >= num) {
|
6bca489d
LH_PC
云平台二期UI
|
328
|
this.radarChart.indicator.push({ name: "", max: max });
|
f45b3c05
LH_PC
云平台新UI界面
|
329
330
331
|
}
}
}
|
f45b3c05
LH_PC
云平台新UI界面
|
332
333
|
this.radarChart.seriesData = [
{
|
6bca489d
LH_PC
云平台二期UI
|
334
335
|
value: dataList.map((item) => item.highestScore),
name: "班级最高分",
|
f45b3c05
LH_PC
云平台新UI界面
|
336
337
|
},
{
|
6bca489d
LH_PC
云平台二期UI
|
338
339
|
value: dataList.map((item) => item.avgScore),
name: "班平均分",
|
f45b3c05
LH_PC
云平台新UI界面
|
340
|
},
|
6bca489d
LH_PC
云平台二期UI
|
341
342
343
344
|
{
value: dataList.map((item) => item.score),
name: "本人得分",
},
|
ef16e57e
LH_PC
fix:前端版本迭代
|
345
|
];
|
f45b3c05
LH_PC
云平台新UI界面
|
346
|
|
6bca489d
LH_PC
云平台二期UI
|
347
|
this.radarChart.title = obj.studentName + "-多科阶段作答表现图";
|
06869a45
LH_PC
fix:修改测验时长显示不对的逻辑
|
348
|
|
6bca489d
LH_PC
云平台二期UI
|
349
|
this.redarVisible = true;
|
f45b3c05
LH_PC
云平台新UI界面
|
350
351
|
},
async _loadData() {
|
6bca489d
LH_PC
云平台二期UI
|
352
|
|
f45b3c05
LH_PC
云平台新UI界面
|
353
354
355
|
var classIds = [];
var subjects = [];
var ids = [];
|
f45b3c05
LH_PC
云平台新UI界面
|
356
|
this.$props.list?.map((item) => {
|
6bca489d
LH_PC
云平台二期UI
|
357
|
|
f45b3c05
LH_PC
云平台新UI界面
|
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
|
if (this.multipleSelection.includes(item.id)) {
subjects.push(item.subjectName);
classIds.push(item.classId);
}
});
ids = [...this.multipleSelection];
const { data, status, info } = await this.$request.cTPhaseExamReport({
classIds: classIds,
examIds: ids,
subjectNames: subjects
});
if (status != 0) {
this.$message.error(info);
return;
}
let subjectName = [];
this.selectedList = data?.list.map((item) => {
let params = {};
item.dataList.map((items, index) => {
if (!subjectName.includes(items.subjectName)) {
subjectName.push(items.subjectName);
}
|
6bca489d
LH_PC
云平台二期UI
|
385
|
console.log(items)
|
f45b3c05
LH_PC
云平台新UI界面
|
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
|
params["examCount" + items.subjectName] = items.examCount;
params["participationCount" + items.subjectName] =
items.participationCount;
params["score" + items.subjectName] = items.score;
params["classRank" + items.subjectName] = items.classRank;
});
return {
...item,
...params,
};
});
this.answerList = [...subjectName];
this.exportStudent = [...this.selectedList];
}
}
};
</script>
<style scoped lang="scss">
.chart-dia {
.chart-box {
width: 100%;
height: 300px;
}
:deep(.el-dialog__body) {
padding: 0 0 20px 0;
}
}
.opration-btn {
margin-right: 10px;
}
.opration-select {
margin-left: 10px;
}
.row-line {
width: calc(20% - 2px);
border: 1px solid #ebeef5;
background: #f5f7fa;
display: inline-block;
height: 40px;
line-height: 40px;
.line-subfix {
margin-left: 10px;
}
}
.row-table {
margin-top: 20px;
}
</style>
|