ivy-head.vue
3.93 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
<template>
<div class="head-box" :class="{'blue-bg':skinPeeler=='def','bb-bg':skinPeeler=='bb','orange-bg':skinPeeler=='orange',}">
<img class="logo" src="@/assets/images/user-logo.svg" alt="">
<div class="user-box flex flex-pack-justify flex-align-center">
<img class="screen-img" @click="screen" src="@/assets/images/full-screen.svg">
<!-- <img class="theme-img" @click="showPop" src="@/assets/images/theme.svg"> -->
<img class="infos-img" src="@/assets/images/infos.svg">
<span>admin</span>
<img class="user-img" src="@/assets/images/user.svg" alt="">
<img class="sign-out" src="@/assets/images/sign-out.svg" alt="">
<div class="popper-box" v-show="shouPop">
<p class="pop-tit">切换主题</p>
<div class="col-box flex flex-align-center flex-pack-justify" @click="handleColorChange('def')">
<div class="color-spr color-def"></div>
<span>默认</span>
</div>
<div class="col-box flex flex-align-center flex-pack-justify" @click="handleColorChange('bb')">
<div class="color-spr"></div>
<span>青蓝</span>
</div>
<div class="col-box flex flex-align-center flex-pack-justify" @click="handleColorChange('orange')">
<div class="color-spr color-one"></div>
<span>橙黄</span>
</div>
</div>
</div>
</div>
</template>
<script>
import screenfull from 'screenfull'
export default {
data() {
return {
shouPop:false,
skinPeeler:'def',
};
},
watch: {},
mounted() {
this.initpage()
},
methods: {
initpage(){
let color='def';
if(sessionStorage.getItem('skinPeeler')){
color=sessionStorage.getItem('skinPeeler');
}
this.skinPeeler=color;
// this.$store.commit('changeSkinPeeler', color);
},
showPop(){
this.shouPop=!this.shouPop;
},
handleColorChange (color) {
this.skinPeeler=color;
// this.$store.commit('changeSkinPeeler', color);
this.shouPop=!this.shouPop;
sessionStorage.setItem('skinPeeler',color)
},
screen(){
// 如果不允许进入全屏,发出不允许提示
// if (!screenfull.enabled) {
// this.$message('您的浏览器不能全屏');
// return false
// }
screenfull.toggle();
}
}
};
</script>
<style lang="less" scoped>
/* 默认 */
.blue-bg{
background: #0C71FB !important;
}
/* 青蓝 */
.bb-bg{
background: #1AE1C5 !important;
}
/* 橙黄 */
.orange-bg{
background: #FFB701 !important;
}
.head-box {
width: 100%;
height: 52px;
.logo {
height: 22px;
width: auto;
margin-top: 15px;
margin-left: 26px;
float: left;
}
.user-box {
float: right;
margin-right: 18px;
height: 52px;
font-size: 12px;
color: #fff;
position: relative;
}
.popper-box{
position: absolute;
width: 66px;
top: 52px;
right: 134px;
background:rgba(255,255,255,1);
box-shadow:0px 1px 6px 0px rgba(0,0,0,0.24);
border-radius:2px;
border:1px solid rgba(222,222,222,1);
box-sizing: border-box;
padding: 10px 8px;
z-index: 1;
}
.pop-tit{
color: #6D7278;
font-size: 12p;
}
.col-box{
height: 12px;
margin-top: 10px;
font-size: 12px;
line-height: 12px;
color: #6D7278;
cursor: pointer;
}
.color-spr{
width: 10px;
height: 10px;
background:#1AE1C5;
border-radius:2px;
}
.color-def{
background: #0C71FB;
}
.color-one{
background: #FFB701;
}
.screen-img {
width: 17px;
height: 17px;
margin-right: 20px;
}
.theme-img {
width: 20px;
height: 20px;
margin-right: 20px;
}
.infos-img {
width: 20px;
height: 16px;
margin-right: 30px;
}
.user-img {
width: 18px;
height: 18px;
margin-left: 3px;
}
.sign-out {
width: 18px;
height: 18px;
margin-left: 12px;
}
}
</style>