You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.1 KiB

3 years ago
<template>
<div class="header">
<div class="logo">
<img src="/images/logo.png" />
南京生态环境评估决策平台
</div>
<div class="nav">
3 years ago
<div class="nav-item">
<router-link to="/MicrowaveRadiation">微波辐射计</router-link>
</div>
<div class="nav-item">
<router-link to="/RamanLidar">拉曼激光雷达</router-link>
</div>
<div class="nav-item">
<router-link to="/SynergyEvaluation">生态环境效应评估</router-link>
</div>
<div class="nav-item">
<router-link to="/DecisionSupport">决策支持</router-link>
</div>
<div class="nav-item">
<router-link to="/SystemManagement">系统管理</router-link>
</div>
3 years ago
</div>
3 years ago
<span @click="Logout">退出登录</span>
3 years ago
3 years ago
</div>
</template>
<script lang="ts">
3 years ago
import { reactive, onMounted, toRefs } from "vue";
import { useRouter } from 'vue-router';
3 years ago
import { clear } from "../../uilts/storage";
3 years ago
export default {
name: 'Header',
setup() {
const router = useRouter();
let options = reactive({
currentPath: 'MicrowaveRadiation'
})
3 years ago
const onNavClick = (path) => {
options.currentPath = path;
router.push({path: path});
}
3 years ago
const Logout = () => {
clear()
router.replace('/Login')
}
3 years ago
return {
...toRefs(options),
onNavClick,
Logout
3 years ago
}
}
3 years ago
}
</script>
<style lang="less" scoped>
.header {
width: 100%;
3 years ago
height: 0.84rem;
3 years ago
display: flex;
align-items: center;
color: #ffffff;
3 years ago
span{
padding: 10px;
cursor: pointer;
background-color: #498DF0;
border-radius: 10px;
}
3 years ago
.logo {
3 years ago
margin-left: 0.2rem;
3 years ago
display: flex;
align-items: center;
letter-spacing: 2px;
3 years ago
font-size: 0.3rem;
3 years ago
font-weight: bold;
img {
3 years ago
width: 0.53rem;
margin-right: 0.1rem;
3 years ago
}
}
.nav {
3 years ago
margin: 0.17rem 0 0 0.5rem;
3 years ago
display: flex;
3 years ago
font-size: 0.22rem;
3 years ago
.nav-item {
3 years ago
width: 1.7rem;
height: 0.66rem;
margin: 0 0.25rem;
line-height: 0.5rem;
3 years ago
text-align: center;
cursor: pointer;
3 years ago
a {
height: 100%;
color: #ffffff;
}
3 years ago
&:nth-of-type(3) {
3 years ago
width: 2.3rem;
3 years ago
.active {
3 years ago
background: url("/images/nav-bg-big.png") no-repeat center/cover;
}
}
3 years ago
.active {
color: #23FBFF;
3 years ago
background: url("/images/nav-bg.png") no-repeat center/cover;
}
}
}
}
</style>