From bff4f55f56e5f8a842690fa98f7932b0ef182e0b Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Thu, 21 May 2026 13:05:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=97=E6=B3=95=E5=88=86=E6=9E=90=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Agri.jsx | 165 ++++++++++++++++++++++++++++++++------------- 1 file changed, 118 insertions(+), 47 deletions(-) diff --git a/src/pages/Agri.jsx b/src/pages/Agri.jsx index 3f52ae3..f48fef8 100644 --- a/src/pages/Agri.jsx +++ b/src/pages/Agri.jsx @@ -11,7 +11,7 @@ import { PlayCircleOutlined, FileTextOutlined, HistoryOutlined, SearchOutlined, SettingOutlined, FullscreenOutlined, UploadOutlined, LoadingOutlined, CheckOutlined, - SyncOutlined + SyncOutlined, DatabaseOutlined } from '@ant-design/icons'; import { getDetectModels, @@ -211,49 +211,113 @@ export default function Agri() { setHistory(prev => [newItem, ...prev]); }; - // 渲染统计卡片 + + // 替换成这个 renderStats const renderStats = () => ( - - - - 算法数量} - value={2} - suffix={检测 + 分割} - valueStyle={{ color: '#1677ff', fontWeight: 800, fontSize: 20 }} - /> - - - - - 在线服务} - value={2} - suffix={health 实时检查} - valueStyle={{ color: '#1677ff', fontWeight: 800, fontSize: 20 }} - /> - - - - - 模型数量} - value={models.length || 3} - suffix={检测模型 registry} - valueStyle={{ color: '#1677ff', fontWeight: 800, fontSize: 20 }} - /> - - - - - 历史记录} - value={history.length} - suffix={本页联调记录} - valueStyle={{ color: '#1677ff', fontWeight: 800, fontSize: 20 }} - /> - - + + {[ + { + title: '算法数量', + value: '2', + unit: '检测 + 分割', + icon: , + color: '#165DFF', + bg: '#E8F3FF', + }, + { + title: '在线服务', + value: '2', + unit: 'health 实时检查', + icon: , + color: '#00B42A', + bg: '#E8FFEA', + }, + { + title: '模型数量', + value: models.length || 3, + unit: '检测模型 registry', + icon: , + color: '#165DFF', + bg: '#E8F3FF', + }, + { + title: '历史记录', + value: history.length, + unit: '本页联调记录', + icon: , + color: '#722ED1', + bg: '#F3E8FF', + }, + ].map((item, index) => ( + + +
+
+
+ {item.title} +
+
+ {item.value} + {item.unit && ( + + {item.unit} + + )} +
+
+
+ {React.cloneElement(item.icon, { + style: { fontSize: 22, color: item.color }, + })} +
+
+
+ + ))}
); @@ -613,11 +677,18 @@ export default function Agri() { return (
+
+ + 算法分析中心 + + +
{renderStats()} - + + {/* 左侧:算法列表 */} - + 算法列表} bordered={false} @@ -654,7 +725,7 @@ export default function Agri() { {/* 中间:工作区 */} - + @@ -683,7 +754,7 @@ export default function Agri() { {/* 右侧:历史记录 */} - + 历史分析记录} bordered={false}