项目维度统计(备份)

Branch_d40a2540
yujialong 1 year ago
parent c93be55486
commit ada18d3c5f
  1. 5
      src/pages/achievement/info/course.vue
  2. 43
      src/pages/achievement/info/project.vue
  3. 2
      src/pages/achievement/list/course.vue

@ -282,6 +282,7 @@ export default {
accountId: this.$route.query.accountId,
id: +this.$route.query.id,
cid: +this.$route.query.cid,
classId: +this.$route.query.classId,
keyword: "",
searchTimer: null,
listDataAll: [],
@ -330,7 +331,8 @@ export default {
keyWord: this.keyword,
mallId: this.id,
cid: this.cid,
permissions: per
permissions: per,
classId: this.classId
})
this.listDataAll = per ? res.listOfAssessmentResults.records : res.userScoreList.records
this.total = per ? res.listOfAssessmentResults.total : res.userScoreList.total
@ -388,6 +390,7 @@ export default {
mallId: this.id,
cid: this.cid,
permissions: +this.curTab,
classId: this.classId
})
list = practice ? res.userScoreList.records : res.listOfAssessmentResults.records
}

@ -502,29 +502,56 @@ export default {
getChart () { // 线
const xData = Array.from({ length: 101 }, (v, k) => k)
const yData = Array.from({ length: 101 }, (v, k) => 0)
const data = {}
const list = this.listDataAll
list.map(n => {
if (!data[n.score]) {
data[n.score] = 1
} else {
data[n.score]++
}
yData[n.score]++
})
console.log(333, xData, yData)
let max = Math.max(...Object.values(data))
console.log("🚀 ~ file: project.vue:517 ~ getChart ~ max:", yData)
const x = Array.from({ length: max }, (v, k) => k)
for (let i = 0; i <= max; i++) {
const item = yData.findIndex(e => e == i)
console.log("🚀 ~ file: project.vue:521 ~ getChart ~ item:", item)
}
xData.map(e => {
for (let i = 0; i <= max; i++) {
}
})
// console.log(333, xData, yData, data)
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
tooltip: {},
xAxis: {
name: "分数",
type: "category",
name: this.permissions ? "人数" : '成绩报告数量',
type: "value",
boundaryGap: false,
interval: 5,
axisLabel: {
interval: 9,
interval: 5
},
data: xData
},
yAxis: {
name: this.permissions ? "人数" : '成绩报告数量',
type: "value",
interval: 5
name: "分数",
type: "category",
min: 0,
max: 100,
interval: 5,
axisLabel: {
interval: 9
},
data: xData
},
series: [{
data: yData,

@ -248,7 +248,7 @@ export default {
},
//
entry (row) {
this.$router.push(`course?id=${row.mallId}&curriculumName=${row.curriculumName}&cid=${row.cid}`)
this.$router.push(`course?id=${row.mallId}&curriculumName=${row.curriculumName}&cid=${row.cid}&classId=${row.classId}`)
},
handleCurrentChange (val) { //
this.page = val

Loading…
Cancel
Save