实验记录3个页面合并成一个,分数统计改成前端计算

dev_2022-05-11
yujialong 3 years ago
parent 23bf70ff73
commit ca17b3eb1d
  1. 368
      src/pages/achievement/ass/index.vue
  2. 12
      src/pages/achievement/list/index.vue
  3. 1
      src/pages/achievement/show/index.vue
  4. 94
      src/pages/achievement/teach/index.vue
  5. 266
      src/pages/achievement/vir/index.vue
  6. 2
      src/pages/assessment/list/index.vue

@ -1,368 +0,0 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-10">
<el-page-header @back="goBack" :content="experimentalName"></el-page-header>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in classInfo" :label="item.className" :name="item.id"></el-tab-pane>
</el-tabs>
<div class="stat">
<div class="nums">
<div class="item">
<p class="name">实验总人数</p>
<p class="val">{{ total }}</p>
</div>
<div class="item">
<p class="name">实验平均分</p>
<p class="val">{{ avg }}</p>
</div>
</div>
<div class="chart" id="chart"></div>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20">
<el-form label-width="100px">
<div class="flex-between">
<div></div>
<div>
<el-input placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</el-form>
<div></div>
<div>
<el-button type="primary" @click="delAllData">批量删除</el-button>
<el-button type="primary" @click="exportData">导出</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="schoolName" label="学校" align="center">
</el-table-column>
<el-table-column prop="experimentalName" label="考核名称" align="center">
<template slot-scope="scope">
{{ experimentalName }}
</template>
</el-table-column>
<el-table-column prop="userName" label="学生姓名" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学号" align="center"></el-table-column>
<el-table-column prop="score" label="分数" align="center"></el-table-column>
<el-table-column prop="submitTime" label="提交时间" align="center">
</el-table-column>
<el-table-column label="操作" align="center" width="220">
<template slot-scope="scope">
<!-- <el-button type="text" @click="edit(scope.row)">修改分数</el-button> -->
<el-button type="text" @click="show(scope.row)">查看成绩报告</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";
import axios from 'axios';
export default {
data() {
return {
id: this.$route.query.id,
classId: this.$route.query.classId,
projectId: this.$route.query.projectId,
assessmentId:'',
classInfo: [
{
architectureId: "",
className: "全部",
createTime: "2021-12-30 12:02:33",
id: "",
isDel: 0,
}
],
experimentalName: this.$route.query.experimentalName,
className: this.$route.query.class,
keyword: "",
listData: [],
multipleSelection: [],
page: 1,
pageSize: 10,
total: 0,
avg: 0,
activeName:'',
token: util.local.get(Setting.tokenKey),
};
},
created() {
this.getData();
let classInfo = JSON.parse(this.$route.query.classInfo)
for (var i=0;i<classInfo.length;i++){
if(classInfo[i].className == "无指定范围"){
}else{
this.classInfo.push(classInfo[i])
}
}
for(var i=0;i<this.classInfo.length;i++){
let id = this.classInfo[i].id
this.classInfo[i].id = id.toString()
}
const activeName2 = sessionStorage.getItem('activeName2')
if(activeName2 && this.classInfo.some(item => item.id === activeName2)) {
this.classId = ""
this.activeName = ""
}else {
this.classId = "";
this.activeName = "";
}
this.id = this.$route.query.id
},
methods: {
handleClick(tab, event) {
sessionStorage.setItem('activeName2', tab.name)
if(this.activeName == 0){
this.activeName = ''
}
this.getData()
},
getData() {
if(this.activeName == 0){
this.activeName = ''
}
this.$post(`${this.api.getAssessmentDetail}?assessmentId=${+this.id}&pageNum=${this.page}&pageSize=${this.pageSize}&classId=${this.activeName}`).then(res => {
if (res.status == 200){
if(this.activeName == ''){
this.activeName = '0'
}
this.avg = res.avgScore
this.total = res.peopleNum
let list = res.page.records;
if (list.length > 0){
this.assessmentId = res.page.records[0].assessmentId;
let score = 0;
list.map(n => {
n.class = this.className;
score += n.score;
});
}
this.listData = list;
this.getChart();
}
}).catch(res => {
});
},
edit(row) {
if (this.systemId == 2 || this.systemId == 3) {
this.$router.push(`addexperiment?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
} else {
this.$router.push(`addexperiment?id=${row.reportId}`);
}
},
show(row) {
if (this.systemId == 2) {
this.$router.push(`showexperimentOption?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
} else if (this.systemId == 3) {
this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
} else {
if (this.className) {
this.$router.push(`show?id=${row.recordId}&projectId=${this.id}&reportId=${row.reportId}&studentId=${row.studentId}`);
} else {
this.$router.push(`show?id=${row.recordId}&type=1`);
}
}
},
exportData() {
if (!this.listData.length) return false;
if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => {
return item.reportId;
});
axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${+this.id}&classId=${this.activeName}&ids=${ids.toString()}`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
} else {
axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${+this.id}&classId=${this.activeName}&ids=`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
}
},
handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
})
.then(() => {
let ids = [row.reportId]
this.$post(`${this.api.deleteExperimentalReport}`,ids).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
});
},
delAllData() {
if (this.multipleSelection.length != "") {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
})
.then(() => {
let newArr = this.multipleSelection;
let ids = []
for (var i=0;i<newArr.length;i++){
ids.push(newArr[i].reportId)
}
this.$post(`${this.api.deleteExperimentalReport}`,ids).then(res => {
util.successMsg("删除成功");
this.$refs.table.clearSelection()
this.getData();
}).catch(res => {
});
})
.catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
getChart() {
let data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
let list = this.listData;
list.map(n => {
n.score;
if (n.score >= 0 && n.score <= 10) {
data[0]++;
} else if (n.score > 10 && n.score <= 20) {
data[1]++;
} else if (n.score > 20 && n.score <= 30) {
data[2]++;
} else if (n.score > 30 && n.score <= 40) {
data[3]++;
} else if (n.score > 40 && n.score <= 50) {
data[4]++;
} else if (n.score > 50 && n.score <= 60) {
data[5]++;
} else if (n.score > 60 && n.score <= 70) {
data[6]++;
} else if (n.score > 70 && n.score <= 80) {
data[7]++;
} else if (n.score > 80 && n.score <= 90) {
data[8]++;
} else if (n.score > 90 && n.score <= 100) {
data[9]++;
}
});
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
tooltip: {},
xAxis: {
name: "分数",
type: "category",
boundaryGap: false,
data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"]
},
yAxis: {
name: "人数",
type: "value"
},
series: [{
data,
type: "line",
areaStyle: {},
color: ["#8191fd"]
}]
});
},
goBack() {
this.$router.back();
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .el-tabs__nav-wrap::after {
display: none;
}
.stat {
display: flex;
.nums {
display: flex;
align-items: center;
margin-right: 20px;
.item:nth-child(1) {
background-image: url('../../../assets/img/total.png');
}
.item:nth-child(2) {
background-image: url('../../../assets/img/avg.png');
}
.item {
width: 300px;
padding: 30px 30px;
margin: 0 10px;
box-sizing: border-box;
border-radius: 8px;
background-size: 100% 100%;
background-repeat: no-repeat;
p {
font-size: 18px;
color: #ffffff;
}
.val {
margin-top: 10px;
color: #ffffff;
font-size: 36px;
}
}
}
.chart {
flex: 1;
height: 300px;
}
}
</style>

@ -246,15 +246,9 @@ export default {
if ((row.isAdmin === 1 && (row.isDel === 1 || row.courseDel === 1)) || (row.isAdmin === 0 && row.isDel === 1)) return true if ((row.isAdmin === 1 && (row.isDel === 1 || row.courseDel === 1)) || (row.isAdmin === 0 && row.isDel === 1)) return true
return false return false
}, },
entry(row) { // //
if (this.projectPermissions === 1) { entry(row) {
let list = row.classList.map(i => { this.$router.push(`teach?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions}`)
return { id: i.id.toString(), name: i.className };
});
this.$router.push(`teach?assessmentId=${row.assessmentId}&projectName=${row.projectName}&permissions=${row.permissions}&classList=${JSON.stringify(list)}`);
} else {
this.$router.push(`vir?projectId=${row.projectId}&projectName=${row.projectName}&permissions=${row.permissions}`);
}
}, },
handleDelete(row) { // handleDelete(row) { //
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {

@ -135,7 +135,6 @@ export default {
data() { data() {
return { return {
reportId: this.$route.query.reportId, reportId: this.$route.query.reportId,
projectId: this.$route.query.projectId,
title: "实验报告", title: "实验报告",
form: { form: {
className: "", className: "",

@ -44,24 +44,25 @@
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId"> <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="schoolName" label="学校" align="center"> <el-table-column prop="schoolName" label="学校" width="150" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="experimentalName" label="考核名称" align="center"> <el-table-column prop="experimentalName" label="考核名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ experimentalName }} {{ experimentalName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userName" label="学生姓名" align="center"></el-table-column> <el-table-column prop="userName" label="学生姓名" width="100" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学号" align="center"></el-table-column> <el-table-column prop="workNumber" label="学号" width="100" align="center"></el-table-column>
<el-table-column prop="score" label="分数" align="center"></el-table-column> <el-table-column prop="score" label="分数" width="90" align="center"></el-table-column>
<el-table-column prop="submitTime" label="提交时间" align="center"> <el-table-column label="耗时" width="90" align="center"></el-table-column>
<el-table-column prop="submitTime" label="提交时间" width="150" align="center">
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="220"> <el-table-column label="操作" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看成绩报告</el-button> <el-button type="text" @click="show(scope.row)">查看成绩报告</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
@ -77,21 +78,19 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from "vuex";
import Setting from "@/setting"; import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import echarts from "echarts"; import echarts from "echarts";
import axios from 'axios'; import axios from 'axios';
export default { export default {
data() { data() {
return { return {
activeName: "", // activeName: "", //
classId: "", // id classId: "", // id
classList: [], // classList: [], //
permissions: this.$route.query.permissions, permissions: Number(this.$route.query.permissions),
experimentalName: this.$route.query.projectName, experimentalName: this.$route.query.projectName,
assessmentId: this.$route.query.assessmentId, id: this.$route.query.id,
keyword: "", keyword: "",
searchTimer: null, searchTimer: null,
listData: [], listData: [],
@ -113,8 +112,8 @@ export default {
} }
}, },
mounted() { mounted() {
this.getSpliceClass() this.permissions && this.getSpliceClass() //
this.getData(); this.getData()
}, },
methods: { methods: {
handleClick(tab, event) { // handleClick(tab, event) { //
@ -125,7 +124,7 @@ export default {
}, },
// //
getSpliceClass() { getSpliceClass() {
this.$post(`${this.api.spliceClass}?assessmentId=${this.assessmentId}`).then(res => { this.$post(`${this.api.spliceClass}?assessmentId=${this.id}`).then(res => {
this.classList = res.list this.classList = res.list
const activeName = sessionStorage.getItem('activeName') const activeName = sessionStorage.getItem('activeName')
if(activeName && this.classList.some(item => item.id === activeName)) { if(activeName && this.classList.some(item => item.id === activeName)) {
@ -137,25 +136,33 @@ export default {
} }
}).catch(err => {}) }).catch(err => {})
}, },
getData() { // //
this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&assessmentId=${this.assessmentId}&classId=${this.classId}&keyword=${this.keyword}`).then(res => { getData() {
this.listData = res.page.records; //
this.total = res.page.total;
this.avgScore = res.avgScore;
this.peopleNum = res.peopleNum;
this.getChart(res.getFractionalSegmentNum);
}).catch(err => {
});
},
show(row) { //
if (this.permissions) { if (this.permissions) {
// row.recordId row.studentId ??? this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}`).then(res => {
// this.$router.push(`show?id=${row.recordId}&projectId=${row.projectId}&reportId=${row.reportId}&studentId=${row.studentId}`); this.listData = res.page.records
this.$router.push(`show?reportId=${row.reportId}`); this.total = res.page.total
this.avgScore = res.avgScore
this.peopleNum = res.peopleNum
this.getChart()
}).catch(err => {})
} else { } else {
this.$router.push(`show?id=${row.recordId}&type=1`); //
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.total = res.page.total
let avgScore = +res.avgScore
this.avgScore = avgScore.toFixed(2)
this.peopleNum = res.peopleNum
this.getChart()
}).catch(res => {})
} }
}, },
//
show(row) {
this.$router.push(`show?reportId=${row.reportId}`)
},
exportData() { // () exportData() { // ()
if (this.multipleSelection.length) { if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => { let ids = this.multipleSelection.map(item => {
@ -220,8 +227,33 @@ export default {
this.page = val; this.page = val;
this.handlePage(); this.handlePage();
}, },
getChart(num) { // 线 getChart() { // 线
let data = [num.num1, num.num2, num.num3, num.num4, num.num5, num.num6, num.num7, num.num8, num.num9, num.num10]; let data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
let list = this.listData
list.map(n => {
n.score;
if (n.score >= 0 && n.score <= 10) {
data[0]++;
} else if (n.score > 10 && n.score <= 20) {
data[1]++;
} else if (n.score > 20 && n.score <= 30) {
data[2]++;
} else if (n.score > 30 && n.score <= 40) {
data[3]++;
} else if (n.score > 40 && n.score <= 50) {
data[4]++;
} else if (n.score > 50 && n.score <= 60) {
data[5]++;
} else if (n.score > 60 && n.score <= 70) {
data[6]++;
} else if (n.score > 70 && n.score <= 80) {
data[7]++;
} else if (n.score > 80 && n.score <= 90) {
data[8]++;
} else if (n.score > 90 && n.score <= 100) {
data[9]++;
}
})
let myChart = echarts.init(document.getElementById("chart")); let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({ myChart.setOption({
title: { text: "实验分数分布图" }, title: { text: "实验分数分布图" },

@ -1,266 +0,0 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-10">
<el-page-header @back="goBack" :content="experimentName"></el-page-header>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div class="stat">
<div class="nums">
<div class="item">
<p class="name">实验总人数</p>
<p class="val">{{ peopleNum }}</p>
</div>
<div class="item">
<p class="name">实验平均分</p>
<p class="val">{{ avgScore }}</p>
</div>
</div>
<div class="chart" id="chart"></div>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20">
<div>
<el-input placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
<div>
<el-button type="primary" @click="delAllData">批量删除</el-button>
<el-button type="primary" @click="exportData">导出</el-button>
</div>
</div>
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="schoolName" label="学校" align="center">
</el-table-column>
<el-table-column prop="userName" label="学生姓名" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学号" align="center"></el-table-column>
<el-table-column prop="score" label="分数" align="center"></el-table-column>
<el-table-column prop="submitTime" label="提交时间" align="center">
</el-table-column>
<el-table-column label="操作" align="center" width="220">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看成绩报告</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
import { mapState, mapActions } from "vuex";
import axios from 'axios'
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";
export default {
data() {
return {
permissions: this.$route.query.permissions,
experimentName: this.$route.query.projectName,
projectId: this.$route.query.projectId,
keyword: "",
searchTimer: null,
listData: [],
multipleSelection: [],
page: 1,
pageSize: 10,
total: 0,
peopleNum: 0, //
avgScore: 0, //
token: util.local.get(Setting.tokenKey),
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
this.getData();
},
methods: {
initData() {
this.$refs.table.clearSelection();
this.page = 1;
this.getData();
},
getData() {
this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&projectId=${this.projectId}&keyword=${this.keyword}`).then(res => {
// this.multipleSelection = res.page.records;
this.listData = res.page.records;
this.total = res.page.total;
let avgScore = +res.avgScore
this.avgScore = avgScore.toFixed(2)
this.peopleNum = res.peopleNum;
this.getChart(res.getFractionalSegmentNum);
}).catch(res => {
});
},
show(row) {
if (this.permissions) {
this.$router.push(`show?id=${row.projectId}&projectId=${this.projectId}&reportId=${row.reportId}`);
} else {
this.$router.push(`show?id=${row.projectId}&type=1`);
}
},
exportData() {
if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => {
return item.reportId;
});
axios.get(`${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=${ids.toString()}`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`学生练习成绩.xls`,new Blob([res.data]))
}).catch(res => {})
// location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=${ids.toString()}`;
} else {
axios.get(`${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`学生练习成绩.xls`,new Blob([res.data]))
}).catch(res => {})
// location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=`;
}
},
handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteExperimentalReport, [row.reportId]).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
},
delAllData() {
if (this.multipleSelection.length) {
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => {
return item.reportId;
});
this.$post(this.api.deleteExperimentalReport, ids).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
getChart(num) {
let data = [num.num1, num.num2, num.num3, num.num4, num.num5, num.num6, num.num7, num.num8, num.num9, num.num10];
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
tooltip: {},
xAxis: {
name: "分数",
type: "category",
boundaryGap: false,
data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"]
},
yAxis: {
name: "人数",
type: "value"
},
series: [{
data,
type: "line",
areaStyle: {},
color: ["#8191fd"]
}]
});
},
goBack() {
this.$router.push("/achievement/list?per=2");
}
}
};
</script>
<style lang="scss" scoped>
.stat {
display: flex;
.nums {
display: flex;
align-items: center;
margin-right: 20px;
.item:nth-child(1) {
background-image: url('../../../assets/img/total.png');
}
.item:nth-child(2) {
background-image: url('../../../assets/img/avg.png');
}
.item {
width: 300px;
padding: 30px 30px;
margin: 0 10px;
box-sizing: border-box;
border-radius: 8px;
background-size: 100% 100%;
background-repeat: no-repeat;
p {
font-size: 18px;
color: #ffffff;
}
.val {
margin-top: 10px;
color: #ffffff;
font-size: 36px;
}
}
}
.chart {
flex: 1;
height: 300px;
}
}
</style>

@ -344,7 +344,7 @@ export default {
this.$router.push(`add?id=${row.id}`); this.$router.push(`add?id=${row.id}`);
}, },
show(row) { show(row) {
this.$router.push(`/achievement/ass?id=${row.id}&classId=${row.classId}&projectId=${row.projectId}&classInfo=${JSON.stringify(row.classInfo)}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`); this.$router.push(`/achievement/teach?id=${row.id}&projectName=${row.projectName}&permissions=1`)
}, },
start(row) { start(row) {
this.$post(`${this.api.enableAssessment}?id=${row.id}`).then(res => { this.$post(`${this.api.enableAssessment}?id=${row.id}`).then(res => {

Loading…
Cancel
Save