CareeReport.vue
7.2 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<template>
<!-- 生涯报告 -->
<div class="career_report clearfix">
<!-- 学期列表 -->
<div class="term_list clearfix layout flex_row">
<div
class="term_msg layout justify_center flex_diection"
v-for="item in termList"
:key="item.id"
:class="{term_bot:isBot == item.id}"
@click="changeBot(item.id)"
>
<div class="term_group">{{item.group}}</div>
<div class="term_det">{{item.term}}</div>
</div>
</div>
<!-- 学科成绩 -->
<div class="academic_results clearfix">
<div class="career_title">学科成绩</div>
<!-- 表格 -->
<table class="first_table">
<tr class="acade_title">
<td class="first_td">科目</td>
<td>分数</td>
<td>时间</td>
</tr>
<tr v-for="item in trList" :key="item.trId">
<td class="first_td">{{item.name}}</td>
<td>{{item.score}}</td>
<td>{{item.date}}</td>
</tr>
</table>
<table class="second_table">
<tr class="acade_title">
<td class="first_td">科目</td>
<td>分数</td>
<td>时间</td>
</tr>
<tr v-for="item in trList2" :key="item.trId">
<td class="first_td">{{item.name}}</td>
<td>{{item.score}}</td>
<td>{{item.date}}</td>
</tr>
</table>
</div>
<!-- 评测结果 -->
<div class="evaluation_results">
<div class="career_title">评测结果</div>
<!-- 多元性向潜能 -->
<div class="multielement" clearfix>
<div class="evaluation_title">多元性向潜能</div>
<div class="mul_content clearfix layout flex_row">
<div class="mul_l">结果分析:</div>
<div class="mul_r" v-show="muList.average">{{muList.average}}%</div>
<div class="mul_explain" v-show="muList.average">在多元性向潜能测评中,您超过了{{muList.average}}%的测评者</div>
</div>
<div class="mul_content clearfix layout flex_row">
<div class="mul_l">最高性向:</div>
<div class="mul_r">{{muList.xx_highs}}</div>
</div>
<div class="mul_content clearfix layout flex_row">
<div class="mul_l">最低性向:</div>
<div class="mul_r">{{muList.xx_lows}}</div>
</div>
<div class="mul_content clearfix layout flex_row">
<div class="mul_l">适合专业:</div>
<div class="mul_r">{{muList.ss_profession}}</div>
</div>
<div class="mul_content clearfix layout flex_row">
<div class="mul_l">学习风格:</div>
<div class="mul_r">{{muList.fengge}}</div>
</div>
</div>
<!-- 兴趣测评 -->
<div class="interest">
<div class="evaluation_title">兴趣测评</div>
<div class="mul_content clearfix layout flex_row">
<div class="mul_l">结果分数:</div>
<div
class="mul_r"
v-for="(item,index) in scoreList"
:key="index"
>{{item.title}}({{item.name}}){{index == 5?"":"、"}}</div>
</div>
</div>
</div>
<!-- 下载报告 -->
<div class="second_btn" v-show="isDown">下载报告</div>
</div>
</template>
<script>
import { post } from "@/api/http";
export default {
data() {
return {
isBot: "",
id: "",
termList: [],
muList: [],
trList: [],
trList2: [],
scoreList: [],
isDown:false
};
},
methods: {
// 边框
changeBot(index) {
this.isBot = index;
this.id = index;
this.getReport();
},
// 获取学期列表
getTermList: function() {
let url = "/api/test/getTermList";
post(url)
.then(res => {
this.termList = res;
for(let obj of res){
if(obj.this_term == 1){
this.isBot = obj.id;
this.id = obj.id;
}
}
this.getReport();
for (var obj of this.termList) {
if (obj.term == "first") {
obj.term = "第一学期";
} else if (obj.term == "second") {
obj.term = "第二学期";
}
}
})
.catch(err => {
console.log("err=" + err);
});
},
// 生涯报告
getReport() {
let url = "/api/student/baogao";
let params = {
id: this.id
};
post(url, params).then(res => {
this.trList = [];
this.trList2 = [];
this.scoreList = [];
// 成绩表格
for (let i in res.score_list) {
if (i % 2 == 0) {
this.trList.push(res.score_list[i]);
} else {
this.trList2.push(res.score_list[i]);
}
}
// 测评结果
this.muList = res.test_result;
// 结果分数
let resultScore = res.interest_result.result.result;
for (let key in resultScore) {
var obj = {};
switch (key) {
case "A":
obj.title = "A 艺术型";
obj.name = resultScore[key];
break;
case "R":
obj.title = "R 实际型";
obj.name = resultScore[key];
break;
case "I":
obj.title = "I 研究型";
obj.name = resultScore[key];
break;
case "S":
obj.title = "S 社会型";
obj.name = resultScore[key];
break;
case "E":
obj.title = "E 企业型";
obj.name = resultScore[key];
break;
case "C":
obj.title = "C 事务型";
obj.name = resultScore[key];
break;
}
this.scoreList.push(obj);
}
});
}
},
mounted() {
this.getTermList();
}
};
</script>
<style scoped>
/* 学期 */
@import "../../../style/term.css";
/* 按钮 */
@import "../../../style/btn.css";
.career_report {
background-color: #fff;
}
/* 成绩表格 */
table tr {
line-height: 40px;
font-size: 14px;
color: #5b5e63;
border-bottom: 1px solid #eee;
}
table td {
width: 25%;
}
/* 表头 */
.acade_title {
line-height: 30px;
background-color: #f1f1f1;
}
/* 左侧表格 */
.first_table {
width: 499px;
border-right: 1px solid #707070;
float: left;
}
/* 右侧表格 */
.second_table {
float: left;
width: 497px;
}
/* 标题 */
.career_title {
height: 53px;
line-height: 53px;
color: #34485e;
font-size: 16px;
font-weight: bold;
text-align: left;
margin-left: 26px;
}
/* 评测结果标题 */
.evaluation_title {
width: 100%;
height: 30px;
line-height: 30px;
font-size: 14px;
background-color: #f1f1f1;
color: #5b5e63;
}
/* 多元测评结果 */
.mul_content {
font-size: 14px;
padding: 10px 0;
border-bottom: 1px solid #eee;
}
.mul_l {
padding: 0 27px;
color: #5b5e63;
}
.mul_r {
color: #8c9198;
}
.mul_explain {
color: #bdc4ce;
margin-left: 44px;
}
/* 兴趣描述 */
.inter_content {
border-bottom: none;
}
.inter_l {
float: left;
}
.inter_r {
width: 845px;
float: left;
text-align: left;
}
/* 下载报告 */
.second_btn {
margin-top: 49px;
margin-bottom: 27px;
}
</style>