fix(pagination): 统一表格分页与密钥查询交互
统一各中心表格的分页样式和切换行为,保留密钥筛选条件与兑换码搜索分页。
This commit is contained in:
@@ -70,6 +70,7 @@ const Invoice = () => {
|
||||
const [invoices, setInvoices] = useState([]);
|
||||
const [invoicesTotal, setInvoicesTotal] = useState(0);
|
||||
const [invoicesPage, setInvoicesPage] = useState(1);
|
||||
const [invoicesPageSize, setInvoicesPageSize] = useState(10);
|
||||
const [invoicesLoading, setInvoicesLoading] = useState(false);
|
||||
|
||||
// 详情弹窗
|
||||
@@ -109,7 +110,7 @@ const Invoice = () => {
|
||||
setInvoicesLoading(true);
|
||||
try {
|
||||
const res = await API.get('/api/user/invoice/self', {
|
||||
params: { p: invoicesPage, page_size: 10 },
|
||||
params: { p: invoicesPage, page_size: invoicesPageSize },
|
||||
});
|
||||
if (res.data.success) {
|
||||
setInvoices(res.data.data?.items || []);
|
||||
@@ -120,7 +121,7 @@ const Invoice = () => {
|
||||
} finally {
|
||||
setInvoicesLoading(false);
|
||||
}
|
||||
}, [invoicesPage]);
|
||||
}, [invoicesPage, invoicesPageSize]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!nuonuoEnabled) return;
|
||||
@@ -527,8 +528,12 @@ const Invoice = () => {
|
||||
pagination={{
|
||||
currentPage: invoicesPage,
|
||||
total: invoicesTotal,
|
||||
pageSize: 10,
|
||||
pageSize: invoicesPageSize,
|
||||
onPageChange: setInvoicesPage,
|
||||
onPageSizeChange: (size) => {
|
||||
setInvoicesPage(1);
|
||||
setInvoicesPageSize(size);
|
||||
},
|
||||
showTotal: true,
|
||||
}}
|
||||
scroll={{ x: 800 }}
|
||||
|
||||
Reference in New Issue
Block a user