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
0b2e4553
Commit
0b2e4553
authored
May 26, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型列表定位
parent
63e85eb1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
index.less
src/index.less
+1
-1
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+6
-11
No files found.
src/index.less
View file @
0b2e4553
...
...
@@ -215,7 +215,7 @@ tr.drop-over-upward td {
}
.anchor {
background-color: #e7f7ff;
background-color: #e7f7ff
!important
;
}
.m-common {
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
0b2e4553
import
React
,
{
useState
,
useEffect
,
useRef
,
useMemo
}
from
"react"
;
import
{
Tooltip
,
Modal
,
Table
,
Typography
}
from
'antd'
;
import
SmoothScroll
from
'smooth-scroll'
;
import
LocalStorage
from
'local-storage'
;
import
DataGrid
from
'../../VirtualTable'
;
...
...
@@ -106,6 +105,7 @@ const ModelTable = (props) => {
const
anchorId
=
getQueryParam
(
AnchorId
,
props
?.
location
?.
search
);
const
anchorTimestamp
=
getQueryParam
(
AnchorTimestamp
,
props
?.
location
?.
search
);
const
gridRef
=
useRef
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
...
...
@@ -248,17 +248,11 @@ const ModelTable = (props) => {
},
[
anchorTimestamp
])
useEffect
(()
=>
{
if
(
shouldScrollRef
.
current
)
{
SmoothScroll
(
'a[href*="#"]'
);
const
_id
=
getQueryParam
(
AnchorId
,
props
.
location
.
search
);
var
scroll
=
new
SmoothScroll
();
var
anchor
=
document
.
querySelector
(
`#row-
${
_id
}
`
);
if
(
anchor
)
{
scroll
.
animateScroll
(
anchor
);
if
(
shouldScrollRef
.
current
&&
gridRef
.
current
&&
offset
!==
null
)
{
setTimeout
(()
=>
{
gridRef
.
current
.
scrollToRow
(
offset
);
shouldScrollRef
.
current
=
false
;
}
}
,
300
)
}
})
...
...
@@ -456,6 +450,7 @@ const ModelTable = (props) => {
return
(
<
div
>
<
DataGrid
gridRef=
{
gridRef
}
style=
{
{
blockSize
:
'calc(100vh - 94px - 37px - 57px - 24px)'
}
}
checkable
columns=
{
columns
}
...
...
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