forked from Hoogkamer/vue-org-chart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSideScreen.vue
128 lines (119 loc) · 2.61 KB
/
SideScreen.vue
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
<template lang='pug'>
.side-screen(v-if="showSideScreen")
button.right(v-on:click="$store.commit('closeSideScreen')")
i.material-icons.arrow keyboard_arrow_left
template(v-if="activeDepartment")
.title {{activeDepartment.name}}
.tabs
button.tab(:class='{active:activeTab===1}' v-on:click='activeTab=1') {{uiNames.sidebar.detailTabName}}
button.tab(:class='{active:activeTab===2}' v-on:click='activeTab=2') {{uiNames.sidebar.peopleTabName}}
department-details(v-if="activeTab===1")
employee-list(v-if='activeTab===2')
.noside-screen(v-else)
button.right(v-on:click="$store.commit('openSideScreen')")
i.material-icons.arrow keyboard_arrow_right
</template>
<script>
import { mapState, mapActions, mapMutations } from 'vuex'
import EmployeeList from '~/components/EmployeeList.vue'
import DepartmentDetails from '~/components/DepartmentDetails.vue'
export default {
components: { EmployeeList, DepartmentDetails },
data: function() {
return {
personPicker: null,
activeTab: 1,
noPhotos: []
}
},
computed: {
...mapState([
'showSideScreen',
'activeDepartment',
'people',
'config',
'uiNames'
])
},
methods: {
...mapActions(['setShowDepartment']),
...mapMutations(['setShowPerson', 'updateRole'])
}
}
</script>
<style scoped>
.title {
text-align: center;
min-height: 50px;
margin-bottom: 10px;
font-size: 20px;
font-weight: 600;
width: calc(100% - 30px);
}
.name {
font-size: 16px;
}
.role {
color: grey;
font-size: 14px;
}
.tabs {
width: 100%;
margin-bottom: 20px;
padding: 0px 10px;
border-bottom: 2px solid lightgrey;
}
.tab {
width: 120px;
margin: 0px 0px 0px 0px;
border: none;
background: none;
margin-bottom: -2px;
border-bottom: 2px solid transparent;
outline: none;
cursor: pointer;
}
.tab.active {
border: 2px solid lightgrey;
border-top-left-radius: 7px;
border-top-right-radius: 7px;
background-color: lightgrey;
}
input.name {
width: calc(100% - 10px);
}
.side-screen {
position: fixed;
left: 0px;
top: 50px;
width: 300px;
height: 100vh;
border-right: 0px solid lightgrey;
background-color: #f9f5f5;
padding: 5px;
overflow: auto;
padding-bottom: 80px;
}
.noside-screen {
position: fixed;
left: 0px;
top: 50px;
width: 25px;
height: 45px;
border: 0px solid lightgray;
background-color: #f9f5f5;
z-index: 9;
}
.right {
position: absolute;
right: 0px;
top: 10px;
background-color: transparent;
border: 0px solid grey;
padding: 1px;
cursor: pointer;
}
.right:focus {
outline: none;
}
</style>