修复人员分页bug
This commit is contained in:
parent
6e85e5e3e7
commit
e96528870c
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue