f356590c
阿宝
即时测列表,分析页面
|
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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
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
385
386
387
|
data() {
return {
role: "",
loading: false,
dialogVisible: false,
form: { questionList: [] },
date: "", //今天-昨天-本周
query: {
//搜索条件
classId: "",
subjectId: "",
startDay: "",
endDay: "",
day: "",
},
classList: [], //班级
subjectList: [], //科目
tabIndex: 1, //选项卡
tableData: [
{
title: "试卷一",
totalScore: 10,
ceyan: "40/50",
shijian: "2022-11-9 21:30至22:30",
pingjun: 60,
zuigao: 90,
zuidi: 50,
youxiu: 50,
lianghao: 40,
jige: 30,
bujige: 20,
},
{
title: "试卷二",
totalScore: 20,
ceyan: "30/50",
shijian: "2022-11-9 21:30至22:30",
pingjun: 80,
zuigao: 92,
zuidi: 53,
youxiu: 45,
lianghao: 56,
jige: 20,
bujige: 30,
},
],
tableStage: [
{
xuehao: 1,
xingming: "丁芳菲",
totalScore: 5,
rank: 1,
周测卷20221130totalScore:10,
周测卷20221130rank:0,
周测卷20221131totalScore:11,
周测卷20221131rank:1,
周测卷20221132totalScore:12,
周测卷20221132rank:2,
周测卷20221132totalScore:13,
周测卷20221132rank:3,
},
{
xuehao: 2,
xingming: "丁芳",
totalScore: 4,
rank: 2,
周测卷20221130totalScore:20,
周测卷20221130rank:3,
周测卷20221131totalScore:21,
周测卷20221131rank:4,
周测卷20221132totalScore:22,
周测卷20221132rank:5,
周测卷20221132totalScore:22,
周测卷20221132rank:5,
},
],
answerList: [//设置多卷内容供tabel表格数据用
{
title: "周测卷20221130",
totalScore: 6,
rank: 2,
},
{
title: "周测卷20221131",
totalScore: 7,
rank: 3,
},
{
title: "周测卷20221132",
totalScore: 8,
rank: 4,
},
],
};
},
async created() {
this.role = this.$store.getters.info.permissions[0]?.role || "";
if (this.role == "ROLE_BANZHUREN") {
this.query.subjectId = [];
}
await this._QueryClassList();
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: {
linkTo(obj) {
//去详情
this.$router.push({
path: "/testAnalysis",
query: {
id: obj.id,
},
});
},
|
f356590c
阿宝
即时测列表,分析页面
|
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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
|
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;
break;
case 2:
let day = new Date().getDay();
if (day == 0) {
//中国式星期天是一周的最后一天
day = 7;
}
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 > 1 && aMonth < 4) {
aMonth = "01";
} else if (aMonth > 3 && aMonth < 7) {
aMonth = "04";
} else if (aMonth > 6 && aMonth < 10) {
aMonth = "07";
} 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 = "";
}
}
},
edit(item) {
this.form = deepClone(item);
this.dialogVisible = true;
},
cancel() {
this.dialogVisible = false;
},
handleSuccess() {
this.dialogVisible = false;
this._QueryData();
},
async changClazz() {
await this._QuerySubjectList();
await this.setDate(1);
},
async _QueryClassList() {
const { data, status, info } = await this.$request.fetchClassList();
if (status === 0) {
this.classList = data.list.map((item) => {
return {
value: item.classId,
label: item.clazzName,
};
});
this.query.classId = this.classList[0]?.value;
} else {
this.$message.error(info);
}
},
async _QuerySubjectList() {
const { data, status, info } = await this.$request.fetchSubjectList({
classId: this.query.classId,
});
if (status === 0) {
this.subjectList =
data.list?.map((item) => {
return {
value: item.subjectId,
label: item.subjectName,
};
}) || [];
if (this.role == "ROLE_BANZHUREN") {
this.subjectList.unshift({
value: "",
label: "全部",
});
}
this.query.subjectId = this.subjectList[0]?.value;
} 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];
}
}
const { data, status, info } = await this.$request.fetchQuizList({
...query,
});
this.loading = false;
if (status === 0) {
} else {
this.$message.error(info);
}
},
},
};
|