[FEAT] 實作配方與生產工單自動搜尋,優化分頁 RWD,將倉庫地址改為選填並更新文件
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 1m22s

This commit is contained in:
2026-03-09 13:48:06 +08:00
parent 3f7a625191
commit 89291918fd
7 changed files with 82 additions and 73 deletions

View File

@@ -266,14 +266,13 @@ export default function WarehouseDialog({
{/* 倉庫地址 */}
<div className="space-y-2">
<Label htmlFor="address">
<span className="text-red-500">*</span>
</Label>
<Input
id="address"
value={formData.address}
onChange={(e) => setFormData({ ...formData, address: e.target.value })}
placeholder="例台北市信義區信義路五段7號"
required
className="h-9"
/>
</div>

View File

@@ -27,22 +27,33 @@ export default function Pagination({ links, className }: PaginationProps) {
const isNext = label === "Next";
const activeIndex = links.findIndex(l => l.active);
// Tablet/Mobile visibility logic (< md):
// Show: Previous, Next, Active, and up to 2 neighbors (Total ~5 numeric pages)
// Hide others on small screens (hidden md:flex)
// User requested: "small than 800... display 5 pages"
const isVisibleOnTablet =
// Responsive visibility logic:
// Global: Previous, Next, Active are always visible
// Mobile (< sm): Active, +-1, First, Last, and Ellipses
// Tablet (sm < md): Active, +-2, First, Last, and Ellipses
// Desktop (>= md): All standard pages
const isFirst = key === 1;
const isLast = key === links.length - 2;
const isEllipsis = !isPrevious && !isNext && !link.url;
const isMobileVisible =
isPrevious ||
isNext ||
link.active ||
isFirst ||
isLast ||
isEllipsis ||
key === activeIndex - 1 ||
key === activeIndex + 1 ||
key === activeIndex + 1;
const isTabletVisible =
isMobileVisible ||
key === activeIndex - 2 ||
key === activeIndex + 2;
const baseClasses = cn(
isVisibleOnTablet ? "flex" : "hidden md:flex",
"h-9 items-center justify-center rounded-md border px-3 text-sm"
"h-9 items-center justify-center rounded-md border px-3 text-sm",
isMobileVisible ? "flex" : (isTabletVisible ? "hidden sm:flex md:flex" : "hidden md:flex")
);
// 如果是 Previous/Next 但沒有 URL則不渲染或者渲染為 disabled