From d017d7e5e0a439a099990139fd2f8bc49973ba46 Mon Sep 17 00:00:00 2001 From: sky121113 Date: Fri, 13 Feb 2026 15:55:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=89=8B=E5=86=8A=E9=81=B8=E5=96=AE=E9=A1=AF=E7=A4=BA=E9=82=8F?= =?UTF-8?q?=E8=BC=AF=E4=B8=A6=E5=BC=B7=E5=8C=96=E5=85=A7=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/js/Layouts/AuthenticatedLayout.tsx | 14 +++++++++----- resources/markdown/manual/purchasing-workflow.md | 11 ++++++++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/resources/js/Layouts/AuthenticatedLayout.tsx b/resources/js/Layouts/AuthenticatedLayout.tsx index e710eb2..f5624df 100644 --- a/resources/js/Layouts/AuthenticatedLayout.tsx +++ b/resources/js/Layouts/AuthenticatedLayout.tsx @@ -309,19 +309,23 @@ export default function AuthenticatedLayout({ const menuItems = useMemo(() => { return allMenuItems .map((item) => { - // 如果有子項目,先過濾子項目 + // 如果有子項目 if (item.children && item.children.length > 0) { const filteredChildren = item.children.filter(hasPermissionForItem); - // 若所有子項目都無權限,則隱藏整個群組 - if (filteredChildren.length === 0) return null; - return { ...item, children: filteredChildren }; + + // 若有子項目符合權限,則顯示該群組(群組本身的權限僅作為額外過濾) + if (filteredChildren.length > 0) { + return { ...item, children: filteredChildren }; + } + return null; } + // 無子項目的單一選單,直接檢查權限 if (!hasPermissionForItem(item)) return null; return item; }) .filter((item): item is MenuItem => item !== null); - }, [can, canAny]); + }, [allMenuItems, hasPermissionForItem]); // 初始化狀態:優先讀取 localStorage const [expandedItems, setExpandedItems] = useState(() => { diff --git a/resources/markdown/manual/purchasing-workflow.md b/resources/markdown/manual/purchasing-workflow.md index 3939292..b8a9e94 100644 --- a/resources/markdown/manual/purchasing-workflow.md +++ b/resources/markdown/manual/purchasing-workflow.md @@ -31,5 +31,14 @@ > [!IMPORTANT] > 進貨單一旦儲存,系統會立即更新庫存餘額。請務必確認數量正確。 +## 4. 儀表板 (Dashboard) 功能 + +儀表板提供系統目前的關鍵指標與待辦事項: +- **存貨分析 KPI**:顯示目前總庫存、滯銷品項與即將過期商品。 +- **待辦事項**:列出需審核的單據與待收貨的採購單。 +- **熱銷/積壓排行**:即時掌握銷售趨勢與庫存壓力。 + +![儀表板示意圖](https://placehold.co/800x400/01ab83/white?text=Dashboard+Overview) + --- -*下一章:[庫存管理規範](inventory-management)* \ No newline at end of file +*下一章:[採購流程說明](purchasing-workflow)* \ No newline at end of file