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