/** * 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 = { 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; }