diff --git a/furniture-3d-system/src/app/intake/new-product-management/page.tsx b/furniture-3d-system/src/app/intake/new-product-management/page.tsx index ced4b8c2..e431bb65 100644 --- a/furniture-3d-system/src/app/intake/new-product-management/page.tsx +++ b/furniture-3d-system/src/app/intake/new-product-management/page.tsx @@ -1,5 +1,39 @@ -import { redirect } from 'next/navigation' +import { requireSession } from "@/lib/server-session"; +import { OA_BOARD_DEFAULT_TRACKED_STATUSES } from "@/server/services/oa-board.constants"; +import { + createEmptyOaBoardDashboard, + oaBoardService, +} from "@/server/services/oa-board.service"; +import NewProductManagementDashboard from "./NewProductManagementDashboard"; + +export const dynamic = "force-dynamic"; export default async function NewProductManagementPage() { - redirect('/supply-chain/new-products/overview') + await requireSession("/login"); + + const result = await oaBoardService + .getDashboard({ + overallStatus: [...OA_BOARD_DEFAULT_TRACKED_STATUSES], + }) + .then((dashboard) => ({ + dashboard, + loadErrorMessage: null as string | null, + })) + .catch((error) => { + console.error("Failed to load new product management dashboard", error); + return { + dashboard: createEmptyOaBoardDashboard(), + loadErrorMessage: + error instanceof Error + ? `新品管理数据读取失败:${error.message}` + : "新品管理数据读取失败,请稍后重试。", + }; + }); + + return ( + + ); } diff --git a/furniture-3d-system/src/components/layout/AppTopNav.tsx b/furniture-3d-system/src/components/layout/AppTopNav.tsx index 57a24261..00865d13 100644 --- a/furniture-3d-system/src/components/layout/AppTopNav.tsx +++ b/furniture-3d-system/src/components/layout/AppTopNav.tsx @@ -35,7 +35,7 @@ const WORKBENCH_NAV_ITEMS = [ { href: '/draft-groups', icon: PackageOpen, label: '草稿组' }, { href: '/intake', icon: ArrowDownToLine, label: '产品资料' }, { href: '/bom-costing', icon: Calculator, label: 'BOM核算' }, - { href: '/supply-chain/new-products/overview', icon: ClipboardList, label: '新品管理' }, + { href: '/intake/new-product-management', icon: ClipboardList, label: '新品管理' }, { href: '/warehouse', icon: Warehouse, label: '仓库管理' }, { href: '/warehouse-quality', icon: ClipboardCheck, label: '仓库质检' }, { href: '/ai-render-workbench', icon: Sparkles, label: 'AI出图' }, @@ -49,8 +49,8 @@ function matchesWorkbenchHref(pathname: string, href: string) { if (href === '/intake') { return pathname === '/intake' || (pathname.startsWith('/intake/') && !pathname.startsWith('/intake/new-product-management') && !pathname.startsWith('/intake/oa-board') && !pathname.startsWith('/intake/sample-progress')) } - if (href === '/supply-chain/new-products/overview') { - return pathname === href || pathname.startsWith(`${href}/`) || pathname.startsWith('/intake/new-product-management') || pathname.startsWith('/intake/oa-board') || pathname.startsWith('/intake/sample-progress') + if (href === '/intake/new-product-management') { + return pathname === href || pathname.startsWith(`${href}/`) || pathname.startsWith('/intake/oa-board') || pathname.startsWith('/intake/sample-progress') } return pathname === href || pathname.startsWith(`${href}/`) }