Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
田翔
xform
Commits
d502d22e
Commit
d502d22e
authored
Apr 19, 2023
by
田翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 增加分页
parent
08aaf5c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
index.js
src/core/Account/index.js
+17
-3
index.less
src/core/Account/index.less
+5
-1
No files found.
src/core/Account/index.js
View file @
d502d22e
import
React
,
{
useEffect
,
useMemo
,
useState
}
from
'react'
import
styles
from
'./index.less'
import
{
Table
,
Tooltip
,
message
,
Button
}
from
'antd'
import
{
Table
,
Tooltip
,
message
,
Button
,
Pagination
}
from
'antd'
import
SearchGroup
from
'./components/SearchGroup'
import
TablePack
from
'./components/TablePack'
import
{
GetAccountConfigInfo
,
GetAccountPageList
,
getStationListByUserID
,
GetTableJson
}
from
'../../apis/process'
...
...
@@ -30,7 +30,7 @@ const TableRender = (props) => {
const
userID
=
window
?.
globalConfig
?.
userInfo
?.
OID
||
1
const
{
accountName
}
=
props
const
[
detailShow
,
setDetailShow
]
=
useState
(
false
)
const
[
params
,
setParams
]
=
useState
({
userID
:
userID
,
accountName
,
direction
:
'desc'
,
timeField
:
'录入时间'
,
pageIndex
:
1
,
pageSize
:
100
})
const
[
params
,
setParams
]
=
useState
({
userID
:
userID
,
accountName
,
direction
:
'desc'
,
timeField
:
'录入时间'
,
total
:
0
,
pageIndex
:
1
,
pageSize
:
100
})
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
[
config
,
setConfig
]
=
useState
({
webShowFieldGroup
:
''
,
formJson
:
''
,
values
:
[]
})
const
[
dataSource
,
setDataSource
]
=
useState
([])
...
...
@@ -135,6 +135,7 @@ const TableRender = (props) => {
const
{
code
,
data
,
msg
}
=
await
GetAccountPageList
({
...
params
,
...
param
})
if
(
code
===
0
)
{
setDataSource
(
JSON
.
parse
(
data
.
jsonData
))
setParams
({
...
params
,
total
:
data
.
totalCount
,
pageIndex
:
data
.
pageIndex
,
pageSize
:
data
.
pageSize
})
}
else
{
setDataSource
([])
message
.
error
(
msg
)
...
...
@@ -142,6 +143,10 @@ const TableRender = (props) => {
setLoading
(
false
)
}
const
pageChange
=
(
pageIndex
,
pageSize
)
=>
{
getDataSource
({
pageIndex
,
pageSize
})
}
const
getData
=
()
=>
{
getConfig
()
getDataSource
()
...
...
@@ -175,7 +180,16 @@ const TableRender = (props) => {
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
footer
}
>
<
div
className
=
{
styles
.
total
}
>
共计
{
params
.
total
}
条数据
<
/div
>
<
div
className
=
{
styles
.
pagination
}
>
<
Pagination
showQuickJumper
pageSize
=
{
params
.
pageSize
}
current
=
{
params
.
pageIndex
}
total
=
{
params
.
total
}
onChange
=
{
pageChange
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
tableDetail
}
style
=
{{
display
:
detailShow
?
'block'
:
'none'
}}
>
...
...
src/core/Account/index.less
View file @
d502d22e
...
...
@@ -66,7 +66,7 @@
}
&:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) {
td {
background: rgb(237,
242,
255)!important;
background: rgb(237,
242,
255)!important;
}
}
} // .ant-table-tbody > tr > td:last-child {
...
...
@@ -97,8 +97,12 @@
position: absolute;
bottom: 0;
left: 0;
padding: 0 20px;
width: 100%;
height: 50px;
display: flex;
align-items: center;
justify-content: space-between;
}
}
.tableDetail {
...
...
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