|
@@ -13,6 +13,12 @@ export default {
|
|
|
default: () => {
|
|
|
return undefined
|
|
|
}
|
|
|
+ },
|
|
|
+ isTeacher: {
|
|
|
+ type: Boolean,
|
|
|
+ default: () => {
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -20,6 +26,8 @@ export default {
|
|
|
categories: [],
|
|
|
ckps: [], //班级
|
|
|
kps: [], //个人
|
|
|
+ akps: [], //所有班级
|
|
|
+ echartsData: [],
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -33,7 +41,7 @@ export default {
|
|
|
})
|
|
|
let myChart = this.$echarts.init(document.getElementById("knowledge"))
|
|
|
let option = {
|
|
|
- color: ["#5470C6", "#91CC75"],
|
|
|
+ color: ["#5470C6", "#91CC75", '#00905a'],
|
|
|
title: {
|
|
|
text: this.$t('studentWeb.exam.chart.keyPointPerformance'),
|
|
|
left: 'left',
|
|
@@ -43,7 +51,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
legend: {
|
|
|
- data: [this.$t("studentWeb.exam.chart.me"), this.$t("studentWeb.exam.chart.participantClass")],
|
|
|
+ data: [this.$t("studentWeb.exam.chart.me"), this.$t("studentWeb.exam.chart.participantClass"), this.$t("studentWeb.exam.chart.allClass")],
|
|
|
bottom: 0,
|
|
|
},
|
|
|
tooltip: {
|
|
@@ -58,17 +66,8 @@ export default {
|
|
|
{
|
|
|
name: 'Budget vs spending',
|
|
|
type: 'radar',
|
|
|
- data: [
|
|
|
- {
|
|
|
- value: this.kps,
|
|
|
- name: this.$t("studentWeb.exam.chart.me")
|
|
|
- },
|
|
|
- {
|
|
|
- value: this.ckps,
|
|
|
- name: this.$t("studentWeb.exam.chart.participantClass")
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
+ data: this.echartsData
|
|
|
+ },
|
|
|
],
|
|
|
}
|
|
|
myChart.setOption(option)
|
|
@@ -76,14 +75,33 @@ export default {
|
|
|
getFiled() {
|
|
|
let kps = []
|
|
|
let ckps = []
|
|
|
+ let akps = []
|
|
|
if (this.knowledge.kn) {
|
|
|
this.knowledge.kn.map((item, index) => {
|
|
|
kps.push(this.knowledge.kps[index] ? this.knowledge.kps[index].toFixed(2) : 0)
|
|
|
ckps.push(this.knowledge.ckps[index] ? this.knowledge.ckps[index].toFixed(2) : 0)
|
|
|
+ akps.push(this.knowledge.akps[index] ? this.knowledge.akps[index].toFixed(2) : 0)
|
|
|
})
|
|
|
}
|
|
|
this.kps = kps
|
|
|
this.ckps = ckps
|
|
|
+ this.akps = akps
|
|
|
+ this.echartsData = [
|
|
|
+ {
|
|
|
+ value: this.kps,
|
|
|
+ name: this.$t("studentWeb.exam.chart.me")
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: this.ckps,
|
|
|
+ name: this.$t("studentWeb.exam.chart.participantClass")
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ if(this.isTeacher) {
|
|
|
+ this.echartsData.push({
|
|
|
+ value: this.akps,
|
|
|
+ name: this.$t("studentWeb.exam.chart.allClass")
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|