|
|
@ -94,10 +94,8 @@ |
|
|
|
<a class="item active">考试成绩</a> |
|
|
|
<a class="item active">考试成绩</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="page-content"> |
|
|
|
<div class="page-content"> |
|
|
|
<template v-if="assesmentNameList.length"> |
|
|
|
<div class="chart" id="achievement"></div> |
|
|
|
<div class="chart" id="achievement"></div> |
|
|
|
<!-- <div class="none" style="padding: 0;line-height: 400px;" v-else>暂无图标数据</div> --> |
|
|
|
</template> |
|
|
|
|
|
|
|
<div class="none" style="padding: 0;line-height: 400px;" v-else>暂无图标数据</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -300,14 +298,24 @@ export default { |
|
|
|
getAchievement() { |
|
|
|
getAchievement() { |
|
|
|
this.$post(`${this.api.getMyAchievement}?userId=${this.userId}&pageSize=1000&pageNum=1`).then(res => { |
|
|
|
this.$post(`${this.api.getMyAchievement}?userId=${this.userId}&pageSize=1000&pageNum=1`).then(res => { |
|
|
|
let list = res.data.list.list |
|
|
|
let list = res.data.list.list |
|
|
|
this.assesmentNameList = list.map(n => n.assessmentName) |
|
|
|
let acheList = [] |
|
|
|
this.assesmentScoreList = list.map(n => n.thisScore) |
|
|
|
list.map(n => { |
|
|
|
|
|
|
|
if(n.thisScore != null){ |
|
|
|
|
|
|
|
acheList.push({ |
|
|
|
|
|
|
|
assessmentName: n.assessmentName, |
|
|
|
|
|
|
|
score: n.thisScore |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.assesmentNameList = acheList.map(n => n.assessmentName) |
|
|
|
|
|
|
|
this.assesmentScoreList = acheList.map(n => n.score) |
|
|
|
this.getAchievementChart() |
|
|
|
this.getAchievementChart() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
getAchievementChart(){ |
|
|
|
getAchievementChart(){ |
|
|
|
let myChart = echarts.init(document.getElementById('achievement')) |
|
|
|
let myChart = echarts.init(document.getElementById('achievement')) |
|
|
|
myChart.setOption({ |
|
|
|
myChart.setOption({ |
|
|
|
|
|
|
|
tooltip: {}, |
|
|
|
xAxis: { |
|
|
|
xAxis: { |
|
|
|
name: '考试名称', |
|
|
|
name: '考试名称', |
|
|
|
type: 'category', |
|
|
|
type: 'category', |
|
|
@ -319,7 +327,8 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
series: [{ |
|
|
|
series: [{ |
|
|
|
data: this.assesmentScoreList, |
|
|
|
data: this.assesmentScoreList, |
|
|
|
type: 'bar' |
|
|
|
type: 'bar', |
|
|
|
|
|
|
|
areaStyle: {} |
|
|
|
}] |
|
|
|
}] |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|