ActivityManagement.vue
4.1 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
<template>
<!-- 活动管理 -->
<div class="activity_manage">
<el-table :data="activityData" style="width: 100%" :header-cell-style="changeHeader">
<el-table-column label="活动名称" width="193">
<template slot-scope="scope">
<div class="cell_color">{{scope.row.name}}</div>
</template>
</el-table-column>
<el-table-column label="活动介绍" width="193">
<template slot-scope="scope">
<div class="cell_color cell_wrap">{{scope.row.description}}</div>
</template>
</el-table-column>
<el-table-column label="活动地点" width="193">
<template slot-scope="scope">
<div class="cell_color">{{scope.row.address}}</div>
</template>
</el-table-column>
<el-table-column label="活动时间" align="center" width="193">
<template slot-scope="scope">
<div class="cell_color">{{scope.row.starttime}}</div>
<div class="cell_color">{{scope.row.endtime}}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="224px">
<template slot-scope="scope">
<div
v-show="groupId == 1"
class="operation"
@click="activeOperate(scope.row)"
:class="{sign_up:scope.row.button_status == 2,input_exp:scope.row.button_status == 3}"
>{{scope.row.button_status == 1 ?"查看活动":scope.row.button_status == 2?"已报名":scope.row.button_status == 4?"查看心得":"录入心得"}}</div>
<div
v-show="groupId == 2"
class="operation"
@click="activeOperate(scope.row)"
>{{scope.row.status==0?"未参与":scope.row.status==1?"已参与":scope.row.button_status == 4?"查看心得":"查看活动"}}</div>
</template>
</el-table-column>
</el-table>
<!-- 查看活动弹窗 -->
<ActiveDialog :activeVisible.sync="activeVisible" v-if="activeVisible" :activityId="activityId"></ActiveDialog>
<!-- 录入心得弹窗 -->
<ExpDialog :expVisible.sync="expVisible" v-if="expVisible" :activityId="activityId"></ExpDialog>
<!-- 录入心得后弹窗 -->
<ExpedDialog :expedVisible.sync="expedVisible" v-if="expedVisible" :activityId="activityId"></ExpedDialog>
</div>
</template>
<script>
// 查看活动弹窗
import ActiveDialog from "./ActiveDialog";
// 录入心得弹窗
import ExpDialog from "./ExpDialog";
// 录入心得后弹窗
import ExpedDialog from "./ExpedDialog";
import { post } from "@/api/http";
export default {
data() {
return {
// 查看活动弹窗
activeVisible: false,
activityId: "",
// 录入心得弹窗
expVisible: false,
// 录入心得后弹窗
expedVisible: false,
activityData: [],
id: "",
// 角色判断
groupId: ""
};
},
methods: {
// 表头样式
changeHeader({ row, rowIndex }) {
if (rowIndex == 0) {
return "background-color:#f1f1f1;color:#5B5E63!important;font-weight:400";
}
},
activeOperate(row) {
this.activityId = row.id;
if (this.groupId == 1) {
if (row.button_status == 1) {
// 查看活动
this.activeVisible = true;
} else if (row.button_status == 3) {
// 录入心得
this.expVisible = true;
} else if (row.button_status == 4) {
this.expedVisible = true;
}
} else if (this.groupId == 2) {
if (row.status == 2) {
this.expedVisible = true;
}
}
},
// 学生活动列表
getActivityList() {
let url = "/api/activity/getActivityList";
post(url).then(res => {
this.activityData = res.activity_list;
});
}
},
components: {
ActiveDialog,
ExpDialog,
ExpedDialog
},
mounted() {
this.groupId = localStorage.getItem("groupId");
this.getActivityList();
}
};
</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;
}
</style>