From f0e6c6e4d1e950b36ee0141e48bcaeb494a219e4 Mon Sep 17 00:00:00 2001 From: sky121113 Date: Tue, 13 Jan 2026 13:37:51 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E7=A7=BB=E9=99=A4=E9=BA=B5=E5=8C=85?= =?UTF-8?q?=E5=B1=91=E9=A6=96=E9=A0=81=E9=A0=85=EF=BC=8C=E5=81=B4=E9=82=8A?= =?UTF-8?q?=E6=AC=84=E6=96=B0=E5=A2=9E=E5=84=80=E8=A1=A8=E6=9D=BF=E9=81=B8?= =?UTF-8?q?=E5=96=AE=E4=B8=A6=E4=BF=AE=E6=AD=A3=E9=81=B8=E4=B8=AD=E7=8B=80?= =?UTF-8?q?=E6=85=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/js/Layouts/AuthenticatedLayout.tsx | 11 ++++++++++- resources/js/utils/breadcrumb.ts | 8 +------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/resources/js/Layouts/AuthenticatedLayout.tsx b/resources/js/Layouts/AuthenticatedLayout.tsx index 1a709ce..f88b3ea 100644 --- a/resources/js/Layouts/AuthenticatedLayout.tsx +++ b/resources/js/Layouts/AuthenticatedLayout.tsx @@ -1,4 +1,5 @@ import { + LayoutDashboard, ChevronRight, Package, ShoppingCart, @@ -59,6 +60,12 @@ export default function AuthenticatedLayout({ const [isMobileOpen, setIsMobileOpen] = useState(false); const menuItems: MenuItem[] = [ + { + id: "dashboard", + label: "儀表板", + icon: , + route: "/", + }, { id: "inventory-management", label: "商品與庫存管理", @@ -197,7 +204,9 @@ export default function AuthenticatedLayout({ const renderMenuItem = (item: MenuItem, level: number = 0) => { const hasChildren = item.children && item.children.length > 0; const isExpanded = expandedItems.includes(item.id); - const isActive = item.route ? url.startsWith(item.route) : false; + const isActive = item.route + ? (item.route === '/' ? url === '/' : url.startsWith(item.route)) + : false; return (
diff --git a/resources/js/utils/breadcrumb.ts b/resources/js/utils/breadcrumb.ts index deaf0a9..7f3df22 100644 --- a/resources/js/utils/breadcrumb.ts +++ b/resources/js/utils/breadcrumb.ts @@ -5,26 +5,20 @@ import { BreadcrumbItemType } from "@/Components/shared/BreadcrumbNav"; * 根據側邊欄層級結構定義基礎麵包屑 */ export const BREADCRUMB_MAP: Record = { - dashboard: [ - { label: "首頁", isPage: true } - ], + dashboard: [], products: [ - { label: "首頁", href: "/" }, { label: "商品與庫存管理" }, { label: "商品資料管理", href: "/products", isPage: true } ], warehouses: [ - { label: "首頁", href: "/" }, { label: "商品與庫存管理" }, { label: "倉庫管理", href: "/warehouses", isPage: true } ], vendors: [ - { label: "首頁", href: "/" }, { label: "廠商管理" }, { label: "廠商資料管理", href: "/vendors", isPage: true } ], purchaseOrders: [ - { label: "首頁", href: "/" }, { label: "採購管理" }, { label: "管理採購單", href: "/purchase-orders", isPage: true } ],