feat: 数据集导出

This commit is contained in:
archer
2023-04-03 00:18:21 +08:00
parent 05b2e9e99c
commit 16a31de1c7
9 changed files with 35 additions and 17 deletions

View File

@@ -105,7 +105,7 @@ const ModelDataCard = ({ model }: { model: ModelSchema }) => {
mutationFn: () => getExportDataList(model._id),
onSuccess(res) {
// 导出为文件
const blob = new Blob([JSON.stringify(res)], { type: 'application/json;charset=utf-8' });
const blob = new Blob([res], { type: 'application/json;charset=utf-8' });
// 创建下载链接
const downloadLink = document.createElement('a');
@@ -136,7 +136,7 @@ const ModelDataCard = ({ model }: { model: ModelSchema }) => {
size={'sm'}
onClick={() => refetchData(pageNum)}
/>
{/* <Button
<Button
variant={'outline'}
mr={2}
size={'sm'}
@@ -144,7 +144,7 @@ const ModelDataCard = ({ model }: { model: ModelSchema }) => {
onClick={() => onclickExport()}
>
</Button> */}
</Button>
<Menu>
<MenuButton as={Button} size={'sm'}>

View File

@@ -70,7 +70,7 @@ const SelectJsonModal = ({
const res = await postModelDataJsonData(modelId, fileData);
console.log(res);
toast({
title: '导入数据成功,需要一段拆解和训练',
title: '导入数据成功,需要一段时间训练',
status: 'success'
});
onClose();