Navbar.vue
9.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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<template>
<div class="navbar main-size">
<logo />
<!-- <el-scrollbar class="nav-scrollbar">
<template v-for="(route, index) in permission_routes">
<div
v-if="!route.hidden"
:class="['nav', $route.path.startsWith(route.path) && 'active']"
:key="route.path + index"
@click="goLink(route.path)"
>
{{ route.meta && route.meta.title }}
</div>
</template>
</el-scrollbar> -->
<top-nav />
<div class="right-menu mr10">
<template v-if="device !== 'mobile'">
<!-- <search id="header-search" class="right-menu-item" /> -->
<!-- <el-popover placement="right" width="300" trigger="hover">
<div class="hover-class">
<span>扫码联系专属客服</span>
<img :src="customerServiceQr" alt="" />
<span>立马扫码一对一答疑</span>
</div>
<div class="right-menu-item hover-effect" slot="reference" style="font-size:24px">
<svg-icon class="right-icon" iconClass="customer-service"></svg-icon>
</div>
</el-popover> -->
<!-- <el-tooltip content="企业微信-管理后台" effect="dark" placement="bottom">
<div class="right-menu-item hover-effect">
<svg-icon
class="right-icon"
iconClass="qiyeweixin"
style="color: #0082f0"
@click="goto('https://work.weixin.qq.com/wework_admin/loginpage_wx?from=myhome_baidu')"></svg-icon>
</div>
</el-tooltip>
<el-tooltip content="源码地址" effect="dark" placement="bottom">
<div class="right-menu-item hover-effect">
<svg-icon class="right-icon" icon-class="gitee" @click="goto('https://gitee.com/LinkWeChat/link-wechat')" />
</div>
</el-tooltip>
<el-tooltip content="LinkWeChat官网" effect="dark" placement="bottom">
<div class="right-menu-item hover-effect">
<i class="el-icon-link right-icon" @click="goto('https://www.linkwechat.net/')" />
</div>
</el-tooltip>
<el-tooltip content="文档手册" effect="dark" placement="bottom">
<div class="right-menu-item hover-effect">
<i class="el-icon-reading document right-icon" @click="goto('https://www.yuque.com/linkwechat/help')"></i>
</div>
</el-tooltip>
<el-tooltip content="功能清单" effect="dark" placement="bottom">
<div class="right-menu-item hover-effect">
<i
class="el-icon-tickets right-icon"
@click="goto('https://docs.qq.com/sheet/DZW9HSHpHdWlOYWh2?tab=BB08J3')"></i>
</div>
</el-tooltip>
<el-tooltip content="需求墙" effect="dark" placement="bottom">
<div class="right-menu-item hover-effect">
<i
class="el-icon-data-board right-icon"
@click="goto('https://docs.qq.com/sheet/DZWxGU0JGVFRVdWZV?tab=BB08J2')"></i>
</div>
</el-tooltip> -->
<!-- <screenfull id="screenfull" class="right-menu-item hover-effect" /> -->
<el-tooltip :content="lwConfig.V5_VERSION" effect="light" placement="bottom">
<div class="right-menu-item hover-effect">
<i class="right-icon" @click="goto('/vue3')">v5</i>
</div>
</el-tooltip>
</template>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper">
<img :src="avatar" class="user-avatar" />
<div title="仟微" class="user-name toe">{{ name }}</div>
<i class="el-icon-arrow-down" />
</div>
<el-dropdown-menu slot="dropdown">
<router-link to="/user/profile">
<el-dropdown-item>个人中心</el-dropdown-item>
</router-link>
<!-- <el-dropdown-item divided @click.native="setting = true">
<span>布局设置</span>
</el-dropdown-item> -->
<el-dropdown-item @click.native="logout">
<span>退出登录</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<el-popover placement="left" title="" trigger="hover">
<div slot="reference" class="contact-us">
<svg-icon class="contact-us-icon cc" icon-class="wechat" />
</div>
<div class="ac">
<img :src="lwConfig.QRCODE_CONTACT_US" class="contact-code" alt="" />
<div class="nav-li">微信扫码咨询</div>
</div>
</el-popover>
</div>
</template>
<script>
import { isExternal } from '@/utils/validate'
import { mapGetters } from 'vuex'
import Logo from './Logo'
// import { getCustomerServiceQrUrl } from "@/api/login";
// import Search from '@/components/HeaderSearch'
// import screenfull from '@/components/Screenfull'
import TopNav from './TopNav'
export default {
data() {
return {
customerServiceQr: '',
}
},
components: {
Logo,
// Search,
// screenfull,
TopNav,
},
computed: {
...mapGetters(['avatar', 'name', 'device', 'permission_routes']),
setting: {
get() {
return this.$store.state.settings.showSettings
},
set(val) {
this.$store.dispatch('settings/changeSetting', {
key: 'showSettings',
value: val,
})
},
},
},
mounted() {
// console.log(this.permission_routes)
// getCustomerServiceQrUrl().then((res) => {
// this.customerServiceQr = res.data;
// localStorage.setItem('customerServiceQr',res.data)
// });
},
methods: {
async logout() {
this.$confirm('确定注销并退出系统吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = window.lwConfig.BASE_URL
})
})
},
goto(url) {
window.open(url)
},
goLink(path) {
if (!isExternal(path)) {
this.$router.push({ path })
} else {
window.open(path, '_blank')
}
},
},
}
</script>
<style lang="scss" scoped>
.hover-class {
display: flex;
flex-direction: column;
align-items: center;
span:nth-child(1) {
font-size: 18px;
font-weight: bold;
line-height: 36px;
margin-bottom: 10px;
}
img {
width: 160px;
height: 160px;
}
span:nth-child(3) {
font-size: 14px;
line-height: 16px;
margin-top: 20px;
}
}
.right-icon {
font-size: 20px;
}
//
.navbar {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
color: #1d2129;
.errLog-container {
display: inline-block;
vertical-align: top;
}
.right-menu {
// position: absolute;
// right: 0;
flex: none;
background: #fff;
&:focus {
outline: none;
}
.right-menu-item {
display: inline-block;
padding: 0 0 0 min(2vw - 20px, 15px);
// color: #5a5e66;
vertical-align: middle;
&.hover-effect {
cursor: pointer;
transition: background 0.3s;
// &:hover {
// background: rgba(0, 0, 0, 0.025);
// }
}
}
.avatar-container {
// margin-right: 30px;
.avatar-wrapper {
position: relative;
.user-avatar {
---temp: #fafafa;
display: inline-block;
position: relative;
width: 34px;
height: 34px;
border-radius: 8px;
vertical-align: middle;
// background: var(---temp);
border: 1px solid var(---temp);
}
.user-name {
display: inline-block;
max-width: 100px;
vertical-align: middle;
font-weight: 500;
margin-left: 8px;
}
.el-icon-arrow-down {
margin-left: 3px;
font-size: 12px;
color: #000;
}
}
}
}
}
// .nav-scrollbar {
// width: calc(100% - 450px);
// ::v-deep.el-scrollbar__view {
// white-space: nowrap;
// line-height: 58px;
// }
// .nav {
// display: inline-block;
// margin: 0 20px;
// flex: none;
// position: relative;
// cursor: pointer;
// &.active::after {
// content: '';
// display: inline-block;
// position: absolute;
// bottom: 2px;
// width: 42px;
// height: 2px;
// left: 50%;
// transform: translateX(-50%);
// border-radius: 6px;
// background: #fff;
// }
// }
// }
.contact-us {
position: fixed;
top: 60%;
width: 100px;
height: 100px;
z-index: 9;
right: 28px;
width: 50px;
height: 50px;
background: linear-gradient(225deg, var(--color-sub) 0%, var(--color) 100%);
box-shadow: 0px 4px 20px 0px rgba(28, 49, 111, 0.1);
border-radius: 50%;
// background: #fff;
// color: var(--color);
.contact-us-icon {
color: #fff;
// color: inherit;
font-size: 30px;
}
// &:hover {
// color: #fff;
// background: linear-gradient(225deg, var(--color-sub) 0%, var(--color) 100%);
// transition: all 0.3s;
// }
}
.contact-code {
width: 118px;
}
</style>