|
@@ -6,17 +6,17 @@
|
|
|
|
|
|
<div class="right-menu">
|
|
|
<template v-if="device!=='mobile'">
|
|
|
- <!-- <search id="header-search" class="right-menu-item" /> -->
|
|
|
+ <!-- <search id="header-search" class="right-menu-item" />
|
|
|
|
|
|
-<!-- <el-tooltip content="项目文档" effect="dark" placement="bottom">
|
|
|
+ <el-tooltip content="项目文档" effect="dark" placement="bottom">
|
|
|
<Doc class="right-menu-item hover-effect" />
|
|
|
</el-tooltip> -->
|
|
|
|
|
|
- <el-tooltip content="全屏缩放" effect="dark" placement="bottom">
|
|
|
+ <!-- <el-tooltip content="全屏缩放" effect="dark" placement="bottom">
|
|
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
|
|
- </el-tooltip>
|
|
|
+ </el-tooltip> -->
|
|
|
|
|
|
-<!-- <el-tooltip content="布局设置" effect="dark" placement="bottom">
|
|
|
+ <!-- <el-tooltip content="布局设置" effect="dark" placement="bottom">
|
|
|
<size-select id="size-select" class="right-menu-item hover-effect" />
|
|
|
</el-tooltip> -->
|
|
|
|
|
@@ -24,11 +24,13 @@
|
|
|
|
|
|
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
|
|
<div class="avatar-wrapper">
|
|
|
- <img :src="user.avatarName ? baseApi + '/avatar/' + user.avatarName : Avatar" class="user-avatar">
|
|
|
+ <!-- <img :src="user.avatarName ? baseApi + '/avatar/' + user.avatarName : Avatar" class="user-avatar"> -->
|
|
|
+ <span>{{ time }}</span>
|
|
|
+ <span style="margin-left: 30px;">{{ user.user.nickName }}</span>
|
|
|
<i class="el-icon-caret-bottom" />
|
|
|
</div>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
-<!-- <span style="display:block;" @click="show = true">
|
|
|
+ <!-- <span style="display:block;" @click="show = true">
|
|
|
<el-dropdown-item>
|
|
|
布局设置
|
|
|
</el-dropdown-item>
|
|
@@ -50,28 +52,30 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { mapGetters } from 'vuex'
|
|
|
+import { mapGetters, mapState } from 'vuex'
|
|
|
import Breadcrumb from '@/components/Breadcrumb'
|
|
|
import Hamburger from '@/components/Hamburger'
|
|
|
-import Doc from '@/components/Doc'
|
|
|
-import Screenfull from '@/components/Screenfull'
|
|
|
-import SizeSelect from '@/components/SizeSelect'
|
|
|
-import Search from '@/components/HeaderSearch'
|
|
|
+// import Doc from '@/components/Doc'
|
|
|
+// import Screenfull from '@/components/Screenfull'
|
|
|
+// import SizeSelect from '@/components/SizeSelect'
|
|
|
+// import Search from '@/components/HeaderSearch'
|
|
|
import Avatar from '@/assets/images/avatar.png'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
Breadcrumb,
|
|
|
- Hamburger,
|
|
|
- Screenfull,
|
|
|
- SizeSelect,
|
|
|
- Search,
|
|
|
- Doc
|
|
|
+ Hamburger
|
|
|
+ // Screenfull,
|
|
|
+ // SizeSelect,
|
|
|
+ // Search,
|
|
|
+ // Doc
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
Avatar: Avatar,
|
|
|
- dialogVisible: false
|
|
|
+ dialogVisible: false,
|
|
|
+ timer: null,
|
|
|
+ time: ''
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -81,6 +85,9 @@ export default {
|
|
|
'user',
|
|
|
'baseApi'
|
|
|
]),
|
|
|
+ ...mapState([
|
|
|
+ 'user'
|
|
|
+ ]),
|
|
|
show: {
|
|
|
get() {
|
|
|
return this.$store.state.settings.showSettings
|
|
@@ -93,6 +100,13 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getTime()
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ clearTimeout(this.timer)
|
|
|
+ this.timer = null
|
|
|
+ },
|
|
|
methods: {
|
|
|
toggleSideBar() {
|
|
|
this.$store.dispatch('app/toggleSideBar')
|
|
@@ -110,6 +124,22 @@ export default {
|
|
|
this.$store.dispatch('LogOut').then(() => {
|
|
|
location.reload()
|
|
|
})
|
|
|
+ },
|
|
|
+ getTime() {
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
+ const date = new Date()
|
|
|
+ const year = date.getFullYear() // 年
|
|
|
+ const month = date.getMonth() + 1 // 月
|
|
|
+ const day = date.getDate() // 日
|
|
|
+ let hour = date.getHours() // 时
|
|
|
+ hour = hour < 10 ? '0' + hour : hour // 如果只有一位,则前面补零
|
|
|
+ let minute = date.getMinutes() // 分
|
|
|
+ minute = minute < 10 ? '0' + minute : minute // 如果只有一位,则前面补零
|
|
|
+ let second = date.getSeconds() // 秒
|
|
|
+ second = second < 10 ? '0' + second : second // 如果只有一位,则前面补零
|
|
|
+ this.time = `${year}年${month}月${day}日 ${hour}:${minute}:${second}`
|
|
|
+ requestAnimationFrame(this.getTime.bind(this))
|
|
|
+ }, 1000)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -178,6 +208,10 @@ export default {
|
|
|
.avatar-wrapper {
|
|
|
margin-top: 5px;
|
|
|
position: relative;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 14px;
|
|
|
|
|
|
.user-avatar {
|
|
|
cursor: pointer;
|
|
@@ -188,10 +222,11 @@ export default {
|
|
|
|
|
|
.el-icon-caret-bottom {
|
|
|
cursor: pointer;
|
|
|
- position: absolute;
|
|
|
- right: -20px;
|
|
|
- top: 25px;
|
|
|
- font-size: 12px;
|
|
|
+ // position: absolute;
|
|
|
+ // right: -20px;
|
|
|
+ // top: 25px;
|
|
|
+ font-size: 16px;
|
|
|
+ margin-left: 10px;
|
|
|
}
|
|
|
}
|
|
|
}
|