feat:添加仪表盘页面
This commit is contained in:
1 parent
cd6852775a
commit
e85a741159
2 files changed
+40
-45
No files matched your search
@@ -15,11 +15,17 @@ import './assets/styles/global.css'
|
|||||||
|
|
||||||
import ElementPlus from 'element-plus'
|
import ElementPlus from 'element-plus'
|
||||||
import 'element-plus/dist/index.css'
|
import 'element-plus/dist/index.css'
|
||||||
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
||||||
import i18n, { getCurrentElementLocale } from './i18n'
|
import i18n, { getCurrentElementLocale } from './i18n'
|
||||||
|
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
|
// 全局注册Element Plus图标
|
||||||
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||||
|
app.component(key, component)
|
||||||
|
}
|
||||||
|
|
||||||
// 正确配置Element Plus语言包
|
// 正确配置Element Plus语言包
|
||||||
app.use(ElementPlus, {
|
app.use(ElementPlus, {
|
||||||
locale: getCurrentElementLocale()
|
locale: getCurrentElementLocale()
|
||||||
|
|||||||
@@ -1,53 +1,42 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: 13895237362 2205451508@qq.com
|
||||||
|
* @Date: 2025-08-01 09:32:42
|
||||||
|
* @LastEditors: 13895237362 2205451508@qq.com
|
||||||
|
* @LastEditTime: 2025-08-08 14:08:31
|
||||||
|
* @FilePath: /frontend/src/views/Dashboard.vue
|
||||||
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="dashboard">
|
<Layout app-name="License Manager" :nav-items="navigationItems" :breadcrumb-items="breadcrumbs" page-title="仪表盘"
|
||||||
<h1>欢迎来到授权管理平台</h1>
|
@nav-click="handleNavigation">
|
||||||
<p>您已成功登录!</p>
|
<!-- 页面内容 -->
|
||||||
<button @click="logout" class="logout-btn">退出登录</button>
|
<div>
|
||||||
</div>
|
<h1>欢迎来到授权管理平台</h1>
|
||||||
|
<p>您已成功登录!</p>
|
||||||
|
</div>
|
||||||
|
</Layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useRouter } from "vue-router";
|
import { ref } from 'vue'
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import Layout from '@/views/components/layout/Layout.vue';
|
||||||
|
import type { NavItem, BreadcrumbItem } from '@/views/components/layout/index';
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
function logout() {
|
const navigationItems = ref<NavItem[]>([
|
||||||
localStorage.removeItem("token");
|
{ id: "dashboard", label: "仪表盘", href: "/dashboard", icon: "Dashboard", active: true },
|
||||||
router.push("/login");
|
{ id: "customers", label: "客户管理", href: "/customers", icon: "User" },
|
||||||
}
|
{ id: "licenses", label: "授权管理", href: "/licenses", icon: "Key" },
|
||||||
|
{ id: "roles", label: "角色权限", href: "/roles", icon: "UserFilled" },
|
||||||
|
{ id: "users", label: "系统用户", href: "/users", icon: "Avatar" }
|
||||||
|
]);
|
||||||
|
const breadcrumbs = ref<BreadcrumbItem[]>([
|
||||||
|
{ title: "仪表盘", path: "/dashboard" }
|
||||||
|
]);
|
||||||
|
const handleNavigation = (item: NavItem) => {
|
||||||
|
router.push(item.href);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
.dashboard {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
height: 100vh;
|
|
||||||
background: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
color: #666;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logout-btn {
|
|
||||||
padding: 10px 20px;
|
|
||||||
background: #2E69F7;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logout-btn:hover {
|
|
||||||
background: #1557E5;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Reference in new issue
Block a user