Commit 0b2e4553 by zhaochengxiang

模型列表定位

parent 63e85eb1
......@@ -215,7 +215,7 @@ tr.drop-over-upward td {
}
.anchor {
background-color: #e7f7ff;
background-color: #e7f7ff !important;
}
.m-common {
......
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}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment