index.vue
1.54 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
<template>
<el-scrollbar wrap-class="scrollbar-wrapper">
<div class="admin-title" @click="goBigScreen">
<div class="con">
<img src="../../../../../static/logo-dp.png" width="50" />
<span class="version">V2023.1</span>
</div>
</div>
<el-menu
:show-timeout="200"
:default-active="$route.path"
:collapse="isCollapse"
mode="vertical"
>
<sidebar-item
v-for="route in routes"
:key="route.path"
:item="route"
:base-path="route.path"
/>
</el-menu>
</el-scrollbar>
</template>
<script>
import { mapGetters } from "vuex";
import SidebarItem from "./SidebarItem";
export default {
components: { SidebarItem },
computed: {
...mapGetters(["sidebar"]),
routes() {
return this.$router.options.routes;
},
isCollapse() {
return !this.sidebar.opened;
}
},
methods: {
goBigScreen() {
let routeUrl = this.$router.resolve({
path: "/report/bigScreen"
});
window.open(routeUrl.href, "_blank");
}
}
};
</script>
<style lang="scss" scoped>
.admin-title {
// height: 60px;
// line-height: 60px;
text-align: center;
width: 100%;
font-weight: 500;
color: #333;
font-size: 14px;
background: #fff;
.con {
margin: auto;
img {
margin-top: 10px;
}
.version {
display: inline-block;
font-size: 12px;
color: #fff;
background: #4FADFD;
padding: 2px;
border-radius: 10px;
}
}
}
.admin-title:hover {
cursor: pointer;
}
</style>