Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
48963292
authored
Nov 28, 2023
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化一些交互逻辑
parent
dae16a20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
web/src/components/UsersTable.js
+11
-1
No files found.
web/src/components/UsersTable.js
View file @
48963292
...
...
@@ -265,6 +265,15 @@ const UsersTable = () => {
setLoading
(
false
);
};
const
handlePageChange
=
page
=>
{
setActivePage
(
page
);
if
(
page
===
Math
.
ceil
(
users
.
length
/
ITEMS_PER_PAGE
)
+
1
)
{
// In this case we have to load more data and then append them.
loadUsers
(
page
-
1
).
then
(
r
=>
{
});
}
};
const
pageData
=
users
.
slice
((
activePage
-
1
)
*
ITEMS_PER_PAGE
,
activePage
*
ITEMS_PER_PAGE
);
const
closeAddUser
=
()
=>
{
...
...
@@ -303,7 +312,8 @@ const UsersTable = () => {
currentPage
:
activePage
,
pageSize
:
ITEMS_PER_PAGE
,
total
:
userCount
,
pageSizeOpts
:
[
10
,
20
,
50
,
100
],
// onPageChange: handlePageChange,
pageSizeOpts
:
[
10
,
20
,
50
,
100
],
onPageChange
:
handlePageChange
,
}}
loading
=
{
loading
}
/
>
<
Button
theme
=
'light'
type
=
'primary'
style
=
{{
marginRight
:
8
}}
onClick
=
{
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment