|
|
|
@ -136,7 +136,8 @@ import util from '@/libs/util' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
date: [util.formatDate('yyyy-MM-dd'),util.formatDate('yyyy-MM-dd')], |
|
|
|
|
timer: null, |
|
|
|
|
date: [], |
|
|
|
|
startTime: '', |
|
|
|
|
endTime: '', |
|
|
|
|
page: 1, |
|
|
|
@ -180,6 +181,12 @@ export default { |
|
|
|
|
quill |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
let now = util.formatDate('yyyy-MM-dd') |
|
|
|
|
let second = util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + 86400000)) |
|
|
|
|
this.date = [now,second] |
|
|
|
|
this.startTime = now |
|
|
|
|
this.endTime = second |
|
|
|
|
this.addInterval() |
|
|
|
|
this.getData() |
|
|
|
|
this.getPractice() |
|
|
|
|
this.getAchievement() |
|
|
|
@ -189,6 +196,12 @@ export default { |
|
|
|
|
...mapActions('exam', [ |
|
|
|
|
'setInfo' |
|
|
|
|
]), |
|
|
|
|
addInterval(){ |
|
|
|
|
this.timer = setInterval(this.getData,1000) |
|
|
|
|
this.$once('hook:beforeDestroy',() => { |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getData() { |
|
|
|
|
this.$post(`${this.api.waitExam}?userId=${this.userId}&pageNum=${this.page}&pageSize=${this.pageSize}&startTime=${this.startTime}&endTime=${this.endTime}`) |
|
|
|
|
.then(res => { |
|
|
|
@ -218,7 +231,7 @@ export default { |
|
|
|
|
|
|
|
|
|
let avgScore = 0 |
|
|
|
|
list.map(n => avgScore += n.lastScore) |
|
|
|
|
this.avgScore = (avgScore / list.length).toFixed(2) |
|
|
|
|
this.avgScore = list.length ? (avgScore / list.length).toFixed(2) : 0 |
|
|
|
|
|
|
|
|
|
let totalDuration = 0 |
|
|
|
|
list.map(n => totalDuration += n.duration) |
|
|
|
@ -236,17 +249,18 @@ export default { |
|
|
|
|
this.getPractice() |
|
|
|
|
}, |
|
|
|
|
getPracticeDuration(){ |
|
|
|
|
console.log(11,this.practiceDateList,this.practiceDurationList) |
|
|
|
|
let myChart = echarts.init(document.getElementById('practiceDuration')) |
|
|
|
|
myChart.setOption({ |
|
|
|
|
title: { text: '总练习时长' }, |
|
|
|
|
tooltip: {}, |
|
|
|
|
xAxis: { |
|
|
|
|
name: '日期', |
|
|
|
|
type: 'category', |
|
|
|
|
boundaryGap: false, |
|
|
|
|
data: this.practiceDateList |
|
|
|
|
}, |
|
|
|
|
yAxis: { |
|
|
|
|
name: '时长(分钟)', |
|
|
|
|
type: 'value' |
|
|
|
|
}, |
|
|
|
|
series: [{ |
|
|
|
@ -268,10 +282,12 @@ export default { |
|
|
|
|
let myChart = echarts.init(document.getElementById('achievement')) |
|
|
|
|
myChart.setOption({ |
|
|
|
|
xAxis: { |
|
|
|
|
name: '考试名称', |
|
|
|
|
type: 'category', |
|
|
|
|
data: this.assesmentNameList |
|
|
|
|
}, |
|
|
|
|
yAxis: { |
|
|
|
|
name: '得分', |
|
|
|
|
type: 'value' |
|
|
|
|
}, |
|
|
|
|
series: [{ |
|
|
|
|