成绩管理修复

dev_2022-05-11
Jo 3 years ago
parent 402040fc54
commit 66069cfc15
  1. 5
      src/pages/achievement/list/index.vue
  2. 60
      src/pages/achievement/teach/index.vue

@ -24,7 +24,7 @@
</li>
<li>
<label>实验项目分类</label>
<el-radio-group v-model="projectPermissions" @change="initData">
<el-radio-group v-model="projectPermissions" @change="perChange">
<el-radio v-for="(item,index) in projectType" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group>
</li>
@ -237,6 +237,9 @@ export default {
this.loadIns.close();
});
},
perChange(val) {
this.$router.push(`list?per=${val}`)
},
initData() {
this.$refs.table.clearSelection();
this.page = 1;

@ -2,7 +2,7 @@
<div>
<el-card shadow="hover" class="m-b-20 head-card">
<div class="flex-between m-b-20">
<el-page-header @back="goBack" :content="experimentalName"></el-page-header>
<el-page-header @back="$router.back()" :content="experimentalName"></el-page-header>
</div>
</el-card>
@ -59,7 +59,11 @@
<el-table-column prop="userName" label="学生姓名" min-width="100" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学号" min-width="100" align="center"></el-table-column>
<el-table-column prop="score" label="分数" width="90" align="center"></el-table-column>
<el-table-column prop="timeSum" label="耗时" width="90" align="center"></el-table-column>
<el-table-column prop="timeSum" label="耗时" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.timeSum }}min
</template>
</el-table-column>
<el-table-column prop="submitTime" label="提交时间" min-width="150" align="center">
</el-table-column>
<el-table-column label="操作" align="center" width="160">
@ -93,6 +97,7 @@ export default {
id: this.$route.query.id,
keyword: "",
searchTimer: null,
listDataAll: [],
listData: [],
multipleSelection: [],
page: 1,
@ -140,25 +145,32 @@ export default {
getData() {
//
if (this.permissions) {
this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}`).then(res => {
this.listData = res.page.records
this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=10000&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}`).then(res => {
this.listDataAll = res.page.records
this.total = res.page.total
this.avgScore = res.avgScore
this.peopleNum = res.peopleNum
this.handlePage()
this.getChart()
}).catch(err => {})
} else {
//
this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&projectId=${this.id}&keyword=${this.keyword}`).then(res => {
this.listData = res.page.records
this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=10000&projectId=${this.id}&keyword=${this.keyword}`).then(res => {
this.listDataAll = res.page.records
this.total = res.page.total
let avgScore = +res.avgScore
this.avgScore = avgScore.toFixed(2)
this.peopleNum = res.peopleNum
this.handlePage()
this.getChart()
}).catch(res => {})
}
},
//
handlePage(){
const list = this.listDataAll
this.listData = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
},
//
show(row) {
this.$router.push(`show?reportId=${row.reportId}`)
@ -224,36 +236,34 @@ export default {
this.handlePage();
},
getChart() { // 线
let data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
let list = this.listData
const data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
const list = this.listDataAll
list.map(n => {
n.score;
if (n.score >= 0 && n.score <= 10) {
if (n.score === 0) {
data[0]++;
} else if (n.score > 10 && n.score <= 20) {
} else if (n.score > 0 && n.score <= 10) {
data[1]++;
} else if (n.score > 20 && n.score <= 30) {
} else if (n.score > 10 && n.score <= 20) {
data[2]++;
} else if (n.score > 30 && n.score <= 40) {
} else if (n.score > 20 && n.score <= 30) {
data[3]++;
} else if (n.score > 40 && n.score <= 50) {
} else if (n.score > 30 && n.score <= 40) {
data[4]++;
} else if (n.score > 50 && n.score <= 60) {
} else if (n.score > 40 && n.score <= 50) {
data[5]++;
} else if (n.score > 60 && n.score <= 70) {
} else if (n.score > 50 && n.score <= 60) {
data[6]++;
} else if (n.score > 70 && n.score <= 80) {
} else if (n.score > 60 && n.score <= 70) {
data[7]++;
} else if (n.score > 80 && n.score <= 90) {
} else if (n.score > 70 && n.score <= 80) {
data[8]++;
} else if (n.score > 90 && n.score <= 100) {
} else if (n.score > 80 && n.score <= 90) {
data[9]++;
} else if (n.score > 90 && n.score <= 100) {
data[10]++;
}
})
// const datas = []
// for (let i = 0; i <= 100; i++) {
// datas.push(list.filter(e => e.score === i).length)
// }
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
@ -263,8 +273,7 @@ export default {
type: "category",
boundaryGap: false,
interval: 10,
// splitNumber: 10,
data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"]
data: ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", '100']
},
yAxis: {
name: "人数",
@ -278,9 +287,6 @@ export default {
color: ["#8191fd"]
}]
});
},
goBack() {
this.$router.push("/achievement/list?per=1");
}
}
};

Loading…
Cancel
Save