EvaluteManage.vue
5.7 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<template>
<!-- 个人中心 测评管理 -->
<div class="personal_manage">
<div class="test_content clearfix" v-if="timeList.length>0">
<!-- 测评时间 -->
<div class="test_time">
<div
class="test_year"
v-for="item in timeList"
:key="item.id"
:class="{test_border:isBorder == item.id}"
@click="changeBorder(item.id)"
>
<p class="test_det_year">{{item.year}} {{item.group}}</p>
<p class="test_det_term">{{item.term}}</p>
</div>
</div>
<!-- 具体内容 -->
<div class="test_det clearfix">
<div class="test_det_list clearfix" v-for="item in testList" :key="item.id">
<!-- 测评类型 -->
<div class="test_style clearfix">
<div class="test_style_l">
<div class="test_interest">
<p>{{item.test_category == 'interest'?"兴趣测评":"多元性向GS"}}</p>
<p>{{item.title}}</p>
</div>
<div class="test_start_end">
<p>开始时间:{{item.starttime}}</p>
<p>结束时间:{{item.endtime}}</p>
</div>
</div>
</div>
<!-- 测评说明 -->
<div class="test_induction clearfix">
<!-- 左侧 -->
<div class="test_induction_l">
<div class="test_l_title">测评说明:</div>
<div class="test_l_content">{{item.text}}</div>
</div>
<!-- 右侧 -->
<div class="test_induction_r layout align_center justify_center">
<div
v-show="groupId == 1"
class="test_btn"
:class="{test_btned:item.button_status != 2}"
@click="toInduction(item)"
>{{item.button_status == 1?"查看报告":item.button_status == 2?"开始测评":item.button_status == 3?"已过期":"未开始"}}</div>
<div
v-show="groupId == 2"
class="test_no"
:class="{test_parent:item.status == 1}"
@click="toInduction(item)"
>{{item.status == 1?"查看报告":"未测评"}}</div>
</div>
</div>
</div>
</div>
</div>
<!-- 暂无测评 -->
<div class="no_test_lis" v-else>
暂无测评
</div>
</div>
</template>
<script>
import { post } from "@/api/http";
import { Notification } from "element-ui";
export default {
data() {
return {
timeList: [],
isBorder: 2,
testList: [],
groupId:"",
};
},
methods: {
// 学期列表
changeBorder: function(id) {
this.isBorder = id;
this.getTestList(id);
},
// 施测说明 查看报告
toInduction: function(item) {
// 测评id
localStorage.setItem("evaluteId", item.id);
// 学生
if (this.groupId == 1) {
if (item.button_status == 1) {
if (item.is_to_show_student == 1) {
// 查看报告
if (item.test_category == "interest") {
// 兴趣测评报告
this.$router.push({
path: "/AssessmentReport",
query: { testId: item.test_student_id }
});
} else if (item.test_category == "pluralistic") {
// 多元测评报告
this.$router.push({ path: "/MulReport" });
}
} else {
Notification.info({
title: "提示",
message: "无查看权限",
duration: 1500
});
}
} else if (item.button_status == 2) {
if (item.test_category == "interest") {
// 兴趣测评
this.$router.push({ path: "/Inducte" });
} else if (item.test_category == "pluralistic") {
// 多元性向测评
this.$router.push({ path: "/MulAgreement" });
}
}
} else if (this.groupId == 2) {
// 家长
// 查看报告
if (item.status == 1) {
if (item.test_category == "interest") {
// 兴趣测评报告
this.$router.push({
path: "/AssessmentReport",
query: { testId: item.test_student_id }
});
} else if (item.test_category == "pluralistic") {
// 多元测评报告
this.$router.push({ path: "/MulReport" });
}
}
}
},
// 获取学期列表
getTermList: function() {
let url = "/api/test/getTermList";
post(url)
.then(res => {
this.timeList = res;
for(let obj of res){
if(obj.this_term == 1){
this.isBorder = obj.id;
this.getTestList(obj.id);
}
}
// 学校id
localStorage.setItem("schoolId", res[0].school_id);
// 学期id
localStorage.setItem("termId", res[0].id);
for (var obj of this.timeList) {
if (obj.term == "first") {
obj.term = "第一学期";
} else if (obj.term == "second") {
obj.term = "第二学期";
}
}
})
.catch(err => {
console.log("err=" + err);
});
},
// 测评列表
getTestList: function(id) {
let url = "/api/test/getTestList";
let params = {
id: id
};
post(url, params).then(res => {
this.testList = res;
});
}
},
mounted() {
this.getTermList();
this.groupId = localStorage.getItem("groupId")
}
};
</script>
<style scoped>
@import "../../../style/evaluteManage.css";
/* 暂无测评 */
.no_test_lis{
font-size: 16px;
font-weight: bold;
color: #34485e;
margin:100px auto;
}
</style>