From 995c8c482b31682822feb5bf584804e69df22be7 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Thu, 14 May 2026 17:23:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B4=A7=E5=87=91=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layout.tsx | 33 ++++-- .../SystemSetting/BasicSettings.tsx | 36 +++---- src/components/alerts/AlarmOverview.tsx | 6 +- src/components/devices/DeviceOverviewPage.tsx | 93 ++++++++-------- src/components/devices/WayLinePage.tsx | 4 +- src/index.css | 31 ++++-- src/pages/AIAnalysis.tsx | 100 +++++------------- src/pages/Alerts.tsx | 16 +-- src/pages/CleanOptimization.tsx | 16 +-- src/pages/Devices.tsx | 16 +-- src/pages/Home.tsx | 44 ++++---- src/pages/RealTimeMonitor.tsx | 60 +++++------ src/pages/ReportCenter.tsx | 28 ++--- src/pages/SystemSetting.tsx | 13 ++- src/pages/VideoMonitorPage.tsx | 8 +- src/pages/WorkOrder.tsx | 12 +-- 16 files changed, 248 insertions(+), 268 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 2c3d504..5652573 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -103,10 +103,31 @@ export default function AppLayout() { locale={zhCN} theme={{ algorithm: theme.defaultAlgorithm, - token: { colorPrimary: '#1890ff', borderRadius: 2 }, + token: { + colorPrimary: '#1890ff', + borderRadius: 2, + // 全局紧凑设置 + padding: 12, + paddingLG: 16, + margin: 12, + marginLG: 16, + }, components: { Layout: { headerBg: '#fff', siderBg: '#fff' }, - Menu: { itemBg: '#fff', itemSelectedBg: '#e6f4ff' } + Menu: { itemBg: '#fff', itemSelectedBg: '#e6f4ff' }, + Card: { + paddingLG: 12, // 减小 Card 默认内边距 + }, + Table: { + padding: 8, // 减小 Table 单元格边距 + paddingXS: 4, + }, + Form: { + itemMarginBottom: 12, // 减小表单项间距 + }, + Space: { + gap: 8, // 减小 Space 间距 + } } }} > @@ -114,14 +135,14 @@ export default function AppLayout() {
@@ -200,7 +221,7 @@ export default function AppLayout() { /> - + diff --git a/src/components/SystemSetting/BasicSettings.tsx b/src/components/SystemSetting/BasicSettings.tsx index ca0915a..222b7a5 100644 --- a/src/components/SystemSetting/BasicSettings.tsx +++ b/src/components/SystemSetting/BasicSettings.tsx @@ -167,23 +167,13 @@ const BasicSettings = () => { ]; return ( -
-
- 系统设置 - }> - - - - - - - -
+
+ {/* 顶部统计卡片 */} - + {topCards.map((item, idx) => ( - +
@@ -203,14 +193,14 @@ const BasicSettings = () => { ))} - + {/* 左侧 */} {/* 基础配置 */} 基础配置} bordered={false} - style={{ borderRadius: 10, marginBottom: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} + style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} bodyStyle={{ padding: '16px' }} >
@@ -291,10 +281,10 @@ const BasicSettings = () => { 通知与告警策略} bordered={false} - style={{ borderRadius: 10, marginBottom: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} + style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} bodyStyle={{ padding: '16px' }} > - + {[ { label: '短信', icon: , color: '#52c41a', status: '已启用' }, { label: '邮件', icon: , color: '#1677ff', status: '已启用' }, @@ -340,6 +330,10 @@ const BasicSettings = () => { `共 ${total} 条` }} columns={[ { title: '用户名', dataIndex: 'name', key: 'name', fixed: 'left', width: 80 }, @@ -391,7 +385,7 @@ const BasicSettings = () => { 角色权限概览} bordered={false} - style={{ borderRadius: 10, marginBottom: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} + style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} bodyStyle={{ padding: '10px' }} > @@ -422,7 +416,7 @@ const BasicSettings = () => { title={设备接入状态} extra={} bordered={false} - style={{ borderRadius: 10, marginBottom: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} + style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} bodyStyle={{ padding: '12px' }} >
@@ -481,7 +475,7 @@ const BasicSettings = () => { 数据与安全} bordered={false} - style={{ borderRadius: 10, marginBottom: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} + style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} bodyStyle={{ padding: '12px' }} >
diff --git a/src/components/alerts/AlarmOverview.tsx b/src/components/alerts/AlarmOverview.tsx index ef473e9..4314b94 100644 --- a/src/components/alerts/AlarmOverview.tsx +++ b/src/components/alerts/AlarmOverview.tsx @@ -278,7 +278,7 @@ export default function AlarmCenterPage() {
{/* 查询栏 */} - +
@@ -357,7 +357,7 @@ export default function AlarmCenterPage() { {/* 统计卡片 */} - + {[ { title: '今日告警总数', @@ -446,7 +446,7 @@ export default function AlarmCenterPage() { {/* 表格 */} - + diff --git a/src/components/devices/DeviceOverviewPage.tsx b/src/components/devices/DeviceOverviewPage.tsx index e4f271a..60c6485 100644 --- a/src/components/devices/DeviceOverviewPage.tsx +++ b/src/components/devices/DeviceOverviewPage.tsx @@ -170,31 +170,31 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll, return ( {/**/} - + {dynamicTopCards.map((card, idx) => ( - + -
+
{/* 左侧图标 */}
@@ -219,13 +219,13 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll, ))} - +
- 装备协同态势图} extra={
record.id || record.serialNumber || record.device_sn} size="small" pagination={false} columns={[ - { title: '装备名称', dataIndex: 'name', width: 160 }, - { title: '类型', dataIndex: 'type', width: 100 }, - { title: '当前状态', dataIndex: 'status', width: 80, render: s => {s} }, - { title: '模式', dataIndex: 'mode', width: 80 }, - { title: '电量', dataIndex: 'battery', width: 80, render: v => }, - { title: '位置', dataIndex: 'position', width: 100 }, - { title: '当前任务', dataIndex: 'task', width: 120 }, - { title: '通讯状态', dataIndex: 'comm', width: 80, render: v => }, - { title: '操作', key: 'action', width: 100, render: () => }> + 控制日志 / 告警记录} bordered={false} style={{ borderRadius: 8 }} extra={
}>
{t} }, - { title: '设备', dataIndex: 'device', width: 120, render: t => {t} }, - { title: '类型', dataIndex: 'type', width: 80, render: t => { let c = '#52c41a'; if (t === '告警') c = '#fa8c16'; if (t === 'events') c = '#1890ff'; return
{t}
} }, - { title: '描述', dataIndex: 'desc', render: t => {t} }, - { title: '', width: 80, render: (_, r) => r.level ? {r.level} : null } + { title: '时间', dataIndex: 'time', width: 90, render: t => {t} }, + { title: '设备', dataIndex: 'device', width: 100, render: t => {t} }, + { title: '类型', dataIndex: 'type', width: 70, render: t => { let c = '#52c41a'; if (t === '告警') c = '#fa8c16'; if (t === 'events') c = '#1890ff'; return
{t}
} }, + { title: '描述', dataIndex: 'desc', render: t => {t} }, + { title: '', width: 70, render: (_, r) => r.level ? {r.level} : null } ]} /> -
+
@@ -273,13 +273,14 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll, 设备控制面板} bordered={false} - style={{ borderRadius: 12, marginBottom: 16 }} - bodyStyle={{ padding: 16, paddingBottom: 0 }} + style={{ borderRadius: 8, marginBottom: 8 }} + bodyStyle={{ padding: 12, paddingBottom: 0 }} >
- {/* AI建议与处置 */} -
-
+
+
AI 建议与处置
{g}, - width: 80 - }, - { - title: '置信度', - dataIndex: 'confidence', - key: 'confidence', - width: 70 - }, + { title: '建议措施', dataIndex: 'measure', ellipsis: true }, + { title: '优先级', dataIndex: 'priority', render: renderPriorityTag, width: 58 }, + { title: '收益', dataIndex: 'gain', render: g => {g}, width: 68 }, + { title: '置信度', dataIndex: 'confidence', width: 60 }, { title: '操作', key: 'action', - width: 90, + width: 76, render: (_, record) => ( ) }, @@ -608,13 +558,13 @@ export default function AIDiagnosisPage() { { key: '1', measure: '处理热斑组件', priority: '高', gain: '+2.15%', confidence: '92%', isView: false }, { key: '2', measure: '排查异常组串', priority: '高', gain: '+1.85%', confidence: '90%', isView: false }, { key: '3', measure: '清洗受遮挡区域', priority: '中', gain: '+0.45%', confidence: '78%', isView: false }, - { key: '4', measure: '跟踪衰减较大组件', priority: '中', gain: '+0.35%', confidence: '86%', isView: false }, - { key: '5', measure: '持续监控逆变器效率', priority: '低', gain: '+0.10%', confidence: '93%', isView: true }, + { key: '4', measure: '跟踪衰减组件', priority: '中', gain: '+0.35%', confidence: '86%', isView: false }, + { key: '5', measure: '监控逆变器效率', priority: '低', gain: '+0.10%', confidence: '93%', isView: true }, ]} pagination={false} size="small" - className="compact-table" rowKey="key" + style={{ fontSize: 12 }} /> diff --git a/src/pages/Alerts.tsx b/src/pages/Alerts.tsx index 8a05099..dccb741 100644 --- a/src/pages/Alerts.tsx +++ b/src/pages/Alerts.tsx @@ -69,13 +69,13 @@ export default function AlarmCenterPage() { return ( -
-
- 告警中心 - 告警处置闭环、规则管理与事件中心 +
+
+ 告警中心 + 告警处置闭环、规则管理与事件中心
-
+
{/* {renderTabContent()} diff --git a/src/pages/CleanOptimization.tsx b/src/pages/CleanOptimization.tsx index cc31705..6c477b2 100644 --- a/src/pages/CleanOptimization.tsx +++ b/src/pages/CleanOptimization.tsx @@ -153,7 +153,7 @@ export default function CleanOptimizationPage() { ( -
+ {/* 标题与操作栏 */} -
+
清洗优化管理 @@ -289,9 +289,9 @@ export default function CleanOptimizationPage() {
- + {/* 左侧:分析图表 */} -
+ 污染趋势分析} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}>
污染指数 @@ -389,7 +389,7 @@ export default function CleanOptimizationPage() { {/* 中间:地图分布与工单预览 */} -
+ 电站污染分布与建议清洗区块分布图} bordered={false} @@ -408,7 +408,7 @@ export default function CleanOptimizationPage() { {/* 地图背景图与浮动标签 */} -
+
{/* 模拟区块叠加层 */} @@ -472,7 +472,7 @@ export default function CleanOptimizationPage() { {/* 右侧:决策建议与参考 */} -
+ 智能清洗策略建议} bordered={false} style={cardStyle} bodyStyle={{ padding: 0 }}>
算法模型:多因子加权综合优化模型 (v2.0) diff --git a/src/pages/Devices.tsx b/src/pages/Devices.tsx index 41c99ee..734f682 100644 --- a/src/pages/Devices.tsx +++ b/src/pages/Devices.tsx @@ -97,28 +97,28 @@ export default function DeviceIndexPage() { return ( -
-
- 装备控制 - 装备总览、状态监控与参数配置 +
+
+ 装备控制 + 装备总览、状态监控与参数配置
-
+
setActiveTab(key)} items={tabs} - style={{ border: 0, height: 64, lineHeight: '64px' }} + style={{ border: 0, height: 40, lineHeight: '40px' }} />
{renderContent()} diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index ef5f9c0..3db1fd3 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -153,8 +153,8 @@ export default function StationDashboard() { }; return ( -
- +
+ {[ { title: '今日发电量', value: '4,752', unit: 'kWh', sub: '日目标 5,000 kWh', color: '#00B42A', bg: '#E8FFEA', icon: }, { title: '当前功率', value: '812.6', unit: 'kW', sub: '装机容量 1,000 kWp', color: '#165DFF', bg: '#E8F3FF', icon: }, @@ -164,31 +164,31 @@ export default function StationDashboard() { { title: '节省运维成本', value: '¥ 36,540', unit: '', sub: '本月累计节省', color: '#FF7D00', bg: '#FFF7E8', icon: }, ].map((item, idx) => (
-
{item.title}
+
{item.title}
- {item.value} - {item.unit && {item.unit}} + {item.value} + {item.unit && {item.unit}}
-
{item.sub}
+
{item.sub}
- {React.cloneElement(item.icon as React.ReactElement, { style: { fontSize: 28, color: item.color } })} + {React.cloneElement(item.icon as React.ReactElement, { style: { fontSize: 22, color: item.color } })}
@@ -196,16 +196,16 @@ export default function StationDashboard() { ))} {/* 主体布局 */} - + {/* 左侧:图表列 */} - - 发电趋势} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}> -
今日发电功率趋势 (kW)
+ + 发电趋势} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '8px' }}> +
今日发电功率趋势 (kW)
- 辐照度与温度趋势} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}> + 辐照度与温度趋势} bordered={false} style={cardStyle} bodyStyle={{ padding: '8px' }}> - + @@ -456,7 +456,7 @@ export default function StationDashboard() { {/* 右侧:状态与分析 */}
- + 实时告警} extra={} @@ -595,8 +595,6 @@ export default function StationDashboard() {
{weatherdata.weather}
- -
diff --git a/src/pages/RealTimeMonitor.tsx b/src/pages/RealTimeMonitor.tsx index 6ad3e3d..3be7d44 100644 --- a/src/pages/RealTimeMonitor.tsx +++ b/src/pages/RealTimeMonitor.tsx @@ -97,29 +97,29 @@ const RealTimeMonitorPage = () => { ]; return ( -
-
- 实时监控中心 - 全方位实时掌握电站设备运行状态与发电表现 +
+
+ 实时监控中心 + 全方位实时掌握电站设备运行状态与发电表现
- + {/* 左侧大栏 */}
- + {/* 电站拓扑图 */} 电站拓扑图 (实时)} + title={电站拓扑图 (实时)} extra={ -
- 正常 - 告警 - 离线 - •• 通讯中 +
+ 正常 + 告警 + 离线 + •• 通讯中
} bordered={false} - style={cardStyle} - bodyStyle={{ padding: 0, position: 'relative', height: 480, overflow: 'hidden' }} + style={{ ...cardStyle, borderRadius: 8 }} + bodyStyle={{ padding: 0, position: 'relative', height: 400, overflow: 'hidden' }} >