修复人员分页bug

This commit is contained in:
yj 2024-10-10 16:37:07 +08:00
parent 6e85e5e3e7
commit e96528870c
3 changed files with 6 additions and 10 deletions

View File

@ -3,7 +3,7 @@ import App from './App.tsx'
import '@/utils/styles/main.css' import '@/utils/styles/main.css'
import { HashRouter } from 'react-router-dom'; import { HashRouter } from 'react-router-dom';
import { ConfigProvider } from 'antd'; import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN'; import zhCN from 'antd/es/locale/zh_CN';
import 'animate.css'; import 'animate.css';
ReactDOM.createRoot(document.getElementById('root')!).render( ReactDOM.createRoot(document.getElementById('root')!).render(
<HashRouter> <HashRouter>

View File

@ -42,7 +42,7 @@ const User: React.FC = () => {
useEffect(() => { useEffect(() => {
getUserList() getUserList()
}, [list.pageIndex]); }, [list.pageIndex, list.pageSize]);
const getUserList = async (): Promise<void> => { const getUserList = async (): Promise<void> => {
await GetUserList({ await GetUserList({
@ -258,12 +258,13 @@ const User: React.FC = () => {
</Table> </Table>
<div className={styles.userContentPagination}> <div className={styles.userContentPagination}>
<span>{list.total}</span> <span>{list.total}</span>
<Pagination size="small" total={list.total} onChange={(e) => { <Pagination size="small" total={list.total} onChange={(page, pageSize) => {
setList({ setList({
...list, ...list,
pageIndex: e pageIndex: page,
pageSize: pageSize
}) })
}} pageSize={list.pageSize} current={list.pageIndex} hideOnSinglePage={true} /> }} showSizeChanger pageSize={list.pageSize} current={list.pageIndex} />
</div> </div>
</div> </div>
</div> </div>

View File

@ -189,8 +189,6 @@ $pagination-hover-background-color: #5575F2;
.ant-pagination-prev, .ant-pagination-prev,
.ant-pagination-next { .ant-pagination-next {
width: 30px !important;
height: 30px !important;
border-radius: 50%; border-radius: 50%;
background: $pagination-background-color; background: $pagination-background-color;
@ -200,9 +198,6 @@ $pagination-hover-background-color: #5575F2;
} }
.ant-pagination-item { .ant-pagination-item {
width: 30px !important;
height: 30px !important;
line-height: 30px !important;
border-radius: 50%; border-radius: 50%;
background: $pagination-background-color !important; background: $pagination-background-color !important;
margin-right: 10px !important; margin-right: 10px !important;