From 39e93b563f361d49aeae212384a169ca28b66834 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Wed, 18 Sep 2024 14:35:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A8=A1=E5=9E=8B=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=80=89=E4=B8=AD=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/components/KFSpin/index.less | 2 +- .../pages/Dataset/components/CategoryList/index.tsx | 13 ++++--------- .../pages/Dataset/components/ResourceList/index.tsx | 4 ++-- react-ui/src/pages/Dataset/config.tsx | 6 +++--- react-ui/src/pages/Experiment/Comparison/index.tsx | 8 ++++---- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/react-ui/src/components/KFSpin/index.less b/react-ui/src/components/KFSpin/index.less index 56ff13a1..753154d7 100644 --- a/react-ui/src/components/KFSpin/index.less +++ b/react-ui/src/components/KFSpin/index.less @@ -9,7 +9,7 @@ flex-direction: column; align-items: center; justify-content: center; - background-color: rgba(255, 255, 255, 0.5); + background-color: rgba(255, 255, 255, 0.3); &__label { margin-top: 20px; diff --git a/react-ui/src/pages/Dataset/components/CategoryList/index.tsx b/react-ui/src/pages/Dataset/components/CategoryList/index.tsx index 8582168e..44922a29 100644 --- a/react-ui/src/pages/Dataset/components/CategoryList/index.tsx +++ b/react-ui/src/pages/Dataset/components/CategoryList/index.tsx @@ -3,17 +3,12 @@ import { CategoryData, ResourceType, resourceConfig } from '../../config'; import CategoryItem from '../CategoryItem'; import styles from './index.less'; -export type CategoryValue = { - dataType: number | undefined; - dataTag: number | undefined; -}; - type CategoryProps = { resourceType: ResourceType; // 资源类型,数据集还是模型 typeList: CategoryData[]; tagList: CategoryData[]; - activeType?: number; - activeTag?: number; + activeType?: string; + activeTag?: string; onTypeSelect: (value: CategoryData) => void; onTagSelect: (value: CategoryData) => void; onSearch: (value: string) => void; @@ -44,7 +39,7 @@ function CategoryList({ resourceType={resourceType} item={item} onClick={onTypeSelect} - isSelected={item.id === activeType} + isSelected={item.name === activeType} > ))} @@ -58,7 +53,7 @@ function CategoryList({ resourceType={resourceType} item={item} onClick={onTagSelect} - isSelected={item.id === activeTag} + isSelected={item.name === activeTag} > ))} diff --git a/react-ui/src/pages/Dataset/components/ResourceList/index.tsx b/react-ui/src/pages/Dataset/components/ResourceList/index.tsx index d194540a..739f3245 100644 --- a/react-ui/src/pages/Dataset/components/ResourceList/index.tsx +++ b/react-ui/src/pages/Dataset/components/ResourceList/index.tsx @@ -20,8 +20,8 @@ export type ResourceListRef = { type ResourceListProps = { resourceType: ResourceType; - dataType?: number; - dataTag?: number; + dataType?: string; + dataTag?: string; isPublic: boolean; typeList: CategoryData[]; tagList: CategoryData[]; diff --git a/react-ui/src/pages/Dataset/config.tsx b/react-ui/src/pages/Dataset/config.tsx index 5a9fb008..7f9a4af9 100644 --- a/react-ui/src/pages/Dataset/config.tsx +++ b/react-ui/src/pages/Dataset/config.tsx @@ -29,9 +29,9 @@ type ResourceTypeInfo = { deleteVersion: (params: any) => Promise; // 删除版本 getInfo: (params: any) => Promise; // 获取详情 name: string; // 名称 - typeParamKey: string; // 类型参数名称,获取资源列表接口使用 - tagParamKey: string; // 标签参数名称,获取资源列表接口使用 - filePropKey: string; + typeParamKey: 'data_type' | 'model_type'; // 类型参数名称,获取资源列表接口使用 + tagParamKey: 'data_tag' | 'model_tag'; // 标签参数名称,获取资源列表接口使用 + filePropKey: 'dataset_version_vos' | 'model_version_vos'; // 文件列表属性 tabItems: TabsProps['items']; // tab 列表 typeTitle: string; // 类型标题 tagTitle: string; // 标签标题 diff --git a/react-ui/src/pages/Experiment/Comparison/index.tsx b/react-ui/src/pages/Experiment/Comparison/index.tsx index e11a0166..c4695d59 100644 --- a/react-ui/src/pages/Experiment/Comparison/index.tsx +++ b/react-ui/src/pages/Experiment/Comparison/index.tsx @@ -34,7 +34,7 @@ function ExperimentComparison() { // const [cacheState, setCacheState] = useCacheState(); // const [total, setTotal] = useState(0); const [selectedRowKeys, setSelectedRowKeys] = useState([]); - const [loading, setLoading] = useState(false); + // const [loading, setLoading] = useState(false); const { message } = App.useApp(); const config = useMemo(() => comparisonConfig[comparisonType], [comparisonType]); // const [pagination, setPagination] = useState( @@ -50,11 +50,11 @@ function ExperimentComparison() { // 获取对比数据列表 const getComparisonData = async () => { - setLoading(true); + // setLoading(true); const request = comparisonType === ComparisonType.Train ? getExpTrainInfosReq : getExpEvaluateInfosReq; const [res] = await to(request(experimentId)); - setLoading(false); + // setLoading(false); if (res && res.data) { // const { content = [], totalElements = 0 } = res.data; setTableData(res.data); @@ -204,7 +204,7 @@ function ExperimentComparison() { scroll={{ y: 'calc(100% - 55px)', x: '100%' }} pagination={false} bordered={true} - loading={loading} + // loading={loading} // pagination={{ // ...pagination, // total: total,