From 11fb9a193dac761b8a596b88f394b91d0dc20a75 Mon Sep 17 00:00:00 2001 From: zhaowei Date: Thu, 11 Sep 2025 14:59:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E9=9B=86=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/Dataset/components/ResourceInfo/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/react-ui/src/pages/Dataset/components/ResourceInfo/index.tsx b/react-ui/src/pages/Dataset/components/ResourceInfo/index.tsx index 774fb30d..aebdeefc 100644 --- a/react-ui/src/pages/Dataset/components/ResourceInfo/index.tsx +++ b/react-ui/src/pages/Dataset/components/ResourceInfo/index.tsx @@ -61,6 +61,7 @@ const ResourceInfo = ({ resourceType }: ResourceInfoProps) => { const config = resourceConfig[resourceType]; const typeName = config.name; // 数据集/模型 const { message } = App.useApp(); + const [noVersions, setNoVersions] = useState(false); // 获取详情 const getResourceDetail = useCallback( @@ -104,6 +105,7 @@ const ResourceInfo = ({ resourceType }: ResourceInfoProps) => { setVersion(res.data[0].name); } } else { + setNoVersions(true); setVersion(undefined); getResourceDetail(undefined); } @@ -351,14 +353,14 @@ const ResourceInfo = ({ resourceType }: ResourceInfoProps) => { 删除版本 - ) : ( + ) : noVersions ? ( {info.description ?? '暂无描述'} - )} + ) : null}
{version ? ( @@ -368,7 +370,7 @@ const ResourceInfo = ({ resourceType }: ResourceInfoProps) => { {activeTab === ResourceInfoTabKeys.Evolution && }
- ) : ( + ) : noVersions ? ( { buttonTitle="创建版本" onButtonClick={showAddVersionModal} /> - )} + ) : null} );