Commit c2dda2a3 authored by chenshouchao's avatar chenshouchao

fix: 解决图像渲染造成弹窗卡顿的问题

parent 39a8d932
......@@ -19,7 +19,6 @@ import classNames from "classnames";
import Save from "./save";
import NoData from "@/components/BusinessComponents/NoData";
import Download from "./download";
import { useMessage } from "@/components/MySnackbar";
import style from "./index.module.css";
type ISeeDatasetProps = {
......@@ -32,7 +31,6 @@ type ISeeDatasetProps = {
const SeeDataset = observer((props: ISeeDatasetProps) => {
const { path, name, fileToken, projectId } = props;
const Message = useMessage();
const { currentProjectStore } = useStores();
const productId = toJS(currentProjectStore.currentProductInfo.id); // 产品id 如:cadd
const token = getToken();
......@@ -49,6 +47,14 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
const [selectItems, setSelectItems] = useState<Array<any>>([]);
const [saveOpen, setSaveOpen] = useState(false); // 另存为弹窗显示控制
const [downloadOpen, setDownloadOpen] = useState(false); // 下载弹窗显示控制
const [showAnimation, setShowAnimation] = useState(true); // 弹窗动画变化中
// 解决图像渲染造成弹窗卡顿的问题
useEffect(() => {
setTimeout(() => {
setShowAnimation(false);
}, 1000);
}, []);
const isCadd = useMemo(() => {
if (productId === "cadd") {
......@@ -256,6 +262,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
</div>
</div>
</div>
{!showAnimation && (
<div className={style.table}>
{list.length !== 0 && (
<>
......@@ -296,7 +303,9 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
className={style.datasetLiDataLi}
key={index}
>
<span className={style.datasetLiDataLiKey}>
<span
className={style.datasetLiDataLiKey}
>
{key}
</span>
<span
......@@ -310,7 +319,9 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
</div>
)}
{showData.length === 0 && (
<div className={style.noDataList}>请选择显示数据</div>
<div className={style.noDataList}>
请选择显示数据
</div>
)}
</div>
{graphicDimension === "2D" && (
......@@ -369,6 +380,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
)}
{list.length === 0 && <NoData text="未搜索到相关数据"></NoData>}
</div>
)}
</div>
<div className={style.foot}>
{isCadd && (
......
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