智慧农业大数据平台
1
guanqb
2022-07-21 f9812ca20f1a34809057fdcd8564f7c495fc9693
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
<template>
    <div class="wrapper">
        <div class="main-header">
            <div class="bg"></div>
            <div class="content" @click="goToPath($event)">
                <div class="l">
                    <div
                        class="nav"
                        :class="{on: currentPath == '/lyout/home'}"
                        :data-path="'/lyout/home'"
                    >首页</div>
                    <div
                        class="nav"
                        :class="{on: currentPath == '/lyout/monitor'}"
                        :data-path="'/lyout/monitor'"
                    >遥感监测</div>
                </div>
                <div class="c">南城县智慧农业综合监管平台</div>
                <div class="r">
                    <div
                        class="nav"
                        :class="{on: currentPath == '/lyout/manage'}"
                        :data-path="'/lyout/manage'"
                    >经营概况</div>
                    <div
                        class="nav"
                        :class="{on: currentPath == '/lyout/weather'}"
                        :data-path="'/lyout/weather'"
                    >气象监测</div>
                </div>
            </div>
        </div>
        <div class="main-content">
            <router-view></router-view>
        </div>
    </div>
</template>
 
<script>
export default {
    data () {
        return {
            currentPath: ''
        }
    },
    mounted () {
        this.currentPath = this.$route.path
    },
    methods: {
        goPath (path) {
            if (path == this.currentPath) return
            this.currentPath = path
            this.$router.push(path)
        },
        goToPath (e) {
            if (e.target.dataset.path && e.target.dataset.path != '') {
                if (e.target.dataset.path == this.currentPath) return
                this.currentPath = e.target.dataset.path
                this.$router.push(e.target.dataset.path)
            }
        }
    }
}
</script>
 
<style scoped lang="scss">
.wrapper {
    width: 100%;
    height: 100%;
 
    .main-header {
        position: relative;
 
        height: 70px;
        z-index: 10;
 
        .bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 76px;
            background: url(/img/header-bg.png) no-repeat;
            background-size: auto 100%;
            z-index: 1;
        }
 
        .content {
            position: absolute;
            top: 0;
            left: 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            height: 100%;
            z-index: 11;
 
            .l {
                margin-left: 32px;
                display: flex;
 
                .nav {
                    margin-left: 16px;
                    background: url(/img/select.png) no-repeat;
                    background-size: 100% 100%;
                }
 
                .nav.on {
                    background: url(/img/selected.png) no-repeat;
                    background-size: 100% 100%;
                }
            }
 
            .r {
                margin-right: 32px;
                display: flex;
 
                .nav {
                    margin-right: 16px;
                    background: url(/img/right-select.png) no-repeat;
                    background-size: 100% 100%;
                }
 
                .nav.on {
                    background: url(/img/right-selected.png) no-repeat;
                    background-size: 100% 100%;
                }
            }
 
            .c {
                font-size: 35px;
                font-weight: bold;
                color: #fff;
            }
 
            .l div,
            .r div {
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 20px;
                font-weight: bold;
                color: #66dde9;
            }
 
            .nav {
                width: 200px;
                height: 50px;
                cursor: pointer;
            }
        }
    }
 
    .main-content {
        width: 100%;
        height: calc(100% - 70px);
    }
}
</style>