diff --git a/src/components/FileStatus/FileStatus.tsx b/src/components/FileStatus/FileStatus.tsx index 642df3d..e7c591a 100644 --- a/src/components/FileStatus/FileStatus.tsx +++ b/src/components/FileStatus/FileStatus.tsx @@ -6,13 +6,14 @@ import FileIcon from '../FileIcon'; import ATooltip from '../Tooltip'; import styles from './FileStatus.less'; 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 { DATA } from '@/services/API'; import { identity } from 'lodash'; import { useCallback } from 'react'; import { fetchLocalApi } from '@/utils/request'; import system from '@/services/system'; +import { handleRequest } from '@/utils/tool'; interface FileStatusProps { className?: string; @@ -35,12 +36,17 @@ export default function FileStatus(props: FileStatusProps) { : ''; }, [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]); - 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]); const checkFile = useCallback(() => { diff --git a/src/layouts/nav.tsx b/src/layouts/nav.tsx index 4556be4..fec0188 100644 --- a/src/layouts/nav.tsx +++ b/src/layouts/nav.tsx @@ -10,11 +10,25 @@ import classNames from 'classnames'; import ATooltip from '@/components/Tooltip'; import { Link } from 'umi'; - const navList = [ - { pathname: '/sync', name: '同步任务', icon: syncImg, activeIcon: syncActiveImg }, - { pathname: '/messages', name: '消息通知', icon: messagesImg, activeIcon: messagesActiveImg }, - { pathname: '/log', name: '操作记录', icon: logImg, activeIcon: logActiveImg }, + { + pathname: '/sync', + name: '同步任务', + icon: syncImg, + activeIcon: syncActiveImg, + }, + { + pathname: '/messages', + name: '消息中心', + icon: messagesImg, + activeIcon: messagesActiveImg, + }, + { + pathname: '/log', + name: '操作记录', + icon: logImg, + activeIcon: logActiveImg, + }, ]; interface NavProps { @@ -27,18 +41,22 @@ export default function Nav(props: NavProps) { const { pathname: currentPathname } = props; return (