Commit c2dda2a3 authored by chenshouchao's avatar chenshouchao

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

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