|
@@ -6,13 +6,14 @@ import FileIcon from '../FileIcon'; |
|
|
import ATooltip from '../Tooltip'; |
|
|
import ATooltip from '../Tooltip'; |
|
|
import styles from './FileStatus.less'; |
|
|
import styles from './FileStatus.less'; |
|
|
import { CloseCircleFilled, CheckCircleFilled } from '@ant-design/icons'; |
|
|
import { CloseCircleFilled, CheckCircleFilled } from '@ant-design/icons'; |
|
|
import { Progress, Button, ButtonProps } from 'antd'; |
|
|
|
|
|
|
|
|
import { Progress, Button, ButtonProps, message } from 'antd'; |
|
|
import { NotificationType, TaskStatus, TaskType } from '@/services/API.helper'; |
|
|
import { NotificationType, TaskStatus, TaskType } from '@/services/API.helper'; |
|
|
import { DATA } from '@/services/API'; |
|
|
import { DATA } from '@/services/API'; |
|
|
import { identity } from 'lodash'; |
|
|
import { identity } from 'lodash'; |
|
|
import { useCallback } from 'react'; |
|
|
import { useCallback } from 'react'; |
|
|
import { fetchLocalApi } from '@/utils/request'; |
|
|
import { fetchLocalApi } from '@/utils/request'; |
|
|
import system from '@/services/system'; |
|
|
import system from '@/services/system'; |
|
|
|
|
|
import { handleRequest } from '@/utils/tool'; |
|
|
|
|
|
|
|
|
interface FileStatusProps { |
|
|
interface FileStatusProps { |
|
|
className?: string; |
|
|
className?: string; |
|
@@ -35,12 +36,17 @@ export default function FileStatus(props: FileStatusProps) { |
|
|
: ''; |
|
|
: ''; |
|
|
}, [data]); |
|
|
}, [data]); |
|
|
|
|
|
|
|
|
const redoTask = useCallback(() => { |
|
|
|
|
|
fetchLocalApi('restartTask', { taskIds: data.taskId }); |
|
|
|
|
|
|
|
|
const redoTask = useCallback(async () => { |
|
|
|
|
|
const res = await fetchLocalApi('restartTask', { taskIds: data.taskId }); |
|
|
|
|
|
handleRequest(res).success(() => message.success('指令已发送')); |
|
|
}, [data.taskId]); |
|
|
}, [data.taskId]); |
|
|
|
|
|
|
|
|
const downloadFile = useCallback(() => { |
|
|
|
|
|
fetchLocalApi('downloadFileFromMsg', { fileObject: data.originData }); |
|
|
|
|
|
|
|
|
const downloadFile = useCallback(async () => { |
|
|
|
|
|
const res = await fetchLocalApi('downloadFileFromMsg', { |
|
|
|
|
|
fileObject: data.originData, |
|
|
|
|
|
}); |
|
|
|
|
|
4; |
|
|
|
|
|
handleRequest(res).success(() => message.success('下载指令已发送')); |
|
|
}, [data.taskId]); |
|
|
}, [data.taskId]); |
|
|
|
|
|
|
|
|
const checkFile = useCallback(() => { |
|
|
const checkFile = useCallback(() => { |
|
|