dbsd_kczx/src/views/site/common/header.vue

109 lines
2.3 KiB
Vue
Raw Normal View History

<template>
<a-layout-header>
<!-- <BackTop/> -->
2023-04-06 00:45:01 +08:00
<div id="topDiv">
<div class="topButton" @click="toTop">
<ArrowUpOutlined/>
</div>
2023-04-09 20:14:19 +08:00
<div class="topYiJianFanKui" @click="funYjfk">
意见反馈
</div>
</div>
<span class="topTitle">管理系统</span>
<span class="topRight">
<a-dropdown>
<span class="ant-dropdown-link topRightMenu" @click.prevent>
{{ userStore?.getUserInfo?.realname }}
<DownOutlined/>
</span>
<template #overlay>
<a-menu>
<a-menu-item>
<!-- <a href="javascript:;">后台管理</a> -->
<RouterLink to="/dashboard/analysis">后台管理</RouterLink>
</a-menu-item>
<a-menu-item>
<a href="javascript:void(0);" @click="userStore?.confirmLoginOut();">安全退出</a>
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</span>
2023-04-09 20:14:19 +08:00
<YjfkModal ref="YjfkModalTab"></YjfkModal>
</a-layout-header>
</template>
<script setup lang="ts">
2023-04-09 20:14:19 +08:00
import { ref } from 'vue';
2023-04-03 23:56:45 +08:00
import { DownOutlined, ArrowUpOutlined } from '@ant-design/icons-vue';
import { useUserStore } from '/@/store/modules/user';
2023-04-09 20:14:19 +08:00
import YjfkModal from '/@/views/site/yjfk/YjfkModal.vue';
const YjfkModalTab = ref();
//用户相关
const userStore = useUserStore();
2023-04-06 00:45:01 +08:00
function smoothScroll(topNum){
setTimeout(() => {
if(topNum > 0){
topNum = topNum - 50;
document.body.scrollTop = topNum;
smoothScroll(topNum);
}
},1);
}
function toTop(){
let topNum = document.body.scrollTop;
smoothScroll(topNum);
}
2023-04-09 20:14:19 +08:00
/**
* 意见反馈
*/
function funYjfk(){
YjfkModalTab.value.add()
}
2023-04-03 23:56:45 +08:00
</script>
<style lang="less" scoped>
#siteMain {
#maxSite {
.topTitle {
font-size: 1.5rem;
}
.topRight {
float: right;
.topRightMenu {
font-size: 1.1rem;
}
}
.footerRight {
float: right;
}
}
}
2023-04-06 00:45:01 +08:00
#topDiv {
position: absolute;
right: 1rem;
top: 5rem;
z-index: 1;
.topButton {
background: #c2c2c2;
margin-bottom: 2rem;
padding: 0.5rem;
width: 4rem;
font-size:3rem;
}
.topYiJianFanKui {
background: #1c84c6;
color:#FFF;
font-size:1.5rem;
padding: 0.5rem;
width: 4rem;
line-height: 2.1rem;
}
}
2023-04-03 23:56:45 +08:00
</style>