This commit is contained in:
程蕊 2024-10-25 11:12:22 +08:00
parent 80e2636082
commit e95e9e402c
6 changed files with 6 additions and 164 deletions

View File

@ -18,31 +18,32 @@ const routes = [
{ {
path: '/menu', path: '/menu',
name: 'Menu', name: 'Menu',
component: () => import('@/views/Menu.vue'), component: () => import('@/views/home/Menu.vue'),
redirect: '/home', redirect: '/home',
children: [ children: [
{ {
path: '/home', path: '/home',
name: 'Home', name: 'Home',
component: () => import('@/views/Home.vue'), component: () => import('@/views/home/Home.vue'),
}, },
{ {
path:'/adminmanage', path:'/adminmanage',
name: 'AdminManage', name: 'AdminManage',
component: () => import('@/views/AdminManage.vue'), component: () => import('@/views/home/AdminManage.vue'),
}, },
] ]
}, },
{ {
path: '/manage', path: '/manage',
name: 'Manage', name: 'Manage',
component: () => import('@/views/Manage.vue'), component: () => import('@/views/backstage/Manage.vue'),
children: [ children: [
{ {
path: '/userapproval', path: '/userapproval',
name: 'UserApproval', name: 'UserApproval',
component: () => import('@/views/UserApproval.vue') component: () => import('@/views/backstage/UserApproval.vue')
}, },
] ]
}, },
]; ];

View File

@ -1,104 +0,0 @@
<template>
<el-row class="container">
<el-col :span="4">
<el-menu active-text-color="#ffd04b" background-color="#545c64" class="el-menu-vertical-demo" default-active="2" text-color="#fff">
<div class="logo-title-container">
<img src="@/assets/image.png" class="logo" />
<p class="mb-2">后台管理菜单</p>
</div>
<el-sub-menu>
<template #title>
<el-icon><location /></el-icon>
<span>用户管理</span>
</template>
<el-menu-item-group title="用户操作">
<el-menu-item @click="userApprovalClick" index="/userapproval">审核用户注册</el-menu-item>
<el-menu-item index="/userInfoManagement">管理用户信息</el-menu-item>
</el-menu-item-group>
</el-sub-menu>
<el-sub-menu index="hospitalManagement">
<template #title>
<el-icon><hospital /></el-icon>
<span>医院管理</span>
</template>
<el-menu-item-group title="医院操作">
<el-menu-item index="hospitalInfoManagement">管理医院信息</el-menu-item>
<el-menu-item index="departmentSettingManagement">管理科室设置</el-menu-item>
<el-menu-item index="doctorInfoManagement">管理医生信息</el-menu-item>
</el-menu-item-group>
</el-sub-menu>
<el-sub-menu index="orderManagement">
<template #title>
<el-icon><shopping-cart /></el-icon>
<span>订单管理</span>
</template>
<el-menu-item-group title="订单操作">
<el-menu-item index="appointmentOrderManagement">管理预约挂号订单</el-menu-item>
<el-menu-item index="purchaseOrderManagement">管理在线购药订单</el-menu-item>
</el-menu-item-group>
</el-sub-menu>
<el-sub-menu index="dataStatistics">
<template #title>
<el-icon><bar-chart /></el-icon>
<span>数据统计</span>
</template>
<el-menu-item-group title="统计操作">
<el-menu-item index="userDataStatistics">统计用户数据</el-menu-item>
<el-menu-item index="businessDataStatistics">统计业务数据</el-menu-item>
</el-menu-item-group>
</el-sub-menu>
</el-menu>
</el-col>
<el-col :span="20">
<div v-if="$route.path === '/manage'">
<h2 class="text-center">欢迎来到后台管理系统</h2>
<img src="@/assets/b.jpg" class="img"/>
</div>
<router-view/>
</el-col>
</el-row>
</template>
<script>
export default {
name: 'Manage',
methods: {
userApprovalClick() {
this.$router.push('/userapproval');
}
}
}
</script>
<style scoped>
.container{
height: 100vh;
}
.el-menu-vertical-demo{
height: 100%;
}
.logo-title-container {
display: flex;
align-items: center;
}
.logo {
width: 50px;
height: 50px;
margin-left: 10px;
}
.mb-2 {
color: white;
font-size: 26px;
margin-left: 20px;
}
.text-center {
margin-top: 50px;
font-size: 30px;
text-align: center;
}
.img {
width: 100%;
height: 100%;
object-fit: cover;
}
</style>

View File

@ -1,55 +0,0 @@
<template>
<div>
<p class="title">用户审批页面</p>
<el-table :data="pendingUsers">
<el-table-column prop="username" label="用户名" />
<el-table-column prop="email" label="邮箱" />
<el-table-column label="操作">
<template #default="scope">
<el-button @click="approveUser(scope.row.username)">批准</el-button>
<el-button @click="rejectUser(scope.row.username)">拒绝</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import axios from 'axios';
export default {
data() {
return {
pendingUsers: [],
};
},
created() {
this.fetchPendingUsers();
},
methods: {
fetchPendingUsers() {
axios.get('http://localhost:8081/user/approval/pending').then(response => {
this.pendingUsers = response.data;
});
},
approveUser(username) {
axios.post(`http://localhost:8081/user/approval/approve/${username}`).then(() => {
this.fetchPendingUsers();
});
},
rejectUser(username) {
axios.post(`http://localhost:8081/user/approval/reject/${username}`).then(() => {
this.fetchPendingUsers();
});
},
},
};
</script>
<style scoped>
.title {
font-size: 24px;
font-weight: bold;
text-align: center;
}
</style>