txb 1 рік тому
джерело
коміт
fd56609041
1 змінених файлів з 7 додано та 5 видалено
  1. +7
    -5
      src/pages/card/reservation/index.jsx

+ 7
- 5
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 (
<PageContainer>
@@ -455,7 +457,7 @@ export default () => {
</Row>
</Card>
<Card>
<Tabs tabPosition='left' value={tabIndex} onChange={setTabIndex}>
<Tabs tabPosition='left' value={tabIndex} onChange={value => {setTabIndex(value); setTotal(0); setCurrentPage(1)}}>
<TabPane tab="预定菜品汇总" key={1}>
{
tabIndex == 1 && <>
@@ -470,7 +472,7 @@ export default () => {
<Table
columns={ReservationGoodsColums}
dataSource={ReservationGoods}
pagination={{ current: currentPage, pageSize: pageSize, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} />
pagination={{ current: currentPage, pageSize: pageSize,total , onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} />
</>
}
</TabPane>
@@ -488,7 +490,7 @@ export default () => {
<Table
columns={ReservationOrgColums}
dataSource={ReservationOrg}
pagination={{ current: currentPage, pageSize: pageSize, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} />
pagination={{ current: currentPage, pageSize: pageSize, total, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} />
</>
}
</TabPane>
@@ -524,7 +526,7 @@ export default () => {
<Table
columns={ReservationGoodsDetailedColums}
dataSource={ReservationGoodsDetailed}
pagination={{ current: currentPage, pageSize: pageSize, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }}
pagination={{ current: currentPage, pageSize: pageSize, total, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }}
/>
</>
}


Завантаження…
Відмінити
Зберегти