成绩管理修复

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

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

Loading…
Cancel
Save