|
@@ -22,12 +22,50 @@
|
|
|
<span class="date">{{ times }}</span>
|
|
|
</div>
|
|
|
<!-- 用户栏 -->
|
|
|
- <div>
|
|
|
-
|
|
|
+ <div class="userBox">
|
|
|
+ <span class="userSpan">
|
|
|
+ <img style="width: 12px;height: 12px;" src="../../assets/icon/user_gray.png" alt="">
|
|
|
+ </span>
|
|
|
+ <el-dropdown trigger="click">
|
|
|
+ <span class="el-dropdown-link">
|
|
|
+ Admin<el-icon class="el-icon--right" style="color: #BAC0E1;"><arrow-down /></el-icon>
|
|
|
+ </span>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <!-- 个人信息 -->
|
|
|
+ <div>
|
|
|
+ <!-- 头像及登陆信息 -->
|
|
|
+ <div
|
|
|
+ style="display: flex;justify-content: space-around;align-items: center;height: 80px;border-bottom: 1px solid gray;">
|
|
|
+ <div>
|
|
|
+ <img style="width: 40px;height: 40px;" src="../../assets/icon/Avatar.png"
|
|
|
+ alt="">
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <p>Admin</p>
|
|
|
+ <p>登陆时间:2000-01-01</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="logOut" @click="logOut">
|
|
|
+ <div style="text-align: center;line-height: 10px;">
|
|
|
+ <img style="width: 20px;height: 20px;display: inline-block;"
|
|
|
+ src="../../assets/icon/SignOut.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <span>注销</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
</div>
|
|
|
<!-- 最小化,关闭 -->
|
|
|
<div>
|
|
|
-
|
|
|
+ <span class="moreSet" @click="miniSize">-</span>
|
|
|
+ <span class="moreSet" @click="closeSize">x</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -36,9 +74,12 @@
|
|
|
|
|
|
<script>
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
export default {
|
|
|
setup() {
|
|
|
- let times = ref('')
|
|
|
+ let times = ref('')//时间显示
|
|
|
+ let router = useRouter()
|
|
|
+ // 获取日期
|
|
|
function getDate() {
|
|
|
const currentDate = new Date();
|
|
|
const year = currentDate.getFullYear();
|
|
@@ -47,6 +88,7 @@ export default {
|
|
|
const formattedDate = `${year}.${month}.${day}`;
|
|
|
return formattedDate
|
|
|
}
|
|
|
+ // 获取时间
|
|
|
function getTime() {
|
|
|
let currentDate = new Date();
|
|
|
let hours = currentDate.getHours().toString().padStart(2, '0');
|
|
@@ -55,22 +97,44 @@ export default {
|
|
|
let formattedTime = `${hours}:${minutes}:${seconds}`;
|
|
|
times.value = formattedTime
|
|
|
}
|
|
|
+ // 最小化窗口
|
|
|
+ function miniSize() {
|
|
|
+ // windowEx.Min()
|
|
|
+ }
|
|
|
+ // 关闭窗口
|
|
|
+ function closeSize() {
|
|
|
+ // windowEx.Close()
|
|
|
+ }
|
|
|
+ // 退出登录
|
|
|
+ function logOut(){
|
|
|
+ // windowEx.Size(384,426)
|
|
|
+ localStorage.removeItem("loginStatus")
|
|
|
+ router.push("/login")
|
|
|
+ }
|
|
|
onMounted(() => {
|
|
|
- getTime()
|
|
|
+ getTime()//不可注释,首次获取时间
|
|
|
setInterval(() => {
|
|
|
getTime()
|
|
|
- }, 1000)
|
|
|
+ }, 1000)//一秒给times赋值,使其实时显示
|
|
|
})
|
|
|
return {
|
|
|
- getDate,
|
|
|
- getTime,
|
|
|
- times,
|
|
|
+ getDate,//获取日期
|
|
|
+ getTime,//获取时间
|
|
|
+ times,//动态显示时间
|
|
|
+ miniSize,//最小化窗口
|
|
|
+ closeSize,//关闭窗口
|
|
|
+ logOut,//登出
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+p {
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+}
|
|
|
+
|
|
|
.bigBox {
|
|
|
width: 97vw;
|
|
|
height: 55px;
|
|
@@ -103,9 +167,9 @@ export default {
|
|
|
}
|
|
|
|
|
|
.setBox {
|
|
|
- width: 300px;
|
|
|
+ width: 400px;
|
|
|
height: 50px;
|
|
|
- border: 1px solid white;
|
|
|
+ /* border: 1px solid white; */
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
@@ -135,4 +199,56 @@ export default {
|
|
|
font-size: 14px;
|
|
|
border-bottom: 1px dotted white;
|
|
|
}
|
|
|
-</style>
|
|
|
+
|
|
|
+.userSpan {
|
|
|
+ display: inline-block;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ background-color: #BAC0E1;
|
|
|
+ border-radius: 50%;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 24px;
|
|
|
+}
|
|
|
+
|
|
|
+.el-dropdown-link {
|
|
|
+ background: linear-gradient(0deg, #BAC0E1 50%, #EDF2FF 50%);
|
|
|
+ -webkit-background-clip: text;
|
|
|
+ background-clip: text;
|
|
|
+ color: transparent;
|
|
|
+ font-size: 14px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 25px;
|
|
|
+}
|
|
|
+
|
|
|
+.moreSet {
|
|
|
+ display: inline-block;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ background: linear-gradient(to bottom, #BAC0E1, #EDF2FF);
|
|
|
+ /* border-radius: 50%; */
|
|
|
+ text-align: center;
|
|
|
+ line-height: 24px;
|
|
|
+ font-size: 26px;
|
|
|
+ cursor: pointer;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.moreSet:nth-child(1):hover {
|
|
|
+ /* border: 1px black solid; */
|
|
|
+ color: #BAC0E1;
|
|
|
+}
|
|
|
+
|
|
|
+.moreSet:nth-child(2):hover {
|
|
|
+ background: rgb(197, 66, 66);
|
|
|
+ color: red;
|
|
|
+}
|
|
|
+
|
|
|
+.logOut {
|
|
|
+ width: 50px;
|
|
|
+ height: 50px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 40px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ align-items: center;
|
|
|
+}</style>
|