63 行
4.1 KiB
TypeScript
63 行
4.1 KiB
TypeScript
export const MAIN_NAV_ORDER = ["/portal", "/workflow/tasks", "/team", "/leave-requests", "/reimbursements", "/assets", "/weekly-reports", "/todos", "/announcements", "/projects"];
|
|
export const ADMIN_NAV_ORDER = ["/system/workspace", "/people", "/organization", "/system/workflow-definitions", "/system/settings", "/system/feature-flags", "/audit-logs"];
|
|
export const BACKUP_NAV_ORDER = ["/attendance", "/contracts-registry", "/purchase-requests", "/travel-requests", "/budgets", "/payment-batches", "/ap-operations", "/invoice-pool", "/inventory-checks", "/system/cutover", "/system/integrations/erp", "/dashboard", "/settings/profile"];
|
|
|
|
const PAGE_TITLES: Array<{ path: string; title: string; group: string }> = [
|
|
{ path: "/portal", title: "工作台", group: "工作台" },
|
|
{ path: "/announcements", title: "公告", group: "主导航" },
|
|
{ path: "/team", title: "团队", group: "主导航" },
|
|
{ path: "/attendance", title: "考勤", group: "备用模块" },
|
|
{ path: "/projects", title: "项目", group: "主导航" },
|
|
{ path: "/contracts-registry", title: "合同台账", group: "备用模块" },
|
|
{ path: "/purchase-requests", title: "采购申请", group: "备用模块" },
|
|
{ path: "/travel-requests", title: "差旅申请", group: "备用模块" },
|
|
{ path: "/budgets", title: "预算管理", group: "备用模块" },
|
|
{ path: "/payment-batches", title: "付款批次", group: "备用模块" },
|
|
{ path: "/ap-operations", title: "应付作业", group: "备用模块" },
|
|
{ path: "/invoice-pool", title: "票据中心", group: "备用模块" },
|
|
{ path: "/inventory-checks", title: "盘点任务", group: "备用模块" },
|
|
{ path: "/weekly-reports", title: "周报", group: "主导航" },
|
|
{ path: "/todos", title: "待办", group: "主导航" },
|
|
{ path: "/reimbursements/", title: "报销详情", group: "主导航" },
|
|
{ path: "/reimbursements", title: "报销", group: "主导航" },
|
|
{ path: "/leave-requests", title: "请假", group: "主导航" },
|
|
{ path: "/assets", title: "资产", group: "主导航" },
|
|
{ path: "/workflow/tasks/", title: "审批详情", group: "主导航" },
|
|
{ path: "/workflow/tasks", title: "审批待办", group: "主导航" },
|
|
{ path: "/mobile/assets/scan", title: "移动资产扫描", group: "移动工作台" },
|
|
{ path: "/mobile/approvals", title: "移动审批", group: "移动工作台" },
|
|
{ path: "/mobile/capture", title: "移动 PDF 发票上传", group: "移动工作台" },
|
|
{ path: "/mobile/leave", title: "移动请假", group: "移动工作台" },
|
|
{ path: "/mobile/me", title: "移动我的", group: "移动工作台" },
|
|
{ path: "/mobile/purchase-requests/", title: "移动采购详情", group: "移动工作台" },
|
|
{ path: "/mobile/purchase-requests", title: "移动采购", group: "移动工作台" },
|
|
{ path: "/mobile/reimbursements", title: "移动报销", group: "移动工作台" },
|
|
{ path: "/mobile", title: "移动首页", group: "移动工作台" },
|
|
{ path: "/settings/profile", title: "个人设置", group: "账号设置" },
|
|
{ path: "/system/workspace", title: "工作区设置", group: "管理入口" },
|
|
{ path: "/people", title: "人员管理", group: "管理入口" },
|
|
{ path: "/organization", title: "组织架构", group: "管理入口" },
|
|
{ path: "/system/workflow-definitions", title: "流程定义", group: "管理入口" },
|
|
{ path: "/system/settings", title: "系统设置", group: "管理入口" },
|
|
{ path: "/system/feature-flags", title: "功能开关", group: "管理入口" },
|
|
{ path: "/system/cutover", title: "切换控制台", group: "管理入口" },
|
|
{ path: "/system/integrations/erp", title: "ERP 集成", group: "管理入口" },
|
|
{ path: "/dashboard", title: "数据看板", group: "备用模块" },
|
|
{ path: "/audit-logs", title: "审计日志", group: "管理入口" },
|
|
];
|
|
|
|
export function resolvePageMeta(pathname: string) {
|
|
const matched = [...PAGE_TITLES].sort((left, right) => right.path.length - left.path.length)
|
|
.find((item) => pathname === item.path || pathname.startsWith(item.path));
|
|
|
|
if (matched) {
|
|
return matched;
|
|
}
|
|
|
|
if (pathname === "/") {
|
|
return { title: "工作台", group: "工作台" };
|
|
}
|
|
|
|
return { title: pathname, group: "工作台" };
|
|
}
|