@@ -1,5 +1,7 @@
import InfoGroup from '@/components/InfoGroup';
import { AutoMLType } from '@/enums';
import { type HyperParameterFile } from '@/pages/AutoML/types';
import TrialFileTree from '@/pages/HyperParameter/components/TrialFileTree';
import { getFileReq } from '@/services/file';
import { to } from '@/utils/promise';
import { Button, Image } from 'antd';
@@ -11,9 +13,10 @@ type ExperimentResultProps = {
imageUrl?: string;
modelPath?: string;
type?: string;
file?: HyperParameterFile;
};
function ExperimentResult({ fileUrl, imageUrl, modelPath, type }: ExperimentResultProps) {
function ExperimentResult({ fileUrl, imageUrl, modelPath, type, file }: ExperimentResultProps) {
const [result, setResult] = useState<string | undefined>('');
const images = useMemo(() => {
@@ -32,16 +35,25 @@ function ExperimentResult({ fileUrl, imageUrl, modelPath, type }: ExperimentResu
}
};
if (fileUrl) {
if (fileUrl && type !== AutoMLType.Video ) {
getResultFile();
}
}, [fileUrl]);
}, [fileUrl, type ]);
return (
<div className={styles['experiment-result']}>
<InfoGroup title="实验结果" height={420} width="100%">
<div className={styles['experiment-result__text']}>{result}</div>
</InfoGroup>
{type === AutoMLType.Video ? (
<TrialFileTree
file={file}
title="实验结果"
classname={styles['experiment-result__file']}
></TrialFileTree>
) : (
<InfoGroup title="实验结果" height={420}>
<div className={styles['experiment-result__text']}>{result}</div>
</InfoGroup>
)}
{type === AutoMLType.Table && (
<InfoGroup title="可视化结果" style={{ margin: '16px 0' }}>
<div className={styles['experiment-result__images']}>
@@ -65,6 +77,7 @@ function ExperimentResult({ fileUrl, imageUrl, modelPath, type }: ExperimentResu
</div>
</InfoGroup>
)}
{modelPath && (
<div className={styles['experiment-result__download']}>
<span style={{ marginRight: '12px', color: '#606b7a' }}>文件名</span>