208 lines
5.9 KiB
TypeScript
208 lines
5.9 KiB
TypeScript
/**
|
|
* app/router/routes/admin.routes.ts
|
|
* 管理后台嵌套路由;全部 admin 模块已独立拆分。
|
|
*/
|
|
|
|
import type { RouteRecordRaw } from "vue-router";
|
|
|
|
const AdminLayout = () => import("@/features/admin/views/AdminLayout.vue");
|
|
|
|
const AgentsPage = () =>
|
|
import("@/features/admin/modules/agents/AgentsPage.vue");
|
|
|
|
const UsersPage = () => import("@/features/admin/modules/users/UsersPage.vue");
|
|
|
|
const DepartmentsPage = () =>
|
|
import("@/features/admin/modules/departments/DepartmentsPage.vue");
|
|
|
|
const ApprovalsPage = () =>
|
|
import("@/features/admin/modules/approvals/ApprovalsPage.vue");
|
|
|
|
const AnnouncementsPage = () =>
|
|
import("@/features/admin/modules/announcements/AnnouncementsPage.vue");
|
|
|
|
const QuestionsPage = () =>
|
|
import("@/features/admin/modules/questions/QuestionsPage.vue");
|
|
|
|
const RequestsPage = () =>
|
|
import("@/features/admin/modules/requests/RequestsPage.vue");
|
|
|
|
const PermissionsPage = () =>
|
|
import("@/features/admin/modules/permissions/PermissionsPage.vue");
|
|
const PlatformAppsPage = () =>
|
|
import("@/features/admin/modules/platform-apps/PlatformAppsPage.vue");
|
|
const DashboardPage = () =>
|
|
import("@/features/admin/modules/dashboard/DashboardPage.vue");
|
|
|
|
const SchedulesPage = () =>
|
|
import("@/features/admin/modules/schedules/SchedulesPage.vue");
|
|
|
|
const KnowledgeBasePage = () =>
|
|
import("@/features/admin/modules/knowledge-base/KnowledgeBasePage.vue");
|
|
|
|
const WecomLayout = () => import("@/features/admin/modules/wecom/WecomLayout.vue");
|
|
const WecomSettingsPage = () => import("@/features/admin/modules/wecom/pages/WecomSettingsPage.vue");
|
|
const WecomBindingsPage = () => import("@/features/admin/modules/wecom/pages/WecomBindingsPage.vue");
|
|
const WecomAuditsPage = () => import("@/features/admin/modules/wecom/pages/WecomAuditsPage.vue");
|
|
|
|
const ReportsPage = () =>
|
|
import("@/features/admin/modules/reports/ReportsPage.vue");
|
|
|
|
export const adminRoutes: RouteRecordRaw[] = [
|
|
{
|
|
path: "/admin",
|
|
component: AdminLayout,
|
|
meta: { requiresAdmin: true },
|
|
children: [
|
|
{ path: "", redirect: "/admin/dashboard" },
|
|
{
|
|
path: "dashboard",
|
|
name: "AdminDashboard",
|
|
component: DashboardPage,
|
|
meta: { requiresAdmin: true, adminModule: "dashboard", title: "概览" },
|
|
},
|
|
|
|
{
|
|
path: "schedules",
|
|
name: "AdminSchedules",
|
|
component: SchedulesPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "schedules",
|
|
title: "定时任务",
|
|
},
|
|
},
|
|
|
|
{
|
|
path: "knowledge-base",
|
|
name: "AdminKnowledgeBase",
|
|
component: KnowledgeBasePage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "knowledge_base",
|
|
title: "知识库配置",
|
|
},
|
|
},
|
|
{
|
|
path: "wecom",
|
|
name: "AdminWecom",
|
|
component: WecomLayout,
|
|
redirect: { name: "AdminWecomSettings" },
|
|
meta: { requiresAdmin: true, adminModule: "wecom", title: "企业微信" },
|
|
children: [
|
|
{
|
|
path: "settings",
|
|
name: "AdminWecomSettings",
|
|
component: WecomSettingsPage,
|
|
meta: { requiresAdmin: true, adminModule: "wecom", title: "企业微信配置" },
|
|
},
|
|
{
|
|
path: "bindings",
|
|
name: "AdminWecomBindings",
|
|
component: WecomBindingsPage,
|
|
meta: { requiresAdmin: true, adminModule: "wecom", title: "企业微信绑定" },
|
|
},
|
|
{
|
|
path: "audits",
|
|
name: "AdminWecomAudits",
|
|
component: WecomAuditsPage,
|
|
meta: { requiresAdmin: true, adminModule: "wecom", title: "企业微信审计" },
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: "approvals",
|
|
name: "AdminApprovals",
|
|
component: ApprovalsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "approvals",
|
|
title: "用户审批",
|
|
},
|
|
},
|
|
{
|
|
path: "agents",
|
|
name: "AdminAgents",
|
|
component: AgentsPage,
|
|
meta: { requiresAdmin: true, adminModule: "agents", title: "应用管理" },
|
|
},
|
|
|
|
{
|
|
path: "users",
|
|
name: "AdminUsers",
|
|
component: UsersPage,
|
|
meta: { requiresAdmin: true, adminModule: "users", title: "用户管理" },
|
|
},
|
|
|
|
{
|
|
path: "departments",
|
|
name: "AdminDepartments",
|
|
component: DepartmentsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "departments",
|
|
title: "部门管理",
|
|
},
|
|
},
|
|
|
|
{
|
|
path: "announcements",
|
|
name: "AdminAnnouncements",
|
|
component: AnnouncementsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "announcements",
|
|
title: "公告管理",
|
|
},
|
|
},
|
|
|
|
{
|
|
path: "questions",
|
|
name: "AdminQuestions",
|
|
component: QuestionsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "questions",
|
|
title: "常用问题",
|
|
},
|
|
},
|
|
{
|
|
path: "requests",
|
|
name: "AdminRequests",
|
|
component: RequestsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "requests",
|
|
title: "权限申请",
|
|
},
|
|
},
|
|
{
|
|
path: "permissions",
|
|
name: "AdminPermissions",
|
|
component: PermissionsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "permissions",
|
|
title: "权限管理",
|
|
},
|
|
},
|
|
{
|
|
path: "platform-apps",
|
|
name: "AdminPlatformApps",
|
|
component: PlatformAppsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "platform_apps",
|
|
title: "平台应用说明",
|
|
},
|
|
},
|
|
{
|
|
path: "reports/:table?",
|
|
name: "AdminReports",
|
|
component: ReportsPage,
|
|
meta: { requiresAdmin: true, adminModule: "reports", title: "报表" },
|
|
},
|
|
],
|
|
},
|
|
];
|