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