diff --git a/frontend/src/components/dashboard/NavigationGrid.jsx b/frontend/src/components/dashboard/NavigationGrid.jsx index ee88021..2907cb2 100644 --- a/frontend/src/components/dashboard/NavigationGrid.jsx +++ b/frontend/src/components/dashboard/NavigationGrid.jsx @@ -4,12 +4,12 @@ import { CloudServerOutlined, DatabaseOutlined, WarningOutlined, - BarChartOutlined, AppstoreOutlined, SettingOutlined, ApartmentOutlined, LinkOutlined, ArrowRightOutlined, + AuditOutlined, } from '@ant-design/icons'; import { designTokens } from '../../config/theme'; @@ -39,12 +39,12 @@ const NAV_BUTTONS_DATA = [ description: '工单和故障处理', }, { - key: 'analytics', - icon: BarChartOutlined, - text: '数据分析', - path: '/', + key: 'inventory', + icon: AuditOutlined, + text: '资产盘点', + path: '/inventory', color: '#13c2c2', - description: '数据统计和分析', + description: '资产库存和盘点管理', }, { key: 'consumables', diff --git a/frontend/src/pages/BackupManagement.jsx b/frontend/src/pages/BackupManagement.jsx index c9f3af5..95d6c36 100644 --- a/frontend/src/pages/BackupManagement.jsx +++ b/frontend/src/pages/BackupManagement.jsx @@ -190,8 +190,22 @@ const BackupManagement = () => { } }; - const handleDownload = filename => { - window.open(`/api/backup/download/${filename}`, '_blank'); + const handleDownload = async filename => { + try { + const blob = await backupAPI.download(filename); + // 创建临时链接并触发下载 + const url = window.URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = url; + link.download = filename; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(url); + message.success('备份文件下载已开始'); + } catch (error) { + message.error('下载失败: ' + (error.message || '未知错误')); + } }; const handleValidate = async filename => {