Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
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
zhaochengxiang
szse
Commits
56809f2a
Commit
56809f2a
authored
Feb 09, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分页bug修改
parent
0648f3d2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
index.less
src/index.less
+1
-1
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+17
-14
index.jsx
src/view/Manage/Model/index.jsx
+2
-1
No files found.
src/index.less
View file @
56809f2a
...
@@ -177,7 +177,7 @@ tr.drop-over-upward td {
...
@@ -177,7 +177,7 @@ tr.drop-over-upward td {
.tooltip-common {
.tooltip-common {
max-width: 450px;
max-width: 450px;
max-height: 3
0
0px;
max-height: 3
5
0px;
.yy-popover-inner-content {
.yy-popover-inner-content {
padding: 8px !important;
padding: 8px !important;
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
56809f2a
...
@@ -128,7 +128,7 @@ const ResizeableHeaderCell = props => {
...
@@ -128,7 +128,7 @@ const ResizeableHeaderCell = props => {
const
ModelTable
=
(
props
)
=>
{
const
ModelTable
=
(
props
)
=>
{
const
{
data
,
onChange
,
onItemAction
,
onSelect
,
onHistory
,
catalogId
,
keyword
,
onAutoCreateTable
,
offset
=
null
,
modelId
=
null
,
view
,
selectModelerIds
,
onSubSelect
}
=
props
;
const
{
data
,
onChange
,
onItemAction
,
onSelect
,
onHistory
,
catalogId
,
keyword
,
onAutoCreateTable
,
offset
=
null
,
modelId
=
null
,
view
,
selectModelerIds
,
onSubSelect
,
modelState
}
=
props
;
const
MENU_ID
=
(((
modelId
||
''
)
!==
''
)
?
`model-table-contextmenu-
${
modelId
}
`
:
'model-table-contextmenu'
);
const
MENU_ID
=
(((
modelId
||
''
)
!==
''
)
?
`model-table-contextmenu-
${
modelId
}
`
:
'model-table-contextmenu'
);
...
@@ -287,21 +287,24 @@ const ModelTable = (props) => {
...
@@ -287,21 +287,24 @@ const ModelTable = (props) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
offset
!==
null
)
{
const
_pageNum
=
parseInt
(
offset
/
pageSize
+
((
offset
%
pageSize
===
0
)?
0
:
1
));
setPagination
({...
pagination
,
pageNum
:
_pageNum
});
}
else
if
((
modelId
||
''
)
!==
''
)
{
getDataModel
();
}
else
{
setPagination
({...
pagination
,
pageNum
:
1
});
}
if
((
modelId
||
''
)
===
''
)
{
if
((
modelId
||
''
)
===
''
)
{
onSelect
&&
onSelect
([]);
onSelect
&&
onSelect
([]);
if
((
keyword
||
''
)
===
''
)
{
if
(
offset
!==
null
)
{
const
_pageNum
=
parseInt
(
offset
/
pageSize
+
((
offset
%
pageSize
===
0
)?
0
:
1
));
setPagination
({...
pagination
,
pageNum
:
_pageNum
});
}
else
{
setPagination
({...
pagination
,
pageNum
:
1
});
}
}
else
{
setPagination
({...
pagination
,
pageNum
:
1
});
}
}
else
{
getDataModel
();
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
catalogId
,
keyword
,
offset
]);
},
[
catalogId
,
keyword
,
offset
,
modelState
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
((
selectModelerIds
||
[]).
length
===
0
)
{
if
((
selectModelerIds
||
[]).
length
===
0
)
{
...
@@ -713,13 +716,13 @@ const ModelTable = (props) => {
...
@@ -713,13 +716,13 @@ const ModelTable = (props) => {
setPagination
({
pageNum
:
_pageNum
,
pageSize
:
_pageSize
||
20
});
setPagination
({
pageNum
:
_pageNum
,
pageSize
:
_pageSize
||
20
});
}
}
}
}
onShowSizeChange=
{
(
_pageNum
,
_pageSize
)
=>
{
onShowSizeChange=
{
(
_pageNum
,
_pageSize
)
=>
{
setPagination
({
pageNum
:
_pageNum
||
1
,
pageSize
:
_pageSize
});
setPagination
({
pageNum
:
1
,
pageSize
:
_pageSize
});
}
}
}
}
current=
{
pageNum
}
current=
{
pageNum
}
pageSize=
{
pageSize
}
pageSize=
{
pageSize
}
defaultCurrent=
{
1
}
defaultCurrent=
{
1
}
total=
{
(
data
||
[]).
length
}
total=
{
(
data
||
[]).
length
}
pageSizeOptions=
{
[
10
,
20
]
}
pageSizeOptions=
{
[
10
,
20
,
50
]
}
showTotal=
{
total
=>
`共 ${total} 条`
}
showTotal=
{
total
=>
`共 ${total} 条`
}
/>
/>
}
}
...
...
src/view/Manage/Model/index.jsx
View file @
56809f2a
...
@@ -90,7 +90,7 @@ class Model extends React.Component {
...
@@ -90,7 +90,7 @@ class Model extends React.Component {
}
}
onModelStateChange
=
(
value
)
=>
{
onModelStateChange
=
(
value
)
=>
{
this
.
setState
({
currentModelState
:
value
},
()
=>
{
this
.
setState
({
currentModelState
:
value
,
offset
:
null
},
()
=>
{
this
.
onTableChange
();
this
.
onTableChange
();
})
})
}
}
...
@@ -420,6 +420,7 @@ class Model extends React.Component {
...
@@ -420,6 +420,7 @@ class Model extends React.Component {
catalogId={catalogId}
catalogId={catalogId}
view={currentView}
view={currentView}
data={filterTableData}
data={filterTableData}
modelState={currentModelState}
offset={offset}
offset={offset}
keyword={keyword}
keyword={keyword}
selectModelerIds={selectModelerIds}
selectModelerIds={selectModelerIds}
...
...
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