style: 修正盤點與盤調畫面 Table Padding 並統一 UI 規範
This commit is contained in:
@@ -22,7 +22,8 @@ import {
|
||||
BarChart3,
|
||||
FileSpreadsheet,
|
||||
BookOpen,
|
||||
ClipboardCheck
|
||||
ClipboardCheck,
|
||||
ArrowLeftRight
|
||||
} from "lucide-react";
|
||||
import { toast, Toaster } from "sonner";
|
||||
import { useState, useEffect, useMemo, useRef } from "react";
|
||||
@@ -83,7 +84,7 @@ export default function AuthenticatedLayout({
|
||||
id: "inventory-management",
|
||||
label: "商品與庫存管理",
|
||||
icon: <Boxes className="h-5 w-5" />,
|
||||
permission: ["products.view", "warehouses.view"], // 滿足任一即可看到此群組
|
||||
permission: ["products.view", "warehouses.view", "inventory.view"], // 滿足任一即可看到此群組
|
||||
children: [
|
||||
{
|
||||
id: "product-management",
|
||||
@@ -99,6 +100,27 @@ export default function AuthenticatedLayout({
|
||||
route: "/warehouses",
|
||||
permission: "warehouses.view",
|
||||
},
|
||||
{
|
||||
id: "stock-counting",
|
||||
label: "庫存盤點",
|
||||
icon: <ClipboardCheck className="h-4 w-4" />,
|
||||
route: "/inventory/count-docs",
|
||||
permission: "inventory.view",
|
||||
},
|
||||
{
|
||||
id: "stock-adjustment",
|
||||
label: "庫存盤調",
|
||||
icon: <FileText className="h-4 w-4" />,
|
||||
route: "/inventory/adjust-docs",
|
||||
permission: "inventory.adjust",
|
||||
},
|
||||
{
|
||||
id: "stock-transfer",
|
||||
label: "庫存調撥",
|
||||
icon: <ArrowLeftRight className="h-4 w-4" />,
|
||||
route: "/inventory/transfer-orders",
|
||||
permission: "inventory.transfer",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -260,7 +282,11 @@ export default function AuthenticatedLayout({
|
||||
const activeItem = menuItems.find(item =>
|
||||
item.children?.some(child => child.route && url.startsWith(child.route))
|
||||
);
|
||||
return activeItem ? [activeItem.id] : ["inventory-management"];
|
||||
const defaultExpanded = ["inventory-management"];
|
||||
if (activeItem && !defaultExpanded.includes(activeItem.id)) {
|
||||
defaultExpanded.push(activeItem.id);
|
||||
}
|
||||
return defaultExpanded;
|
||||
});
|
||||
|
||||
// 監聽 URL 變化,確保「當前」頁面所屬群組是展開的
|
||||
|
||||
Reference in New Issue
Block a user