|
|
|
@ -1,39 +1,39 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
import {storeToRefs} from "pinia"; |
|
|
|
import { storeToRefs } from "pinia"; |
|
|
|
import EditMyPassword from "@/layout/components/myconst/editmypassword.vue"; |
|
|
|
import {useUserStore} from "@/store/modules/user"; |
|
|
|
import {useAppStore} from "@/store/modules/app"; |
|
|
|
import {Position} from "@element-plus/icons-vue"; |
|
|
|
import { useUserStore } from "@/store/modules/user"; |
|
|
|
import { useAppStore } from "@/store/modules/app"; |
|
|
|
import { Position } from "@element-plus/icons-vue"; |
|
|
|
|
|
|
|
const userStore = useUserStore(); |
|
|
|
const appStore = useAppStore(); |
|
|
|
const {device} = storeToRefs(appStore); // 设备类型:desktop-宽屏设备 || mobile-窄屏设备 |
|
|
|
const { device } = storeToRefs(appStore); // 设备类型:desktop-宽屏设备 || mobile-窄屏设备 |
|
|
|
|
|
|
|
const myPasswordBoxIsShow = ref(false); |
|
|
|
|
|
|
|
const date: Date = new Date(); |
|
|
|
|
|
|
|
const tipsType = ref<number>(1) |
|
|
|
const tipsType = ref<number>(1); |
|
|
|
// |
|
|
|
const greetings = computed(() => { |
|
|
|
if (date.getHours() >= 6 && date.getHours() < 8) { |
|
|
|
tipsType.value = 1 |
|
|
|
tipsType.value = 1; |
|
|
|
return "晨起披衣出草堂,轩窗已自喜微凉🌅!"; |
|
|
|
} else if (date.getHours() >= 8 && date.getHours() < 12) { |
|
|
|
tipsType.value = 2 |
|
|
|
tipsType.value = 2; |
|
|
|
return "上午好🌞!"; |
|
|
|
} else if (date.getHours() >= 12 && date.getHours() < 18) { |
|
|
|
tipsType.value = 3 |
|
|
|
tipsType.value = 3; |
|
|
|
return "下午好☕!"; |
|
|
|
} else if (date.getHours() >= 18 && date.getHours() < 24) { |
|
|
|
tipsType.value = 4 |
|
|
|
tipsType.value = 4; |
|
|
|
return "晚上好🌃!"; |
|
|
|
} else if (date.getHours() >= 0 && date.getHours() < 6) { |
|
|
|
tipsType.value = 5 |
|
|
|
tipsType.value = 5; |
|
|
|
return "偷偷向银河要了一把碎星,只等你闭上眼睛撒入你的梦中,晚安🌛!"; |
|
|
|
} |
|
|
|
}); |
|
|
|
const {isFullscreen, toggle} = useFullscreen(); |
|
|
|
const { isFullscreen, toggle } = useFullscreen(); |
|
|
|
|
|
|
|
/** |
|
|
|
* 注销 |
|
|
|
@ -58,9 +58,7 @@ function logout() { |
|
|
|
/** |
|
|
|
* 打开个人资料 |
|
|
|
*/ |
|
|
|
const openMyContBox = () => { |
|
|
|
|
|
|
|
} |
|
|
|
const openMyContBox = () => {}; |
|
|
|
/** |
|
|
|
* 修改个人密码 |
|
|
|
*/ |
|
|
|
@ -68,17 +66,15 @@ const editMyPasswordForm = () => { |
|
|
|
// console.log("修改个人密码"); |
|
|
|
myPasswordBoxIsShow.value = true; |
|
|
|
// console.log("修改个人密码",myPasswordBoxIsShow.value ); |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
<div class="top"> |
|
|
|
<div class="logo"> |
|
|
|
<img src="../../assets/images/logo.png"> |
|
|
|
<img src="../../assets/images/logo.png" /> |
|
|
|
</div> |
|
|
|
<div class="flex"> |
|
|
|
|
|
|
|
<!-- <!– 导航栏设置(窄屏隐藏)–>--> |
|
|
|
<div v-if="device !== 'mobile'" class="setting-container"> |
|
|
|
<!-- <el-text v-if="tipsType==1" class="mx-1" type="success">{{ greetings }}</el-text>--> |
|
|
|
@ -88,22 +84,20 @@ const editMyPasswordForm = () => { |
|
|
|
<!-- <el-text v-if="tipsType==5" class="mx-1">{{ greetings }}</el-text>--> |
|
|
|
<!--全屏 --> |
|
|
|
<div class="setting-item" @click="toggle"> |
|
|
|
<svg-icon |
|
|
|
:icon-class="isFullscreen ? 'exit-fullscreen' : 'fullscreen'" |
|
|
|
/> |
|
|
|
<svg-icon :icon-class="isFullscreen ? 'exit-fullscreen' : 'fullscreen'" /> |
|
|
|
</div> |
|
|
|
<!-- 布局大小 --> |
|
|
|
<el-tooltip content="布局大小" effect="dark" placement="bottom"> |
|
|
|
<size-select class="setting-item"/> |
|
|
|
<size-select class="setting-item" /> |
|
|
|
</el-tooltip> |
|
|
|
<!--语言选择--> |
|
|
|
<lang-select class="setting-item"/> |
|
|
|
<lang-select class="setting-item" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- <!– 用户头像 –>--> |
|
|
|
<el-dropdown trigger="click"> |
|
|
|
<div class="avatar-container"> |
|
|
|
<img :src="userStore.avatar + '?imageView2/1/w/80/h/80'"/> |
|
|
|
<img :src="userStore.avatar + '?imageView2/1/w/80/h/80'" /> |
|
|
|
<span style="padding: 0 10px">{{ userStore.nickname }}</span> |
|
|
|
<arrow-down class="w-3 h-3"></arrow-down> |
|
|
|
</div> |
|
|
|
@ -112,8 +106,12 @@ const editMyPasswordForm = () => { |
|
|
|
<router-link to="/"> |
|
|
|
<el-dropdown-item>{{ $t("navbar.dashboard") }}</el-dropdown-item> |
|
|
|
</router-link> |
|
|
|
<el-dropdown-item @click="openMyContBox">{{ $t("navbar.archives") }}</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="editMyPasswordForm">{{ $t("navbar.password") }}</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="openMyContBox">{{ |
|
|
|
$t("navbar.archives") |
|
|
|
}}</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="editMyPasswordForm">{{ |
|
|
|
$t("navbar.password") |
|
|
|
}}</el-dropdown-item> |
|
|
|
<el-dropdown-item divided @click="logout"> |
|
|
|
{{ $t("navbar.logout") }} |
|
|
|
</el-dropdown-item> |
|
|
|
@ -121,14 +119,14 @@ const editMyPasswordForm = () => { |
|
|
|
</template> |
|
|
|
</el-dropdown> |
|
|
|
</div> |
|
|
|
<EditMyPassword v-model:editPasswordIsShow="myPasswordBoxIsShow"/> |
|
|
|
<EditMyPassword v-model:editPasswordIsShow="myPasswordBoxIsShow" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
.top { |
|
|
|
height: 68px; |
|
|
|
background: #1E5EFF; |
|
|
|
background: #1e5eff; |
|
|
|
position: fixed; |
|
|
|
padding: 0 20px; |
|
|
|
top: 0; |
|
|
|
|