diff --git a/react-ui/src/components/IFramePage/index.tsx b/react-ui/src/components/IFramePage/index.tsx index 8832b049..1982c816 100644 --- a/react-ui/src/components/IFramePage/index.tsx +++ b/react-ui/src/components/IFramePage/index.tsx @@ -58,6 +58,8 @@ type IframePageProps = { url?: string; /** 是否可以在页签上打开 */ openInTab?: boolean; + /** 是否显示加载 */ + showLoading?: boolean; /** 自定义样式类名 */ className?: string; /** 自定义样式 */ @@ -65,40 +67,54 @@ type IframePageProps = { }; /** 系统内嵌 iframe,目前系统有数据标注、应用开发、开发环境、GitLink 四个子系统,使用时可以添加其他子系统 */ -function IframePage({ type, url, openInTab = false, className, style }: IframePageProps) { +function IframePage({ + type, + url, + showLoading = true, + openInTab = false, + className, + style, +}: IframePageProps) { const [iframeUrl, setIframeUrl] = useState(''); // const [loading, setLoading] = useState(false); useEffect(() => { const requestIframeUrl = async (type: IframePageType) => { - // setLoading(true); - Loading.show(); + if (showLoading) { + Loading.show(); + } const [res] = await to(getRequestAPI(type)()); if (res && res.data) { setIframeUrl(res.data); } else { - Loading.hide(); - // setLoading(false); + if (showLoading) { + Loading.hide(); + } } }; if (type) { requestIframeUrl(type); } else if (url) { - Loading.show(); + if (showLoading) { + Loading.show(); + } + setIframeUrl(url); } - }, [type, url]); + }, [type, url, showLoading]); const handleLoad = () => { - // setLoading(false); - Loading.hide(); + if (showLoading) { + Loading.hide(); + } }; const handleError = (error?: React.SyntheticEvent) => { - // setLoading(false); console.log('error', error); - Loading.hide(); + if (showLoading) { + Loading.hide(); + } }; return ( diff --git a/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx b/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx index 6809ed88..23d836f5 100644 --- a/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx +++ b/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx @@ -58,7 +58,7 @@ function ServiceVersionInfo() { key: ModelDeploymentTabKey.Predict, label: '预测', icon: , - children: , + children: , }); }