feat: 添加系统配置、审计中心、通知中心、文件管理模块
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<a-layout class="default-layout">
|
||||
<a-layout-sider v-model:collapsed="collapsed" :trigger="null" collapsible>
|
||||
<div class="logo">
|
||||
<span v-if="!collapsed">Novalon</span>
|
||||
<span v-else>N</span>
|
||||
</div>
|
||||
<a-menu v-model:selectedKeys="selectedKeys" theme="dark" mode="inline">
|
||||
<a-menu-item key="dashboard" @click="router.push('/dashboard')">
|
||||
<template #icon><DashboardOutlined /></template>
|
||||
<span>仪表盘</span>
|
||||
</a-menu-item>
|
||||
<a-sub-menu key="system">
|
||||
<template #icon><SettingOutlined /></template>
|
||||
<template #title>系统管理</template>
|
||||
<a-menu-item key="users" @click="router.push('/users')">用户管理</a-menu-item>
|
||||
<a-menu-item key="roles" @click="router.push('/roles')">角色管理</a-menu-item>
|
||||
<a-menu-item key="menus" @click="router.push('/menus')">菜单管理</a-menu-item>
|
||||
</a-sub-menu>
|
||||
<a-sub-menu key="config">
|
||||
<template #icon><ToolOutlined /></template>
|
||||
<template #title>系统配置</template>
|
||||
<a-menu-item key="dict" @click="router.push('/dict')">字典管理</a-menu-item>
|
||||
<a-menu-item key="sysconfig" @click="router.push('/sysconfig')">参数配置</a-menu-item>
|
||||
</a-sub-menu>
|
||||
<a-sub-menu key="audit">
|
||||
<template #icon><AuditOutlined /></template>
|
||||
<template #title>审计中心</template>
|
||||
<a-menu-item key="loginlog" @click="router.push('/loginlog')">登录日志</a-menu-item>
|
||||
<a-menu-item key="oplog" @click="router.push('/oplog')">操作日志</a-menu-item>
|
||||
</a-sub-menu>
|
||||
<a-sub-menu key="notify">
|
||||
<template #icon><BellOutlined /></template>
|
||||
<template #title>通知中心</template>
|
||||
<a-menu-item key="notice" @click="router.push('/notice')">通知公告</a-menu-item>
|
||||
</a-sub-menu>
|
||||
<a-sub-menu key="file">
|
||||
<template #icon><FolderOutlined /></template>
|
||||
<template #title>文件管理</template>
|
||||
<a-menu-item key="files" @click="router.push('/files')">文件列表</a-menu-item>
|
||||
</a-sub-menu>
|
||||
</a-menu>
|
||||
</a-layout-sider>
|
||||
<a-layout>
|
||||
<a-layout-header class="header">
|
||||
<menu-unfold-outlined v-if="collapsed" class="trigger" @click="collapsed = !collapsed" />
|
||||
<menu-fold-outlined v-else class="trigger" @click="collapsed = !collapsed" />
|
||||
<div class="header-right">
|
||||
<a-dropdown>
|
||||
<a-avatar>{{ username }}</a-avatar>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="profile">个人中心</a-menu-item>
|
||||
<a-menu-divider />
|
||||
<a-menu-item key="logout" @click="handleLogout">退出登录</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
</a-layout-header>
|
||||
<a-layout-content class="content">
|
||||
<router-view />
|
||||
</a-layout-content>
|
||||
</a-layout>
|
||||
</a-layout>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import {
|
||||
DashboardOutlined, SettingOutlined, ToolOutlined,
|
||||
AuditOutlined, BellOutlined, FolderOutlined,
|
||||
MenuUnfoldOutlined, MenuFoldOutlined
|
||||
} from '@ant-design/icons-vue'
|
||||
|
||||
const router = useRouter()
|
||||
const collapsed = ref(false)
|
||||
const selectedKeys = ref<string[]>([])
|
||||
const username = ref(localStorage.getItem('username') || 'Admin')
|
||||
|
||||
const handleLogout = () => {
|
||||
localStorage.clear()
|
||||
router.push('/login')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const token = localStorage.getItem('token')
|
||||
if (!token) {
|
||||
router.push('/login')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.default-layout {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 64px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 16px;
|
||||
background: #fff;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
||||
|
||||
.trigger {
|
||||
font-size: 18px;
|
||||
cursor: pointer;
|
||||
transition: color 0.3s;
|
||||
&:hover { color: #1890ff; }
|
||||
}
|
||||
|
||||
.header-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
margin: 16px;
|
||||
padding: 16px;
|
||||
background: #fff;
|
||||
min-height: 280px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user