mirror of
https://github.com/Cccc-owo/CheckInApp.git
synced 2026-06-17 14:06:28 +00:00
refactor: remove backup files
This commit is contained in:
@@ -1,97 +0,0 @@
|
||||
<template>
|
||||
<el-menu
|
||||
:default-active="activeMenu"
|
||||
mode="horizontal"
|
||||
:ellipsis="false"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<div class="flex-grow">
|
||||
<el-menu-item index="/">
|
||||
<el-icon><HomeFilled /></el-icon>
|
||||
<span class="logo-text">接龙自动打卡系统</span>
|
||||
</el-menu-item>
|
||||
|
||||
<el-menu-item index="/dashboard">
|
||||
<el-icon><User /></el-icon>
|
||||
<span>我的仪表盘</span>
|
||||
</el-menu-item>
|
||||
|
||||
<el-menu-item index="/records">
|
||||
<el-icon><List /></el-icon>
|
||||
<span>打卡记录</span>
|
||||
</el-menu-item>
|
||||
|
||||
<!-- 管理员菜单 -->
|
||||
<el-sub-menu v-if="authStore.isAdmin" index="admin">
|
||||
<template #title>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span>管理后台</span>
|
||||
</template>
|
||||
<el-menu-item index="/admin/users">用户管理</el-menu-item>
|
||||
<el-menu-item index="/admin/records">所有打卡记录</el-menu-item>
|
||||
<el-menu-item index="/admin/stats">统计信息</el-menu-item>
|
||||
<el-menu-item index="/admin/logs">系统日志</el-menu-item>
|
||||
</el-sub-menu>
|
||||
</div>
|
||||
|
||||
<div class="flex-grow" />
|
||||
|
||||
<el-sub-menu index="user">
|
||||
<template #title>
|
||||
<el-icon><Avatar /></el-icon>
|
||||
<span>{{ authStore.userSignature || '用户' }}</span>
|
||||
</template>
|
||||
<el-menu-item @click="handleLogout">
|
||||
<el-icon><SwitchButton /></el-icon>
|
||||
<span>退出登录</span>
|
||||
</el-menu-item>
|
||||
</el-sub-menu>
|
||||
</el-menu>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const authStore = useAuthStore()
|
||||
|
||||
const activeMenu = computed(() => route.path)
|
||||
|
||||
const handleSelect = (index) => {
|
||||
if (index !== route.path) {
|
||||
router.push(index)
|
||||
}
|
||||
}
|
||||
|
||||
const handleLogout = () => {
|
||||
ElMessageBox.confirm('确定要退出登录吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
authStore.logout()
|
||||
router.push('/login')
|
||||
})
|
||||
.catch(() => {
|
||||
// 取消操作
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.flex-grow {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.logo-text {
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user