From fd5660904172b79edf5de786f1a8ce06727a90a1 Mon Sep 17 00:00:00 2001 From: txb Date: Mon, 12 Dec 2022 11:32:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/card/reservation/index.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/card/reservation/index.jsx b/src/pages/card/reservation/index.jsx index 8c652c6..086e391 100644 --- a/src/pages/card/reservation/index.jsx +++ b/src/pages/card/reservation/index.jsx @@ -19,6 +19,7 @@ export default () => { const [tabIndex, setTabIndex] = useState(1); const [currentPage, setCurrentPage] = useState(1); const [pageSize, setPageSize] = useState(10); + const [total, setTotal] = useState(0); const [ReservationGoods, setReservationGoods] = useState([]); const [ReservationOrg, setReservationOrg] = useState([]); const [ReservationUser, setReservationUser] = useState([]); @@ -289,6 +290,7 @@ export default () => { setIsLoading(false); if (response.succeeded) { let sortArr = response.data.data.sort((a, b) => b.value - a.value); + setTotal(response.data.total); setReservationGoodsDetailed(sortArr); } else { console.log('Message:', response.msg || '获取预定人员失败'); @@ -389,7 +391,7 @@ export default () => { }, []); useEffect(() => { initData(); - }, [tabIndex]); + }, [tabIndex, currentPage]); return ( @@ -455,7 +457,7 @@ export default () => { - + {setTabIndex(value); setTotal(0); setCurrentPage(1)}}> { tabIndex == 1 && <> @@ -470,7 +472,7 @@ export default () => { setPageSize(size) }} /> + pagination={{ current: currentPage, pageSize: pageSize,total , onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} /> } @@ -488,7 +490,7 @@ export default () => {
setPageSize(size) }} /> + pagination={{ current: currentPage, pageSize: pageSize, total, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} /> } @@ -524,7 +526,7 @@ export default () => {
setPageSize(size) }} + pagination={{ current: currentPage, pageSize: pageSize, total, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} /> }