feat: 統一全系統頁面標題樣式、優化側邊欄與實作角色成員查看功能

This commit is contained in:
2026-01-13 17:00:58 +08:00
parent 6600cde3bc
commit f18fb169f3
33 changed files with 938 additions and 472 deletions

View File

@@ -1,5 +1,5 @@
import { useState, useMemo } from "react";
import { ArrowLeft, PackagePlus, AlertTriangle, Shield } from "lucide-react";
import { ArrowLeft, PackagePlus, AlertTriangle, Shield, Boxes } from "lucide-react";
import { Button } from "@/Components/ui/button";
import AuthenticatedLayout from "@/Layouts/AuthenticatedLayout";
import { Head, Link, router } from "@inertiajs/react";
@@ -19,6 +19,7 @@ import {
AlertDialogHeader,
AlertDialogTitle,
} from "@/Components/ui/alert-dialog";
import { Can } from "@/Components/Permission/Can";
// 庫存頁面 Props
interface Props {
@@ -107,8 +108,11 @@ export default function WarehouseInventoryPage({
<div className="flex items-center justify-between">
<div>
<h1 className="mb-2"> - {warehouse.name}</h1>
<p className="text-gray-600 font-medium"></p>
<h1 className="text-2xl font-bold text-grey-0 flex items-center gap-2">
<Boxes className="h-6 w-6 text-[#01ab83]" />
- {warehouse.name}
</h1>
<p className="text-gray-500 mt-1"></p>
</div>
</div>
</div>
@@ -116,15 +120,17 @@ export default function WarehouseInventoryPage({
{/* 操作按鈕 (位於標題下方) */}
<div className="flex items-center gap-3 mb-6">
{/* 安全庫存設定按鈕 */}
<Link href={route('warehouses.safety-stock.index', warehouse.id)}>
<Button
variant="outline"
className="button-outlined-primary"
>
<Shield className="mr-2 h-4 w-4" />
</Button>
</Link>
<Can permission="inventory.safety_stock">
<Link href={route('warehouses.safety-stock.index', warehouse.id)}>
<Button
variant="outline"
className="button-outlined-primary"
>
<Shield className="mr-2 h-4 w-4" />
</Button>
</Link>
</Can>
{/* 庫存警告顯示 */}
<Button
@@ -139,14 +145,16 @@ export default function WarehouseInventoryPage({
</Button>
{/* 新增庫存按鈕 */}
<Link href={route('warehouses.inventory.create', warehouse.id)}>
<Button
className="button-filled-primary"
>
<PackagePlus className="mr-2 h-4 w-4" />
</Button>
</Link>
<Can permission="inventory.adjust">
<Link href={route('warehouses.inventory.create', warehouse.id)}>
<Button
className="button-filled-primary"
>
<PackagePlus className="mr-2 h-4 w-4" />
</Button>
</Link>
</Can>
</div>
{/* 篩選工具列 */}