140 lines
5.7 KiB
TypeScript
140 lines
5.7 KiB
TypeScript
import type { RouteRecordRaw } from "vue-router";
|
|
import { UserRoleEnum } from "@/types";
|
|
import GroupUser from "@/views/group-user/index.vue";
|
|
import AppList from "@/views/app/AppList.vue";
|
|
import AppCategory from "@/views/app/AppCategory.vue";
|
|
import ModuleManage from "@/views/app/ModuleManage.vue";
|
|
import AppOpen from "@/views/AppOpen.vue";
|
|
import RoleAuthzList from "@/views/role-authz/RoleAuthzList.vue";
|
|
import RoleManage from "@/views/role-authz/RoleManage.vue";
|
|
import GroupAuth from "@/views/GroupAuth.vue";
|
|
import PermissionView from "@/views/PermissionView.vue";
|
|
import OperationLogList from "@/views/oplog/OperationLogList.vue";
|
|
import OapiLogList from "@/views/oapilog/OapiLogList.vue";
|
|
import PushLog from "@/views/push/PushLog.vue";
|
|
import DeptManage from "@/views/dept-manage/index.vue";
|
|
import NoAuth from "@/views/NoAuth.vue";
|
|
|
|
// 管理端四级访问控制:meta.roles 为空/未声明 = 登录即可访问
|
|
const ALL_ADMIN = [UserRoleEnum.SuperAdmin, UserRoleEnum.Bureau, UserRoleEnum.School];
|
|
|
|
const routes: RouteRecordRaw[] = [
|
|
{
|
|
path: "/",
|
|
redirect: "/group-user",
|
|
},
|
|
// ===== 无权限页(路由守卫重定向目标)=====
|
|
{
|
|
path: "/no-auth",
|
|
name: "NoAuth",
|
|
component: NoAuth,
|
|
meta: { title: "暂无权限" },
|
|
},
|
|
// ===== 开发组(组/用户管理,多页嵌套目录)=====
|
|
{
|
|
path: "/group-user",
|
|
name: "GroupUser",
|
|
component: GroupUser,
|
|
meta: { title: "组,用户管理", icon: "icon-list", modId: 1101, roles: ALL_ADMIN },
|
|
},
|
|
// ===== 应用管理(单选项卡)=====
|
|
// 应用管理主页(= 应用列表),菜单顶层「应用管理」指向此路由(modId 1102)
|
|
// 局端不开放应用管理(局端的应用动作是「开通」)
|
|
{
|
|
path: "/app-manage/list",
|
|
name: "AppList",
|
|
component: AppList,
|
|
meta: { title: "应用管理", icon: "icon-list", modId: 1102, keepAlive: true, roles: [UserRoleEnum.SuperAdmin, UserRoleEnum.School] },
|
|
},
|
|
// 应用类型管理(深层子页,不在菜单里):meta.parentId=1102 关联父菜单「应用管理」,
|
|
// 由 layout.vue 的 routeChange 推导面包屑「应用管理>应用类型管理」并高亮父菜单
|
|
// 校管可:类别改名/排序(写覆盖表);新增/删除类别按钮由页面按级别隐藏
|
|
{
|
|
path: "/app-manage/category",
|
|
name: "AppCategory",
|
|
component: AppCategory,
|
|
meta: { title: "应用类型管理", modId: 11022, parentId: 1102, roles: [UserRoleEnum.SuperAdmin, UserRoleEnum.School] },
|
|
},
|
|
// 模块管理(深层子页,不在菜单里):仅超管
|
|
{
|
|
path: "/app-manage/module",
|
|
name: "ModuleManage",
|
|
component: ModuleManage,
|
|
meta: { title: "模块管理", modId: 11023, parentId: 1102, roles: [UserRoleEnum.SuperAdmin] },
|
|
},
|
|
// /app-manage 兜底重定向到主页
|
|
{
|
|
path: "/app-manage",
|
|
redirect: "/app-manage/list",
|
|
},
|
|
// ===== 角色授权(应用业务角色)=====
|
|
// 角色授权主页(= 角色列表/授权工作台),菜单「权限管理」下指向此路由(modId 1110)
|
|
{
|
|
path: "/role-authz/list",
|
|
name: "RoleAuthzList",
|
|
component: RoleAuthzList,
|
|
meta: { title: "角色授权", icon: "icon-list", modId: 1110, keepAlive: true, roles: ALL_ADMIN },
|
|
},
|
|
// 角色管理(深层子页,不在菜单里):meta.parentId=1110 关联父菜单「角色授权」,
|
|
// 由 layout.vue 推导面包屑「角色授权>角色管理」并高亮父菜单(与 /app-manage/category 范式一致)
|
|
{
|
|
path: "/role-authz/manage",
|
|
name: "RoleManage",
|
|
component: RoleManage,
|
|
meta: { title: "角色管理", modId: 11101, parentId: 1110, roles: ALL_ADMIN },
|
|
},
|
|
// /role-authz 兜底重定向到主页
|
|
{
|
|
path: "/role-authz",
|
|
redirect: "/role-authz/list",
|
|
},
|
|
{
|
|
path: "/app-open",
|
|
name: "AppOpen",
|
|
component: AppOpen,
|
|
meta: { title: "应用开通", icon: "icon-list", modId: 1103, roles: [UserRoleEnum.SuperAdmin, UserRoleEnum.Bureau] },
|
|
},
|
|
{
|
|
path: "/group-auth",
|
|
name: "GroupAuth",
|
|
component: GroupAuth,
|
|
meta: { title: "组授权", icon: "icon-list", modId: 1104, roles: ALL_ADMIN },
|
|
},
|
|
{
|
|
path: "/permission-view",
|
|
name: "PermissionView",
|
|
component: PermissionView,
|
|
meta: { title: "权限一览", icon: "icon-list", modId: 1105, roles: ALL_ADMIN },
|
|
},
|
|
// ===== 部门管理(2026-10-20 部门线 P0 最小批:只读树 + 状态徽标 + 启停)=====
|
|
// 挂「权限管理」分组(菜单 id=45);无删除/成员/职务/新建入口——建部门=建组回「组,用户管理」
|
|
{
|
|
path: "/dept-manage",
|
|
name: "DeptManage",
|
|
component: DeptManage,
|
|
meta: { title: "部门管理", icon: "icon-list", modId: 1106, parentId: 1108, roles: ALL_ADMIN },
|
|
},
|
|
{
|
|
path: "/push-log",
|
|
name: "PushLog",
|
|
component: PushLog,
|
|
meta: { title: "推送日志", icon: "icon-list", modId: 1112, keepAlive: true, roles: [UserRoleEnum.SuperAdmin] },
|
|
},
|
|
// ===== 操作日志 =====
|
|
{
|
|
path: "/oplog",
|
|
name: "OperationLogList",
|
|
component: OperationLogList,
|
|
meta: { title: "操作日志", icon: "icon-list", modId: 1111, keepAlive: true, roles: [UserRoleEnum.SuperAdmin] },
|
|
},
|
|
// ===== 开放接口日志 =====
|
|
{
|
|
path: "/oapilog",
|
|
name: "OapiLogList",
|
|
component: OapiLogList,
|
|
meta: { title: "开放接口日志", icon: "icon-list", modId: 1114, keepAlive: true, roles: [UserRoleEnum.SuperAdmin] },
|
|
},
|
|
];
|
|
|
|
export default routes;
|