Files
syops/frontend/src/features/workspace/constants/routes.ts
T
sophie f615e56bb9 feat(agent): 立账凭证检核
(cherry picked from commit f9e2fb5efc1ec7bf4f6e52e08dd3591b4e77edd9)
2026-08-06 10:05:46 +08:00

35 lines
1.3 KiB
TypeScript

/**
* features/workspace/constants/routes.ts
* 工作台子路由 path 常量,以及旧 ?view= 查询参数到新 path 的映射。
*/
export const WORKSPACE_PATHS = {
root: '/workspace',
profile: '/workspace/profile',
applications: '/workspace/applications',
updates: '/workspace/updates',
knowledgeBase: '/workspace/knowledge-base',
scheduleRuns: '/workspace/schedule-runs',
shippingNotice: '/workspace/shipping-notice',
accountingVoucherCheck: '/workspace/accounting-voucher-check',
feedback: '/workspace/feedback',
history: '/workspace/history',
} as const;
/** 旧 ?view= 参数 → 子路由 path */
export const LEGACY_VIEW_TO_PATH: Record<string, string> = {
profile: WORKSPACE_PATHS.profile,
applications: WORKSPACE_PATHS.applications,
feedback: WORKSPACE_PATHS.feedback,
updates: WORKSPACE_PATHS.updates,
knowledge_base: WORKSPACE_PATHS.knowledgeBase,
schedule_runs: WORKSPACE_PATHS.scheduleRuns,
shipping_notice: WORKSPACE_PATHS.shippingNotice,
accounting_voucher_check: WORKSPACE_PATHS.accountingVoucherCheck,
history: WORKSPACE_PATHS.history,
};
export function workspacePathFromLegacyView(view?: string): string {
if (!view) return WORKSPACE_PATHS.applications;
return LEGACY_VIEW_TO_PATH[view] || WORKSPACE_PATHS.applications;
}