<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>
|