fix: 模型类型没有选中展示
This commit is contained in:
parent
eeb0d0c149
commit
39e93b563f
|
@ -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;
|
||||
|
|
|
@ -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}
|
||||
></CategoryItem>
|
||||
))}
|
||||
</Flex>
|
||||
|
@ -58,7 +53,7 @@ function CategoryList({
|
|||
resourceType={resourceType}
|
||||
item={item}
|
||||
onClick={onTagSelect}
|
||||
isSelected={item.id === activeTag}
|
||||
isSelected={item.name === activeTag}
|
||||
></CategoryItem>
|
||||
))}
|
||||
</Flex>
|
||||
|
|
|
@ -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[];
|
||||
|
|
|
@ -29,9 +29,9 @@ type ResourceTypeInfo = {
|
|||
deleteVersion: (params: any) => Promise<any>; // 删除版本
|
||||
getInfo: (params: any) => Promise<any>; // 获取详情
|
||||
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; // 标签标题
|
||||
|
|
|
@ -34,7 +34,7 @@ function ExperimentComparison() {
|
|||
// const [cacheState, setCacheState] = useCacheState();
|
||||
// const [total, setTotal] = useState(0);
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
// const [loading, setLoading] = useState(false);
|
||||
const { message } = App.useApp();
|
||||
const config = useMemo(() => comparisonConfig[comparisonType], [comparisonType]);
|
||||
// const [pagination, setPagination] = useState<TablePaginationConfig>(
|
||||
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue