227 lines
6.7 KiB
TypeScript
227 lines
6.7 KiB
TypeScript
/**
|
|
* app/router/routes/admin.routes.ts
|
|
* 绠$悊鍚庡彴宓屽璺敱锛涘叏閮?admin 妯″潡宸茬嫭绔嬫媶鍒嗐€?
|
|
* 渚濊禆锛歷ue-router锛沵eta.title 瀛?i18n key锛堝 admin.nav.*锛夛紝鐢?guards 瑙f瀽涓?document.title銆?
|
|
* 閫昏緫锛欰dminLayout 宓屽鍚勭鐞嗛〉锛涗紒寰负涓夌骇瀛愯矾鐢便€?
|
|
*/
|
|
|
|
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 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 LinkedServicesPage = () =>
|
|
import("@/features/admin/modules/linked-services/LinkedServicesPage.vue");
|
|
|
|
const ReportsPage = () =>
|
|
import("@/features/admin/modules/reports/ReportsPage.vue");
|
|
|
|
const ProcurementContractPage = () =>
|
|
import("@/features/admin/modules/procurement-contract/ProcurementContractPage.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: "admin.nav.overview" },
|
|
},
|
|
|
|
{
|
|
path: "schedules",
|
|
name: "AdminSchedules",
|
|
component: SchedulesPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "schedules",
|
|
title: "admin.nav.schedules",
|
|
},
|
|
},
|
|
|
|
{
|
|
path: "knowledge-base",
|
|
name: "AdminKnowledgeBase",
|
|
component: KnowledgeBasePage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "knowledge_base",
|
|
title: "admin.nav.knowledgeBase",
|
|
},
|
|
},
|
|
{
|
|
path: "wecom",
|
|
name: "AdminWecom",
|
|
component: WecomLayout,
|
|
redirect: { name: "AdminWecomSettings" },
|
|
meta: { requiresAdmin: true, adminModule: "wecom", title: "admin.nav.wecom" },
|
|
children: [
|
|
{
|
|
path: "settings",
|
|
name: "AdminWecomSettings",
|
|
component: WecomSettingsPage,
|
|
meta: { requiresAdmin: true, adminModule: "wecom", title: "admin.wecom.nav.settingsPage" },
|
|
},
|
|
{
|
|
path: "bindings",
|
|
name: "AdminWecomBindings",
|
|
component: WecomBindingsPage,
|
|
meta: { requiresAdmin: true, adminModule: "wecom", title: "admin.wecom.nav.bindingsPage" },
|
|
},
|
|
{
|
|
path: "audits",
|
|
name: "AdminWecomAudits",
|
|
component: WecomAuditsPage,
|
|
meta: { requiresAdmin: true, adminModule: "wecom", title: "admin.wecom.nav.auditsPage" },
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: "agents",
|
|
name: "AdminAgents",
|
|
component: AgentsPage,
|
|
meta: { requiresAdmin: true, adminModule: "agents", title: "admin.nav.agents" },
|
|
},
|
|
|
|
{
|
|
path: "users",
|
|
name: "AdminUsers",
|
|
component: UsersPage,
|
|
meta: { requiresAdmin: true, adminModule: "users", title: "admin.nav.users" },
|
|
},
|
|
|
|
{
|
|
path: "departments",
|
|
name: "AdminDepartments",
|
|
component: DepartmentsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "departments",
|
|
title: "admin.nav.departments",
|
|
},
|
|
},
|
|
|
|
{
|
|
path: "announcements",
|
|
name: "AdminAnnouncements",
|
|
component: AnnouncementsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "announcements",
|
|
title: "admin.nav.announcements",
|
|
},
|
|
},
|
|
|
|
{
|
|
path: "questions",
|
|
name: "AdminQuestions",
|
|
component: QuestionsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "questions",
|
|
title: "admin.nav.questions",
|
|
},
|
|
},
|
|
{
|
|
path: "linked-services",
|
|
name: "AdminLinkedServices",
|
|
component: LinkedServicesPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "linked_services",
|
|
title: "admin.nav.linkedServices",
|
|
},
|
|
},
|
|
{
|
|
path: "requests",
|
|
name: "AdminRequests",
|
|
component: RequestsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "requests",
|
|
title: "admin.nav.requests",
|
|
},
|
|
},
|
|
{
|
|
path: "permissions",
|
|
name: "AdminPermissions",
|
|
component: PermissionsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "permissions",
|
|
title: "admin.nav.permissions",
|
|
},
|
|
},
|
|
{
|
|
path: "platform-apps",
|
|
name: "AdminPlatformApps",
|
|
component: PlatformAppsPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "platform_apps",
|
|
title: "admin.nav.platformApps",
|
|
},
|
|
},
|
|
{
|
|
path: "procurement-contract",
|
|
name: "AdminProcurementContract",
|
|
component: ProcurementContractPage,
|
|
meta: {
|
|
requiresAdmin: true,
|
|
adminModule: "procurement_contract",
|
|
title: "admin.nav.procurementContract",
|
|
},
|
|
},
|
|
{
|
|
path: "reports/:table?",
|
|
name: "AdminReports",
|
|
component: ReportsPage,
|
|
meta: { requiresAdmin: true, adminModule: "reports", title: "admin.nav.reports" },
|
|
},
|
|
],
|
|
},
|
|
];
|
|
|
|
|
|
|
|
|