From 4a38b06192b68dcc9d13e6ea7451fab1162d5cf3 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Wed, 24 Jun 2026 20:21:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E7=AE=A1=E7=90=86=EF=BC=9A?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=8C=89=E9=92=AE=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=88=87=E6=8D=A2=E6=AF=8F=E9=A1=B5=E6=9D=A1?= =?UTF-8?q?=E6=95=B0=E5=B9=B6=E6=8C=81=E4=B9=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/frontend/src/pages/AccountsPage.tsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/web/frontend/src/pages/AccountsPage.tsx b/web/frontend/src/pages/AccountsPage.tsx index 04332c9..5d67a1b 100644 --- a/web/frontend/src/pages/AccountsPage.tsx +++ b/web/frontend/src/pages/AccountsPage.tsx @@ -28,6 +28,11 @@ export default function AccountsPage() { const [selectedRowKeys, setSelectedRowKeys] = useState([]); const [batchTagInput, setBatchTagInput] = useState(''); const [batchTagVisible, setBatchTagVisible] = useState(false); + const [pageSize, setPageSize] = useState(() => { + const v = localStorage.getItem('account_page_size'); + return v ? Number(v) || 20 : 20; + }); + const [currentPage, setCurrentPage] = useState(1); const { can } = usePermissions(); const canViewAll = can('account:view_all'); @@ -342,7 +347,20 @@ export default function AccountsPage() { rowKey="id" loading={loading} size="small" - pagination={{ pageSize: 20 }} + pagination={{ + current: currentPage, + pageSize, + showSizeChanger: true, + showTotal: (t) => `共 ${t} 条`, + onChange: (page, size) => { + setCurrentPage(page); + if (size !== pageSize) { + setPageSize(size); + localStorage.setItem('account_page_size', String(size)); + setCurrentPage(1); // 切换 pageSize 时重置到第1页 + } + }, + }} />