77ebf04d
梁保满
个人版
|
1
2
3
4
5
6
7
8
9
10
|
<template>
<div>
<back-box>
<template slot="title">
<span>学生测练表现</span>
</template>
</back-box>
<div class="answer-header">
<div class="sel-box">
<el-select
|
76eb1bf6
梁保满
授课端版本管理,学生画像接口联调
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
v-if="role == 'ROLE_JIAOSHI'"
class="sel"
v-model="query.subjectNames"
placeholder="选择科目"
>
<el-option
v-for="item in subjectList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-select
|
77ebf04d
梁保满
个人版
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
class="sel"
multiple
v-model="query.subjectNames"
placeholder="选择科目"
collapse-tags
@change="changeSub"
>
<el-option
v-for="item in subjectList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<div class="d1">
<el-date-picker
v-model="query.startDay"
type="date"
@change="handleChangeTimeStart"
placeholder="选择日期时间"
value-format="yyyy-MM-dd"
>
</el-date-picker>
~
<el-date-picker
v-model="query.endDay"
type="date"
placeholder="选择日期时间"
@change="handleChangeTimeEnd"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
<p class="p1">
<span @click="setDate(1)" :class="[date == 1 ? 'active' : '', 's1']"
>今天</span
>
<span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']"
>本周</span
>
<span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']"
>本月</span
>
<span @click="setDate(4)" :class="[date == 4 ? 'active' : '', 's1']"
>本季度</span
>
</p>
<el-button type="primary" round @click="_QueryData()">筛选</el-button>
</div>
</div>
<div class="page-content">
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
77
78
79
80
|
<p class="tips">
{{ studentName }}(学号:{{ studentCode }}) 测练总次数:{{ count }}
</p>
<div class="chart" v-if="tableData.length">
|
77ebf04d
梁保满
个人版
|
81
82
83
84
85
86
87
|
<template v-if="type == 1">
<radarChart id="radarChart" :params="radarChartData" />
</template>
<template v-else>
<lineChart id="lineChart" :params="lineChartData" :xAxis="xAxis" />
</template>
</div>
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
88
|
|
77ebf04d
梁保满
个人版
|
89
90
91
92
93
94
95
96
97
98
99
100
101
|
<div class="tab-box">
<el-table
v-show="type == 1"
:data="tableData"
border
style="width: 100%"
>
<el-table-column
prop="subjectName"
label="科目"
align="center"
></el-table-column>
<el-table-column
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
102
|
prop="examCount"
|
77ebf04d
梁保满
个人版
|
103
104
105
106
|
label="参与测练数"
align="center"
></el-table-column>
<el-table-column
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
107
|
prop="highestScore"
|
77ebf04d
梁保满
个人版
|
108
109
110
111
|
label="班最高分"
align="center"
></el-table-column>
<el-table-column
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
112
|
prop="avgScore"
|
77ebf04d
梁保满
个人版
|
113
114
115
116
|
label="班平均分"
align="center"
></el-table-column>
<el-table-column
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
117
|
prop="examScore"
|
77ebf04d
梁保满
个人版
|
118
119
120
121
122
123
124
125
126
127
128
|
label="个人得分"
align="center"
></el-table-column>
</el-table>
<el-table
v-show="type == 2"
:data="tableData"
border
style="width: 100%"
>
<el-table-column
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
129
|
prop="title"
|
77ebf04d
梁保满
个人版
|
130
131
132
133
|
label="课堂测练"
align="center"
></el-table-column>
<el-table-column
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
134
|
prop="examScore"
|
77ebf04d
梁保满
个人版
|
135
136
137
138
|
label="个人成绩"
align="center"
></el-table-column>
<el-table-column
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
139
|
prop="avgScore"
|
77ebf04d
梁保满
个人版
|
140
141
142
143
|
label="平均成绩"
align="center"
></el-table-column>
<el-table-column
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
144
|
prop="classRank"
|
77ebf04d
梁保满
个人版
|
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
label="班级排名"
align="center"
></el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<script>
import { formatDate } from "utils";
import radarChart from "@/components/charts/radarChart";
import lineChart from "@/components/charts/lineChart";
export default {
components: { radarChart, lineChart },
data() {
return {
|
76eb1bf6
梁保满
授课端版本管理,学生画像接口联调
|
162
|
role: "",
|
77ebf04d
梁保满
个人版
|
163
|
id: "",
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
164
165
|
studentName: "",
studentCode: "",
|
77ebf04d
梁保满
个人版
|
166
167
168
169
170
171
172
173
174
175
176
177
178
|
classId: "",
subjectNames: [],
type: 1,
query: {
//搜索条件
subjectNames: [],
startDay: "",
endDay: "",
day: "",
},
date: "",
subjectList: [], //科目
radarChartData: {
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
179
180
|
indicator: [],
num: [],
|
77ebf04d
梁保满
个人版
|
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
},
lineChartData: [
{
name: "班平均分",
value: [95, 85, 90, 86, 92],
},
{
name: "个人成绩",
value: [90, 80, 95, 82, 95],
},
{
name: "班级排名",
value: [2, 3, 1, 5, 6],
},
],
xAxis: ["卷1", "卷2", "卷3", "卷4", "卷5"],
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
197
198
|
tableData: [],
count: 0, //测练数
|
77ebf04d
梁保满
个人版
|
199
200
201
|
};
},
async created() {
|
76eb1bf6
梁保满
授课端版本管理,学生画像接口联调
|
202
203
204
|
this.role =
this.$store.getters.info.showRole ||
this.$store.getters.info.permissions[0].role;
|
77ebf04d
梁保满
个人版
|
205
206
|
this.id = this.$route.query.id;
this.classId = this.$route.query.classId;
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
207
208
|
this.studentCode = this.$route.query.studentCode;
this.studentName = this.$route.query.studentName;
|
76eb1bf6
梁保满
授课端版本管理,学生画像接口联调
|
209
210
211
212
213
|
if (this.role != "ROLE_JIAOSHI") {
this.subjectNames = this.$route.query.subjectNames?.split() || [];
} else {
this.subjectNames = this.$route.query.subjectNames;
}
|
77ebf04d
梁保满
个人版
|
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
|
await this._QuerySubjectList();
await this.setDate(1);
let startDay = this.query?.startDay;
if (!startDay) {
this.query.startDay = new Date();
this.query.endDay = new Date();
}
},
methods: {
changeSub(val) {
let sub;
if (val && val.length) {
let leng = val.length - 1;
sub = val[leng];
}
this.query.subjectNames = val.filter((item) => {
return sub != "全部" ? item != "全部" : item == "全部";
});
this.type =
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
233
234
235
|
this.query.subjectNames.length > 1
? 1
: this.query.subjectNames[0] == "全部" && this.subjectList.length != 2
|
77ebf04d
梁保满
个人版
|
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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
? 1
: 2;
},
setDate(index) {
const that = this;
this.date = index == this.date ? "" : index;
let aYear = new Date().getFullYear();
let aMonth = new Date().getMonth() + 1;
that.query.day = "";
that.query.startDay = "";
that.query.endDay = "";
switch (index) {
case 1:
that.query.day = formatDate(new Date(), "yyyy-MM-dd");
that.query.startDay = that.query.day;
that.query.endDay = that.query.day;
that.tabIndex = 1;
break;
case 2:
let day = new Date().getDay();
if (day == 0) {
//中国式星期天是一周的最后一天
day = 7;
}
day--;
let aTime = new Date().getTime() - 24 * 60 * 60 * 1000 * day;
that.query.startDay = formatDate(new Date(aTime), "yyyy-MM-dd");
that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
break;
case 3:
aMonth = aMonth < 10 ? "0" + aMonth : aMonth;
that.query.startDay = `${aYear}-${aMonth}-01`;
that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
break;
case 4:
if (aMonth > 0 && aMonth < 4) {
aMonth = "1";
} else if (aMonth > 3 && aMonth < 7) {
aMonth = "4";
} else if (aMonth > 6 && aMonth < 10) {
aMonth = "7";
} else {
aMonth = "10";
}
aMonth = aMonth < 10 ? "0" + aMonth : aMonth;
that.query.startDay = `${aYear}-${aMonth}-01`;
that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
break;
}
this.page = 1;
this._QueryData();
},
handleChangeTimeStart(val) {
this.query.day = "";
this.date = "";
if (this.query.endDay) {
if (new Date(val).getTime() > new Date(this.query.endDay).getTime()) {
this.$message.error("任务结束时间不能任务开始时间前面,请重新设置");
this.query.startDay = "";
}
}
},
handleChangeTimeEnd(val) {
this.query.day = "";
this.date = "";
if (this.query.startDay) {
if (new Date(val).getTime() < new Date(this.query.startDay).getTime()) {
this.$message.error("任务结束时间不能任务开始时间前面,请重新设置");
this.query.endDay = "";
}
}
},
async _QuerySubjectList() {
|
76eb1bf6
梁保满
授课端版本管理,学生画像接口联调
|
310
311
312
313
314
|
let subjectList =
this.role == "ROLE_PERSONAL"
? this.$request.pSubjectList
: this.$request.tSubjectList;
const { data, status, info } = await subjectList({
|
77ebf04d
梁保满
个人版
|
315
316
317
318
319
320
321
322
323
324
|
classId: this.classId,
});
if (status === 0) {
this.subjectList =
data.subjectNames?.map((item) => {
return {
value: item,
label: item,
};
}) || [];
|
76eb1bf6
梁保满
授课端版本管理,学生画像接口联调
|
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
|
if (this.role != "ROLE_JIAOSHI") {
this.subjectList.unshift({
value: "全部",
label: "全部",
});
if (this.subjectNames.length == 0) {
this.query.subjectNames.push(this.subjectList[0]?.value);
} else {
this.query.subjectNames = [...this.subjectNames];
}
this.type =
this.query.subjectNames.length > 1
? 1
: this.query.subjectNames[0] == "全部" &&
this.subjectList.length != 2
? 1
: 2;
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
342
|
} else {
|
76eb1bf6
梁保满
授课端版本管理,学生画像接口联调
|
343
344
345
346
347
|
if (!this.subjectNames) {
this.query.subjectNames = this.subjectList[0]?.value;
} else {
this.query.subjectNames = this.subjectNames;
}
|
77ebf04d
梁保满
个人版
|
348
|
}
|
77ebf04d
梁保满
个人版
|
349
350
351
352
353
354
355
356
357
358
359
360
|
} else {
this.$message.error(info);
}
},
async _QueryData() {
this.loading = true;
let query = {};
for (let key in this.query) {
if (this.query[key] != "") {
query[key] = this.query[key];
}
}
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
361
362
|
delete query.subjectNames;
let subjectNames;
|
76eb1bf6
梁保满
授课端版本管理,学生画像接口联调
|
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
|
if (this.role != "ROLE_JIAOSHI") {
if (
this.query.subjectNames.length == 1 &&
this.query.subjectNames[0] == "全部"
) {
subjectNames = this.subjectList
.filter((item) => {
return item.value != "全部";
})
.map((item) => {
return item.value;
});
} else {
subjectNames = [...this.query.subjectNames];
}
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
378
|
} else {
|
76eb1bf6
梁保满
授课端版本管理,学生画像接口联调
|
379
|
subjectNames = [this.query.subjectNames];
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
380
|
}
|
76eb1bf6
梁保满
授课端版本管理,学生画像接口联调
|
381
382
383
384
385
|
let studentExamReport =
this.role == "ROLE_PERSONAL"
? this.$request.pStudentExamReport
: this.$request.tStudentExamReport;
const { data, status, info } = await studentExamReport({
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
386
387
|
studentId: this.id,
subjectNames: subjectNames,
|
77ebf04d
梁保满
个人版
|
388
389
390
391
|
...query,
});
this.loading = false;
if (status === 0) {
|
e371f2dc
梁保满
软件下载,学校,班级老师等报表导入...
|
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
|
this.count = 0;
this.tableData = data.list || [];
if (this.type == 1) {
this.radarChartData.indicator = [];
this.radarChartData.num = [
{ name: "班最高分", value: [] },
{ name: "班平均分", value: [] },
{ name: "本人得分", value: [] },
];
this.tableData.map((item) => {
this.count += item.examCount;
this.radarChartData.indicator.push({
name: item.subjectName,
});
this.radarChartData.num[0].value.push(item.highestScore);
this.radarChartData.num[1].value.push(item.avgScore);
this.radarChartData.num[2].value.push(item.examScore);
});
} else {
this.count = data.count;
this.xAxis = [];
this.lineChartData = [
{ name: "班平均分", value: [] },
{ name: "个人成绩", value: [] },
{ name: "班级排名", value: [] },
];
this.tableData.map((item) => {
this.xAxis.push(item.title);
this.lineChartData[0].value.push(item.avgScore);
this.lineChartData[1].value.push(item.examScore);
this.lineChartData[2].value.push(item.classRank);
});
}
|
77ebf04d
梁保满
个人版
|
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
|
} else {
this.$message.error(info);
}
},
},
};
</script>
<style lang="scss" scoped>
.page-content {
padding: 0 20px;
}
.tips {
padding-left: 20px;
font-size: 16px;
color: #a3a4a8;
font-weight: 400;
font-style: normal;
}
.chart {
height: 300px;
}
.tab-box {
padding: 20px;
}
</style>
|