TeachEvaDet.vue
2.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
<template>
<!-- 个人中心 测评管理 -->
<div class="personal_manage">
<div class="test_content clearfix" v-if="testList.length>0">
<!-- 具体内容 -->
<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.type_category_text}}</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 class="test_btn" @click="toDetail(item)">查看详情</div>
</div>
</div>
</div>
</div>
</div>
<!-- 暂无测评 -->
<div class="no_test_lis" v-else>暂无测评</div>
<!-- 分页 -->
<el-pagination
background
layout="prev, pager, next"
:page-count="total"
@current-change="handleCurrentChange"
></el-pagination>
</div>
</template>
<script>
import { post } from "@/api/http";
export default {
data() {
return {
testList: [],
total:null,
page:"",
};
},
methods: {
// 分页
handleCurrentChange(val){
this.page = val;
this.getTestList();
},
// 查看详情
toDetail(item) {
console.log(item);
let type = "";
if(item.test_category == "interest"){
type = 1
}else{
type = 2
}
this.$router.push({path:'/TeachEvalute',query:{id:item.id,type:type}})
},
// 已发布的测评
getTestList: function() {
let url = "/api/teacher/testList";
let params = {
id: localStorage.getItem("termId"),
page:this.page
};
post(url, params).then(res => {
this.testList = res.test_list;
this.total = res.total_page;
});
}
},
mounted() {
this.getTestList();
}
};
</script>
<style scoped>
@import "../../../style/evaluteManage.css";
/* 暂无测评 */
.no_test_lis {
font-size: 16px;
font-weight: bold;
color: #34485e;
margin: 100px auto;
}
</style>