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
| <template>
| <div class="main">
| <div class="header">
| <div class="top">金川水电站生态流量监测系统 </div>
| <div class="nav">
| <div v-for="(item,index) in btnList" :key="index" @click="navTo(item)" class="plain" :class="item.url === route.path ? 'active' : ''">{{ item.name }}</div>
| </div>
| </div>
| <div class="content">
| <router-view></router-view>
| </div>
| </div>
| </template>
| <script setup>
| import{ useRouter,useRoute } from 'vue-router'
|
| const router = useRouter()
| const route = ref(useRoute())
| const btnList = ref([
| {name:'总览',url:'/temp/home'},
| {name:'设备管理',url:''},
| {name:'实时监测', url:''},
| {name:'图形分析',url:''},
| {name:'汇总统计',url:''},
| {name:'报表管理',url:''},
| {name:'系统管理',url:'/user'},
| ])
| const navTo = (item) =>{
| router.push(item.url)
| }
|
| </script>
|
| <style lang="scss" scoped>
| .main{
| width: 100%;
| height: 100%;
| .header{
| width: 100%;
| height: 14%;
| .top{
| height: 60%;
| display: flex;
| align-items: center;
| justify-content: center;
| font-size: 38px;
| font-weight: 700;
| color: #fff;
| }
| .nav{
| display: flex;
| height: 40%;
| .plain{
| flex-grow: 1;
| height: 100%;
| display: flex;
| align-items: center;
| justify-content: center;
| border: 1px solid #fff;
| background-color: rgba(23, 108, 229, 0.3);
| color: #fff;
| font-size: 22px;
| cursor: pointer;
| }
| .active{
| background-color: #91BDDB;
| }
| }
| }
| .content{
| width: 100%;
| height: 86%;
| }
| }
| </style>
|
|