From 8bee570cb2c4f1a06b4d7c666a12ea853b21e042 Mon Sep 17 00:00:00 2001 From: sulaimaannaasif6866 Date: Sun, 21 Jun 2026 03:26:43 +0000 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E5=95=86=E5=93=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=BA=95=E9=83=A8=E5=A2=9E=E5=8A=A0=E6=AF=8F=E9=A1=B5?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E4=B8=8E=E8=B7=B3=E9=A1=B5=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- admin-frontend/src/components/ProductList.tsx | 49 ++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/admin-frontend/src/components/ProductList.tsx b/admin-frontend/src/components/ProductList.tsx index 1160ff3..6f50459 100644 --- a/admin-frontend/src/components/ProductList.tsx +++ b/admin-frontend/src/components/ProductList.tsx @@ -32,7 +32,8 @@ export default function ProductList({ const [q, setQ] = useState(""); const [input, setInput] = useState(""); const [page, setPage] = useState(1); - const [size] = useState(20); + const [size, setSize] = useState(20); + const [jump, setJump] = useState(""); const [rows, setRows] = useState([]); const [total, setTotal] = useState(0); const [loading, setLoading] = useState(false); @@ -319,7 +320,25 @@ export default function ProductList({ -
+
+
+ 每页 + + 条 · 共 {total} 条 +
+
{ + e.preventDefault(); + const n = Number(jump); + if (Number.isFinite(n) && n >= 1) { + setPage(Math.min(Math.max(1, Math.trunc(n)), pages)); + setJump(""); + } + }} + className="flex items-center gap-1" + > + 跳至 + setJump(e.target.value.replace(/[^0-9]/g, ""))} + placeholder={String(page)} + className="w-14 rounded border border-gray-300 px-2 py-1 text-center" + aria-label="跳转页码" + /> + +
); -- 2.52.0