Optimize pagination
This commit is contained in:
@@ -36,7 +36,11 @@ const Group: React.FC = () => {
|
|||||||
pagination: {
|
pagination: {
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
position: ['bottomCenter']
|
position: ['bottomCenter'],
|
||||||
|
showTotal: (total, range) =>
|
||||||
|
`第 ${
|
||||||
|
range[0] === range[1] ? `${range[0]}` : `${range[0]}~${range[1]}`
|
||||||
|
} 项 共 ${total} 项`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const [searchName, setSearchName] = useState('')
|
const [searchName, setSearchName] = useState('')
|
||||||
@@ -138,6 +142,7 @@ const Group: React.FC = () => {
|
|||||||
filters: Record<string, _FilterValue | null>,
|
filters: Record<string, _FilterValue | null>,
|
||||||
sorter: _SorterResult<GroupWithRoleGetVo> | _SorterResult<GroupWithRoleGetVo>[]
|
sorter: _SorterResult<GroupWithRoleGetVo> | _SorterResult<GroupWithRoleGetVo>[]
|
||||||
) => {
|
) => {
|
||||||
|
pagination = { ...tableParams.pagination, ...pagination }
|
||||||
if (Array.isArray(sorter)) {
|
if (Array.isArray(sorter)) {
|
||||||
setTableParams({
|
setTableParams({
|
||||||
pagination,
|
pagination,
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ const Log: React.FC = () => {
|
|||||||
pagination: {
|
pagination: {
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
position: ['bottomCenter']
|
position: ['bottomCenter'],
|
||||||
|
showTotal: (total, range) =>
|
||||||
|
`第 ${
|
||||||
|
range[0] === range[1] ? `${range[0]}` : `${range[0]}~${range[1]}`
|
||||||
|
} 项 共 ${total} 项`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const [searchRequestUrl, setSearchRequestUrl] = useState('')
|
const [searchRequestUrl, setSearchRequestUrl] = useState('')
|
||||||
@@ -134,6 +138,7 @@ const Log: React.FC = () => {
|
|||||||
filters: Record<string, _FilterValue | null>,
|
filters: Record<string, _FilterValue | null>,
|
||||||
sorter: _SorterResult<SysLogGetVo> | _SorterResult<SysLogGetVo>[]
|
sorter: _SorterResult<SysLogGetVo> | _SorterResult<SysLogGetVo>[]
|
||||||
) => {
|
) => {
|
||||||
|
pagination = { ...tableParams.pagination, ...pagination }
|
||||||
if (Array.isArray(sorter)) {
|
if (Array.isArray(sorter)) {
|
||||||
setTableParams({
|
setTableParams({
|
||||||
pagination,
|
pagination,
|
||||||
|
|||||||
@@ -36,7 +36,11 @@ const Role: React.FC = () => {
|
|||||||
pagination: {
|
pagination: {
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
position: ['bottomCenter']
|
position: ['bottomCenter'],
|
||||||
|
showTotal: (total, range) =>
|
||||||
|
`第 ${
|
||||||
|
range[0] === range[1] ? `${range[0]}` : `${range[0]}~${range[1]}`
|
||||||
|
} 项 共 ${total} 项`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const [searchName, setSearchName] = useState('')
|
const [searchName, setSearchName] = useState('')
|
||||||
@@ -130,6 +134,7 @@ const Role: React.FC = () => {
|
|||||||
filters: Record<string, _FilterValue | null>,
|
filters: Record<string, _FilterValue | null>,
|
||||||
sorter: _SorterResult<RoleWithPowerGetVo> | _SorterResult<RoleWithPowerGetVo>[]
|
sorter: _SorterResult<RoleWithPowerGetVo> | _SorterResult<RoleWithPowerGetVo>[]
|
||||||
) => {
|
) => {
|
||||||
|
pagination = { ...tableParams.pagination, ...pagination }
|
||||||
if (Array.isArray(sorter)) {
|
if (Array.isArray(sorter)) {
|
||||||
setTableParams({
|
setTableParams({
|
||||||
pagination,
|
pagination,
|
||||||
|
|||||||
@@ -56,7 +56,11 @@ const User: React.FC = () => {
|
|||||||
pagination: {
|
pagination: {
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
position: ['bottomCenter']
|
position: ['bottomCenter'],
|
||||||
|
showTotal: (total, range) =>
|
||||||
|
`第 ${
|
||||||
|
range[0] === range[1] ? `${range[0]}` : `${range[0]}~${range[1]}`
|
||||||
|
} 项 共 ${total} 项`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const [tableSelectedItem, setTableSelectedItem] = useState<React.Key[]>([])
|
const [tableSelectedItem, setTableSelectedItem] = useState<React.Key[]>([])
|
||||||
@@ -214,6 +218,7 @@ const User: React.FC = () => {
|
|||||||
filters: Record<string, _FilterValue | null>,
|
filters: Record<string, _FilterValue | null>,
|
||||||
sorter: _SorterResult<UserWithRoleInfoVo> | _SorterResult<UserWithRoleInfoVo>[]
|
sorter: _SorterResult<UserWithRoleInfoVo> | _SorterResult<UserWithRoleInfoVo>[]
|
||||||
) => {
|
) => {
|
||||||
|
pagination = { ...tableParams.pagination, ...pagination }
|
||||||
if (Array.isArray(sorter)) {
|
if (Array.isArray(sorter)) {
|
||||||
setTableParams({
|
setTableParams({
|
||||||
pagination,
|
pagination,
|
||||||
|
|||||||
Reference in New Issue
Block a user