项目维度统计(备份)

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

@ -502,29 +502,56 @@ export default {
getChart () { // 线 getChart () { // 线
const xData = Array.from({ length: 101 }, (v, k) => k) const xData = Array.from({ length: 101 }, (v, k) => k)
const yData = Array.from({ length: 101 }, (v, k) => 0) const yData = Array.from({ length: 101 }, (v, k) => 0)
const data = {}
const list = this.listDataAll const list = this.listDataAll
list.map(n => { list.map(n => {
if (!data[n.score]) {
data[n.score] = 1
} else {
data[n.score]++
}
yData[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")); let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({ myChart.setOption({
title: { text: "实验分数分布图" }, title: { text: "实验分数分布图" },
tooltip: {}, tooltip: {},
xAxis: { xAxis: {
name: "分数", name: this.permissions ? "人数" : '成绩报告数量',
type: "category", type: "value",
boundaryGap: false, boundaryGap: false,
interval: 5, interval: 5,
axisLabel: { axisLabel: {
interval: 9, interval: 5
}, },
data: xData
}, },
yAxis: { yAxis: {
name: this.permissions ? "人数" : '成绩报告数量', name: "分数",
type: "value", type: "category",
interval: 5 min: 0,
max: 100,
interval: 5,
axisLabel: {
interval: 9
},
data: xData
}, },
series: [{ series: [{
data: yData, data: yData,

@ -248,7 +248,7 @@ export default {
}, },
// //
entry (row) { 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) { // handleCurrentChange (val) { //
this.page = val this.page = val

Loading…
Cancel
Save