路由配置

This commit is contained in:
李远 2026-03-17 17:34:07 +08:00
parent b2d7f8bf06
commit 8d19a81d93
16 changed files with 171 additions and 12 deletions

View File

@ -130,19 +130,19 @@ const staticMenuList = ref<ElMenuItem[]>(
{
id: 41,
label: '品种',
path: '4-1', // index="4-1"
path: '/trade/variety', // index="4-1"
icon: ''
},
{
id: 42,
label: '交易组',
path: '4-2', // index="4-2"
path: '/trade/group', // index="4-2"
icon: ''
},
{
id: 43,
label: '交易时间',
path: '4-3', // index="4-3"
path: '/trade/time', // index="4-3"
icon: ''
}
]
@ -151,7 +151,7 @@ const staticMenuList = ref<ElMenuItem[]>(
{
id: 5,
label: '公告管理',
path: '5', // index="5"
path: '/notice', // index="5"
icon: 'BellFilled' // 对应 <BellFilled /> 图标
},
//
@ -236,7 +236,7 @@ const staticMenuList = ref<ElMenuItem[]>(
{
id: 8,
label: '风控管理',
path: '8', // index="8"
path: '/risk', // index="8"
icon: 'WarningFilled' // 对应 <WarningFilled /> 图标
}
]

View File

@ -36,11 +36,11 @@ const routes = [
}
]
},
// 带侧边栏布局的核心业务页面
// 带侧边栏布局的核心业务页面
{
path: '/',
component: Layout, // 全局布局Sidebar + Header + MainContent
redirect: '/dashboard',
redirect: '/dashboard',
meta: { requiresAuth: true }, // 需要登录
children: [
// 首页
@ -121,6 +121,60 @@ const routes = [
}
]
},
//交易管理
{
path: 'trade',
name: 'Trade',
meta: {
title: '交易管理', // 左侧菜单显示的标题
},
children: [
{
path: 'variety',
name: 'Variety',
component: () => import('@/views/trade/variety/index.vue'),
meta: {
title: '品种', // 左侧菜单显示的标题
}
},
{
path: 'group',
name: 'Group',
component: () => import('@/views/trade/group/index.vue'),
meta: {
title: '交易组', // 左侧菜单显示的标题
}
},
{
path: 'time',
name: 'Time',
component: () => import('@/views/trade/time/index.vue'),
meta: {
title: '交易时间', // 左侧菜单显示的标题
}
}
]
},
//公告管理
{
path: 'notice',
name: 'Notice',
meta: {
title: '公告管理', // 左侧菜单显示的标题
},
component: () => import('@/views/notice/index.vue'),
},
//资金管理
//风控管理
{
path: 'risk',
name: 'Risk',
meta: {
title: '风控管理', // 左侧菜单显示的标题
},
component: () => import('@/views/risk/index.vue'),
}
]
},
{
@ -138,7 +192,7 @@ const router = createRouter({
router.beforeEach(async (to, from) => {
const userStore = useUserStore();
const isLoggedIn = !!userStore.token;
// 1. 已登录用户访问授权页 → 重定向到首页
if (isLoggedIn && to.meta.isAuthPage) {
if (to.path === '/') return true;

View File

@ -1,6 +1,72 @@
<!-- views/dashboard/index.vue -->
<template>
<div>
<h1>欢迎来到管理系统</h1>
<div class="dashboard-container">
<el-card v-for="(item, index) in cardData" :key="index" class="stat-card" shadow="hover">
<div class="card-content">
<h3>
<el-icon size="48" class="icon">
<component :is="item.icon" />
</el-icon>
{{ item.label }}
</h3>
<p>{{ item.value }}</p>
</div>
</el-card>
</div>
</template>
</template>
<script setup>
import { UserFilled } from '@element-plus/icons-vue'
const cardData = [
{ label: '代理总数', value: 100, icon: UserFilled },
{ label: '今日新增代理总数', value: 100, icon: UserFilled },
{ label: '客户总数', value: 100, icon: UserFilled },
{ label: '今日新增客户总数', value: 100, icon: UserFilled },
{ label: '今日存款', value: 100, icon: UserFilled },
{ label: '总存款', value: 100, icon: UserFilled },
{ label: '今日盈利', value: 100, icon: UserFilled },
{ label: '总盈利', value: 100, icon: UserFilled },
{ label: '今日取款', value: 100, icon: UserFilled },
{ label: '总取款', value: 100, icon: UserFilled }
]
</script>
<style scoped lang="scss">
.dashboard-container {
display: flex;
flex-wrap: wrap;
gap: 16px;
margin: 0 auto;
}
.stat-card {
flex: 0 0 calc(25% - 12px);
min-width: 280px;
height: 180px;
box-sizing: border-box;
}
.card-content {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
h3 {
margin-bottom: 10px;
display: flex;
justify-content: center;
align-items: center;
font-size: 22px;
.icon{
margin-right: 8px;
}
}
p {
font-size: 18px;
font-weight: 600;
}
}
</style>

View File

@ -0,0 +1,3 @@
<template>
<h1>存款审核</h1>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>存款渠道</h1>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>存款明细</h1>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>资金流水</h1>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>收款账户列表</h1>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>转账明细</h1>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>取款审核</h1>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>取款明细</h1>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>公告管理</h1>
</template>

3
src/views/risk/index.vue Normal file
View File

@ -0,0 +1,3 @@
<template>
<h1>风控管理</h1>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>交易组</h1>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>交易时间</h1>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>品种</h1>
</template>