configureCourse.vue
4.12 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
<!-- 配置课程 -->
<template>
<div class="configureCourse">
<div class="left-wrap">
<div class="header">
<img class="staff-icon" src="../../images/staff-icon.png" alt="" />
<div class="title">
员工列表
<div class="num">共7人,已配置1人</div>
</div>
</div>
<div class="staff-list">
<div
v-for="(item, index) in staffList"
:key="item.id"
:class="['staff-item', staffIndex == index ? 'active' : '']"
@click="handleClick(index)"
>
{{ item.name }}
<div class="config" v-if="item.isConfig">已配置</div>
</div>
</div>
</div>
<div class="right-wrap">
<div class="nav-tabs">
<div
:class="['nav-item', activeName == index ? 'active' : '']"
v-for="(item, index) in tabPaneList"
:key="index"
@click="handleTabClick(index)"
>
{{ item.label }}
</div>
</div>
<components :is="tabName"></components>
</div>
</div>
</template>
<script>
import staffDetail from "./staffDetail"
import couseAllocation from "./couseAllocation"
export default {
name: "configureCourse",
components: { staffDetail, couseAllocation },
data() {
return {
staffIndex: 0,
activeName: "0",
tabPaneList: [
{
label: "员工详情"
},
{
label: "课程配置"
}
],
tabName: "staffDetail",
staffList: [
{
name: "王小虎",
isConfig: true,
id: 1
},
{
name: "李小宣",
isConfig: true,
id: 1
},
{
name: "胡明星",
isConfig: true,
id: 1
},
{
name: "郝怡逸",
isConfig: true,
id: 1
}
]
}
},
methods: {
handleClick(index) {
this.staffIndex = index
},
handleTabClick(index) {
this.activeName = index
const arr = {
0: "staffDetail",
1: "couseAllocation"
}
this.tabName = arr[+this.activeName]
}
}
}
</script>
<style lang="scss" scoped>
.configureCourse {
display: flex;
margin: 0 20px;
.left-wrap {
min-width: 200px;
width: 200px;
height: 988px;
background: #ffffff;
margin-right: 16px;
.header {
display: flex;
align-items: flex-start;
margin: 12px 0 8px 13px;
.staff-icon {
width: 16px;
height: 16px;
margin-right: 8px;
margin-top: 3px;
}
.title {
color: #333333;
font-size: 16px;
font-weight: 400;
.num {
color: #999999;
font-size: 12px;
font-weight: 400;
margin-top: 2px;
}
}
}
.staff-list {
height: calc(100% - 62px);
overflow-y: auto;
.staff-item {
color: #666666;
font-size: 16px;
font-weight: 400;
padding: 10px 12px 10px 36px;
position: relative;
.config {
position: absolute;
border-radius: 2px;
border: 1px solid #2cca74;
background: #e9eef7;
padding: 4px 8px;
color: #2cca74;
font-size: 12px;
font-weight: 500;
top: 10px;
right: 12px;
}
}
.active {
color: #2a58ad;
background: #e9eef7;
border-right: 3px solid #2a58ad;
}
}
}
.right-wrap {
width: calc(100% - 216px);
.nav-tabs {
display: flex;
align-items: center;
.nav-item {
width: 112px;
height: 44px;
border-radius: 4px 4px 0 0;
color: #666666;
font-size: 16px;
font-weight: 400;
line-height: 44px;
box-sizing: border-box;
text-align: center;
margin-right: 2px;
border: 1px solid #e5e5e5;
background: #f8f8f8;
}
.active {
color: #2a58ad;
font-size: 16px;
font-weight: 500;
border: 1px solid #e5e5e5;
background: #ffffff;
}
}
// background: #ffffff;
}
}
</style>