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
720554b7
Commit
720554b7
authored
May 30, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型增加总条数和已选条数
parent
cab9aa35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+22
-2
No files found.
src/view/Manage/Model/Component/ModelTable.jsx
View file @
720554b7
...
@@ -14,7 +14,7 @@ import { useContextMenu, Menu as RcMenu, Item as RcItem } from "react-contexify"
...
@@ -14,7 +14,7 @@ import { useContextMenu, Menu as RcMenu, Item as RcItem } from "react-contexify"
import
'./ModelTable.less'
;
import
'./ModelTable.less'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
'react-contexify/dist/ReactContexify.css'
;
const
{
Text
}
=
Typography
;
const
{
Paragraph
,
Text
}
=
Typography
;
const
ModelNameColumn
=
(
props
)
=>
{
const
ModelNameColumn
=
(
props
)
=>
{
const
{
text
,
record
,
detailItem
}
=
props
;
const
{
text
,
record
,
detailItem
}
=
props
;
...
@@ -226,6 +226,12 @@ const ModelTable = (props) => {
...
@@ -226,6 +226,12 @@ const ModelTable = (props) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
},
[
view
,
keyword
]);
},
[
view
,
keyword
]);
const
summarySelectedCount
=
useMemo
(()
=>
{
const
newSelectedRowKeys
=
Array
.
from
(
new
Set
([...
selectedRowKeys
,
...
expandedSelectedRowKeys
]));
return
(
newSelectedRowKeys
||
[]).
length
;
},
[
selectedRowKeys
,
expandedSelectedRowKeys
,
data
])
useEffect
(()
=>
{
useEffect
(()
=>
{
window
?.
addEventListener
(
"storage"
,
modelEventChange
);
window
?.
addEventListener
(
"storage"
,
modelEventChange
);
return
()
=>
{
return
()
=>
{
...
@@ -450,9 +456,23 @@ const ModelTable = (props) => {
...
@@ -450,9 +456,23 @@ const ModelTable = (props) => {
return
(
return
(
<
div
>
<
div
>
<
div
className=
'flex'
style=
{
{
height
:
20
,
alignItems
:
'center'
,
marginBottom
:
12
}
}
>
<
Paragraph
style=
{
{
overflow
:
'hidden'
}
}
>
<
Text
className=
'title-color'
ellipsis=
{
true
}
>
总条数:
<
Text
className=
'text-color'
>
{
(
data
||
[]).
length
}
</
Text
>
</
Text
>
</
Paragraph
>
<
Paragraph
style=
{
{
overflow
:
'hidden'
,
marginLeft
:
20
}
}
>
<
Text
className=
'title-color'
ellipsis=
{
true
}
>
已选条数:
<
Text
className=
'text-color'
>
{
summarySelectedCount
}
</
Text
>
</
Text
>
</
Paragraph
>
</
div
>
<
DataGrid
<
DataGrid
gridRef=
{
gridRef
}
gridRef=
{
gridRef
}
style=
{
{
blockSize
:
'calc(100vh - 94px - 37px - 57px - 24px)'
}
}
style=
{
{
blockSize
:
'calc(100vh - 94px - 37px - 57px - 24px
- 32px
)'
}
}
checkable
checkable
columns=
{
columns
}
columns=
{
columns
}
rows=
{
data
||
[]
}
rows=
{
data
||
[]
}
...
...
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