|
|
|
@ -48,11 +48,11 @@ |
|
|
|
|
<div class="wrong"> |
|
|
|
|
<div class="line"> |
|
|
|
|
<span class="jud-name">错误率最高:{{ max.projectName }}</span> |
|
|
|
|
<span>参加考试{{ max.itemErrorCount }}人 | {{ permissions ? `共${max.errorTotal}人做错,` : '' }}错误率{{ max.errorRate }}%</span> |
|
|
|
|
<span>参加考试{{ max.numberOfParticipants }}人 | {{ curTab == 1 ? `共${max.itemErrorCount}人做错,` : '' }}错误率{{ max.errorRate }}%</span> |
|
|
|
|
</div> |
|
|
|
|
<div class="line"> |
|
|
|
|
<span class="jud-name">错误率最低:{{ min.projectName }}</span> |
|
|
|
|
<span>参加考试{{ min.itemErrorCount }}人 | {{ permissions ? `共${min.errorTotal}人做错,` : '' }}错误率{{ min.errorRate }}%</span> |
|
|
|
|
<span>参加考试{{ min.numberOfParticipants }}人 | {{ curTab == 1 ? `共${min.itemErrorCount}人做错,` : '' }}错误率{{ min.errorRate }}%</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="chart" |
|
|
|
@ -523,41 +523,54 @@ export default { |
|
|
|
|
this.$router.push(this.curTab == 1 ? `show?reportId=${row.reportId}` : `project?id=${row.projectId}&projectName=${row.goodsName}&classId=${this.curRow.classId || ''}&workNumber=${row.workNumber || row.userName}`) |
|
|
|
|
}, |
|
|
|
|
getChart () { // 初始化折线图 |
|
|
|
|
const data = {} |
|
|
|
|
const data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
|
|
|
|
const list = this.listDataAll |
|
|
|
|
const prop = this.curTab == 0 ? 'avgScore' : 'averageScore' |
|
|
|
|
list.map(n => { |
|
|
|
|
if (!data[n[prop]]) { |
|
|
|
|
data[n[prop]] = 1 |
|
|
|
|
} else { |
|
|
|
|
data[n[prop]]++ |
|
|
|
|
const val = n[prop] |
|
|
|
|
if (val === 0) { |
|
|
|
|
data[0]++; |
|
|
|
|
} else if (val > 0 && val <= 10) { |
|
|
|
|
data[1]++; |
|
|
|
|
} else if (val > 10 && val <= 20) { |
|
|
|
|
data[2]++; |
|
|
|
|
} else if (val > 20 && val <= 30) { |
|
|
|
|
data[3]++; |
|
|
|
|
} else if (val > 30 && val <= 40) { |
|
|
|
|
data[4]++; |
|
|
|
|
} else if (val > 40 && val <= 50) { |
|
|
|
|
data[5]++; |
|
|
|
|
} else if (val > 50 && val <= 60) { |
|
|
|
|
data[6]++; |
|
|
|
|
} else if (val > 60 && val <= 70) { |
|
|
|
|
data[7]++; |
|
|
|
|
} else if (val > 70 && val <= 80) { |
|
|
|
|
data[8]++; |
|
|
|
|
} else if (val > 80 && val <= 90) { |
|
|
|
|
data[9]++; |
|
|
|
|
} else if (val > 90 && val <= 100) { |
|
|
|
|
data[10]++; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
console.log(333, data, Object.keys(data), Object.values(data)) |
|
|
|
|
|
|
|
|
|
let myChart = echarts.init(document.getElementById("chart")); |
|
|
|
|
myChart.setOption({ |
|
|
|
|
title: { text: "实验分数分布图" }, |
|
|
|
|
tooltip: {}, |
|
|
|
|
xAxis: { |
|
|
|
|
name: "分数", |
|
|
|
|
name: this.curTab == 1 ? "分数" : "平均分", |
|
|
|
|
type: "category", |
|
|
|
|
boundaryGap: false, |
|
|
|
|
interval: 5, |
|
|
|
|
axisLabel: { |
|
|
|
|
interval: 9, |
|
|
|
|
}, |
|
|
|
|
data: Object.keys(data) |
|
|
|
|
interval: 10, |
|
|
|
|
data: ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", '100'] |
|
|
|
|
}, |
|
|
|
|
yAxis: { |
|
|
|
|
name: this.curTab == 1 ? "人数" : '成绩报告数量', |
|
|
|
|
name: "人数", |
|
|
|
|
type: "value", |
|
|
|
|
interval: 10, |
|
|
|
|
axisLabel: { |
|
|
|
|
interval: 9, |
|
|
|
|
}, |
|
|
|
|
interval: 1 |
|
|
|
|
}, |
|
|
|
|
series: [{ |
|
|
|
|
data: Object.values(data), |
|
|
|
|
data, |
|
|
|
|
type: "line", |
|
|
|
|
areaStyle: {}, |
|
|
|
|
color: ["#8191fd"] |
|
|
|
|