TeachEvalute.vue
3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<template>
<!-- 活动管理 -->
<div class="activity_manage">
<el-table :data="activityData" style="width: 997px" :header-cell-style="changeHeader">
<el-table-column label="学号" align="center">
<template slot-scope="scope">
<div class="cell_color">{{scope.row.username}}</div>
</template>
</el-table-column>
<el-table-column label="学生姓名" align="center">
<template slot-scope="scope">
<div class="cell_color">{{scope.row.nickname}}</div>
</template>
</el-table-column>
<el-table-column label="测评时间" align="center">
<template slot-scope="scope">
<div class="cell_color" v-if="scope.row.date">{{scope.row.date}}<br/>{{scope.row.time}}</div>
<div class="cell_color" v-else>-</div>
</template>
</el-table-column>
<el-table-column label="测评状态" align="center">
<template slot-scope="scope">
<div
class="no_test"
:class="{tested:scope.row.status == 1}"
>{{scope.row.status == 1?"已测评":"未测评"}}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<div
class="operation"
@click="activeOperate(scope.row)"
v-show="scope.row.status == 1"
>查看报告</div>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
background
class="teach_pagation"
layout="prev, pager, next"
:page-count="total"
@current-change="handleCurrentChange"
></el-pagination>
</div>
</template>
<script>
import { post } from "@/api/http";
export default {
data() {
return {
activityData: [],
id: "",
total: 10,
page: "",
type: ""
};
},
methods: {
// 分页
handleCurrentChange(val) {
this.page = val;
this.testStudentData();
document.getElementById("search").scrollIntoView();
},
// 表头样式
changeHeader({ row, rowIndex }) {
if (rowIndex == 0) {
return "background-color:#f1f1f1;color:#5B5E63!important;font-weight:400";
}
},
// 查看报告
activeOperate(row) {
console.log(row);
if (this.type == 1) {
// 兴趣测评
this.$router.push({
path: "/AssessmentReport",
query: { testId: row.id }
});
} else {
// 多元测评
this.$router.push({
path: "/MulReport",
query: { testId: row.user_id, id: this.id }
});
}
},
// 测评管理
testStudentData() {
let url = "/api/teacher/testStudentData";
let params = {
test_id: this.id,
page: this.page
};
post(url, params).then(res => {
this.activityData = res.test_list;
this.total = res.total_page;
});
}
},
components: {},
mounted() {
this.id = this.$route.query.id;
this.type = this.$route.query.type;
this.testStudentData();
},
watch:{
'$route'(to,from){
this.id = this.$route.query.id;
this.testStudentData();
}
},
};
</script>
<style scoped>
@import "../../../style/personal.css";
.operation {
margin: 0 0 0 20px;
}
/* 已报名 */
.sign_up {
background-color: #a4c7ff;
border-color: #a4c7ff;
}
.input_exp {
background-color: #fff;
color: #409eff;
}
.teach_pagation {
margin-top: 55px;
}
.no_test {
color: #f44a5e;
}
.tested {
color: #47d1a0;
}
</style>