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
2 years ago
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
React
,
{
useEffect
,
useMemo
,
useState
}
from
'react'
import
styles
from
'./index.less'
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
SearchGroup
from
'./components/SearchGroup'
import
TablePack
from
'./components/TablePack'
import
TablePack
from
'./components/TablePack'
import
{
GetAccountConfigInfo
,
GetAccountPageList
,
getStationListByUserID
,
GetTableJson
}
from
'../../apis/process'
import
{
GetAccountConfigInfo
,
GetAccountPageList
,
getStationListByUserID
,
GetTableJson
}
from
'../../apis/process'
...
@@ -30,7 +30,7 @@ const TableRender = (props) => {
...
@@ -30,7 +30,7 @@ const TableRender = (props) => {
const
userID
=
window
?.
globalConfig
?.
userInfo
?.
OID
||
1
const
userID
=
window
?.
globalConfig
?.
userInfo
?.
OID
||
1
const
{
accountName
}
=
props
const
{
accountName
}
=
props
const
[
detailShow
,
setDetailShow
]
=
useState
(
false
)
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
[
loading
,
setLoading
]
=
useState
(
false
)
const
[
config
,
setConfig
]
=
useState
({
webShowFieldGroup
:
''
,
formJson
:
''
,
values
:
[]
})
const
[
config
,
setConfig
]
=
useState
({
webShowFieldGroup
:
''
,
formJson
:
''
,
values
:
[]
})
const
[
dataSource
,
setDataSource
]
=
useState
([])
const
[
dataSource
,
setDataSource
]
=
useState
([])
...
@@ -135,6 +135,7 @@ const TableRender = (props) => {
...
@@ -135,6 +135,7 @@ const TableRender = (props) => {
const
{
code
,
data
,
msg
}
=
await
GetAccountPageList
({
...
params
,
...
param
})
const
{
code
,
data
,
msg
}
=
await
GetAccountPageList
({
...
params
,
...
param
})
if
(
code
===
0
)
{
if
(
code
===
0
)
{
setDataSource
(
JSON
.
parse
(
data
.
jsonData
))
setDataSource
(
JSON
.
parse
(
data
.
jsonData
))
setParams
({
...
params
,
total
:
data
.
totalCount
,
pageIndex
:
data
.
pageIndex
,
pageSize
:
data
.
pageSize
})
}
else
{
}
else
{
setDataSource
([])
setDataSource
([])
message
.
error
(
msg
)
message
.
error
(
msg
)
...
@@ -142,6 +143,10 @@ const TableRender = (props) => {
...
@@ -142,6 +143,10 @@ const TableRender = (props) => {
setLoading
(
false
)
setLoading
(
false
)
}
}
const
pageChange
=
(
pageIndex
,
pageSize
)
=>
{
getDataSource
({
pageIndex
,
pageSize
})
}
const
getData
=
()
=>
{
const
getData
=
()
=>
{
getConfig
()
getConfig
()
getDataSource
()
getDataSource
()
...
@@ -175,7 +180,16 @@ const TableRender = (props) => {
...
@@ -175,7 +180,16 @@ const TableRender = (props) => {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
footer
}
>
<
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
>
<
/div
>
<
div
className
=
{
styles
.
tableDetail
}
style
=
{{
display
:
detailShow
?
'block'
:
'none'
}}
>
<
div
className
=
{
styles
.
tableDetail
}
style
=
{{
display
:
detailShow
?
'block'
:
'none'
}}
>
...
...
This diff is collapsed.
Click to expand it.
src/core/Account/index.less
View file @
d502d22e
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
}
}
&:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) {
&:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) {
td {
td {
background: rgb(237,
242,
255)!important;
background: rgb(237,
242,
255)!important;
}
}
}
}
} // .ant-table-tbody > tr > td:last-child {
} // .ant-table-tbody > tr > td:last-child {
...
@@ -97,8 +97,12 @@
...
@@ -97,8 +97,12 @@
position: absolute;
position: absolute;
bottom: 0;
bottom: 0;
left: 0;
left: 0;
padding: 0 20px;
width: 100%;
width: 100%;
height: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: space-between;
}
}
}
}
.tableDetail {
.tableDetail {
...
...
This diff is collapsed.
Click to expand it.
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