<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 class="userIcon" :class="{on: userOn == true}" @click="openUser">
|
<div class="userDetail" v-if="isShowUserDetail">
|
<div class="triangle"></div>
|
<div class="userName">用户名:{{userName}}</div>
|
<div class="userBtn">
|
<div class="edit" @click="goTOLogin">
|
>
|
<img src="../../../public/img/editLogin.webp" alt />
|
</div>
|
<div class="return" @click="goTOFllow">返回引导页</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="main-content">
|
<router-view></router-view>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
|
export default {
|
data () {
|
return {
|
currentPath: '',
|
userOn: false,
|
isShowUserDetail: false,
|
userName: window.localStorage.getItem('userName')
|
}
|
},
|
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)
|
}
|
},
|
openUser () {
|
this.userOn = !this.userOn
|
this.isShowUserDetail = !this.isShowUserDetail
|
},
|
goTOLogin () {
|
window.location.href = 'http://dev.jxpskj.com:8020/ncny/login.html'
|
// this.$router.push({ path: '/login' })
|
},
|
goTOFllow () {
|
window.location.href = 'http://dev.jxpskj.com:8020/ncny/systemwall2/index.html'
|
}
|
}
|
}
|
</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(../../../public/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(../../../public/img/select.png) no-repeat;
|
background-size: 100% 100%;
|
}
|
|
.nav.on {
|
background: url(../../../public/img/selected.png) no-repeat;
|
background-size: 100% 100%;
|
}
|
}
|
|
.r {
|
margin-right: 12px;
|
display: flex;
|
|
.nav {
|
margin-right: 16px;
|
background: url(../../../public/img/right-select.png)
|
no-repeat;
|
background-size: 100% 100%;
|
}
|
|
.nav.on {
|
background: url(../../../public/img/right-selected.png)
|
no-repeat;
|
background-size: 100% 100%;
|
}
|
.userIcon {
|
height: 40px;
|
width: 40px;
|
border-radius: 50%;
|
margin-top: 4px;
|
cursor: pointer;
|
background: url(../../../public/img/icon/user.png) no-repeat;
|
background-size: 100% 100%;
|
box-shadow: inset 2px 2px 10px #0e7894,
|
inset -2px -2px 10px #0e7894;
|
.userDetail {
|
width: 240px;
|
height: 92px;
|
position: absolute;
|
top: 64px;
|
right: 4px;
|
background: rgba(3, 82, 102, 0.8);
|
border-radius: 8px;
|
cursor: default;
|
|
.triangle {
|
position: absolute;
|
top: -16px;
|
right: 20px;
|
// background-color: red;
|
width: 0px;
|
height: 0px;
|
border: 8px solid #000;
|
border-top-color: transparent;
|
border-bottom-color: rgba(3, 82, 102, 0.8);
|
border-left-color: transparent;
|
border-right-color: transparent;
|
}
|
.userName {
|
width: 100%;
|
height: 40px;
|
font-size: 14px;
|
font-weight: 500;
|
color: #6de9f3;
|
line-height: 22px;
|
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
|
position: absolute;
|
top: 0px;
|
}
|
.userBtn {
|
width: 100%;
|
height: 50px;
|
position: absolute;
|
bottom: 0px;
|
display: flex;
|
justify-content: space-around;
|
|
& > div {
|
width: 100px;
|
height: 40px;
|
background-color: rgba(109, 233, 243, 1);
|
border-radius: 4px;
|
cursor: pointer;
|
|
img {
|
width: 76px;
|
height: 20px;
|
}
|
}
|
.return {
|
margin-left: -10px;
|
color: #198592;
|
font-size: 14px;
|
}
|
}
|
}
|
}
|
.userIcon.on {
|
box-shadow: inset 2px 2px 10px #00f6ff,
|
inset -2px -2px 10px #00f6ff;
|
}
|
}
|
|
.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>
|