From a1922cdeafd39477519e0f962eaaf1ab664e29f4 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Mon, 31 Aug 2026 10:30:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E6=B6=88?= =?UTF-8?q?=E9=99=A4=20=E6=8E=A7=E5=88=B6=E5=8F=B0=E7=9A=84=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layout.tsx | 3 +- src/components/Map.jsx | 15 +++- .../SystemSetting/BasicSettings.tsx | 35 ++++---- .../SystemSetting/LogManagement.tsx | 4 +- src/components/SystemSetting/OnlineUser.tsx | 6 +- .../SystemSetting/VideoManagement.tsx | 4 +- src/components/alerts/AlarmOverview.tsx | 14 +-- src/components/alerts/AlarmStatistics.tsx | 6 +- src/components/devices/DeviceOverviewPage.tsx | 20 ++--- src/components/devices/DeviceStatusPage.tsx | 32 +++---- src/components/devices/RobotTaskPage.tsx | 87 ++++++++++++------- src/components/devices/WayLinePage.tsx | 34 ++++---- src/components/recharts.jsx | 14 +-- src/index.css | 5 ++ src/locales/zh/index.ts | 2 +- src/pages/AIAnalysis.tsx | 32 +++---- src/pages/CleanOptimization.tsx | 32 +++---- src/pages/Home.tsx | 29 ++++--- src/pages/Profile.tsx | 4 +- src/pages/RealTimeMonitor.tsx | 20 ++--- src/pages/ReportCenter.tsx | 26 +++--- src/pages/VideoMonitorPage.tsx | 29 ++++--- src/pages/WorkOrder.tsx | 20 ++--- 23 files changed, 259 insertions(+), 214 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index eb8bf5e..feb1fdd 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect } from 'react'; import { Outlet, useNavigate, useLocation } from 'react-router-dom'; import { Layout, Menu, Button, Space, Select, Avatar, Card, Tag @@ -86,7 +86,6 @@ export default function AppLayout() { list.forEach(item => { map.set(item.menuId, { - ...item, key: item.path, label: item.menuName, icon: getIcon(item.path), diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 32f3fce..fb42197 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -651,9 +651,9 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, const layerIdentifier = `${workspace}:${layerName}`; let baseUrl = wmsUrl; const cesiumLayers = []; - if (index == 2 && from == "other") { - flyToLayer(layerIdentifier, baseUrl, 100); - } + //if (index == 2 && from == "other") { + // //flyToLayer(layerIdentifier, baseUrl, 100); + //} //if (index == 0 && from == "other") { // flyToLayer(layerIdentifier, baseUrl, 100); //} @@ -1246,8 +1246,17 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, if (viewer) { if (planLineRef.current) { viewer.entities.remove(planLineRef.current); + + planLineRef.current = null; } + + if (polygonRef.current) { + viewer.entities.remove(polygonRef.current); + + + polygonRef.current = null; + } viewer.scene.requestRender(); } prevIfClearPlanLine.current = ifClearPlanLine; diff --git a/src/components/SystemSetting/BasicSettings.tsx b/src/components/SystemSetting/BasicSettings.tsx index fb99460..c262e43 100644 --- a/src/components/SystemSetting/BasicSettings.tsx +++ b/src/components/SystemSetting/BasicSettings.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState } from 'react'; import { Form, Input, @@ -180,7 +180,7 @@ const BasicSettings = () => { {topCards.map((item, idx) => ( - +
{React.cloneElement(item.icon as React.ReactElement, { size: 20, style: item.icon.props.style ? { ...item.icon.props.style, fontSize: 20 } : { fontSize: 20 } })} @@ -205,9 +205,9 @@ const BasicSettings = () => { {/* 基础配置 */} {t('systemSetting.basicSettings')}} - bordered={false} + variant="borderless" style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} - bodyStyle={{ padding: '16px' }} + styles={{ body: { padding: '16px' } }} >
@@ -286,9 +286,9 @@ const BasicSettings = () => { {/* 通知与告警策略 */} {t('systemSetting.alert2')}} - bordered={false} + variant="borderless" style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} - bodyStyle={{ padding: '16px' }} + styles={{ body: { padding: '16px' } }} > {[ @@ -329,9 +329,9 @@ const BasicSettings = () => { {/* 用户与权限预览 */} {t('systemSetting.fixed2RolePermissionFixed2OverviewFixed2')}} - bordered={false} + variant="borderless" style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)', marginBottom: 0 }} - bodyStyle={{ padding: '12px' }} + styles={{ body: { padding: '12px' } }} > { empty={false} + rowKey="name" pagination={{ size: 'small', total: 4, pageSize: 4, showTotal: (total) => `共 ${total} 条` }} columns={[ { title: t('systemSetting.s36'), dataIndex: 'name', key: 'name', fixed: 'left', width: 80 }, @@ -356,7 +357,7 @@ const BasicSettings = () => { '数据分析师': { color: '#722ed1', bg: '#f9f0ff' }, }; const s = config[role] || { color: '#8c8c8c', bg: '#f5f5f5' }; - return {role}; + return {role}; } }, { title: t('users.phone'), dataIndex: 'phone', key: 'phone', width: 110 }, @@ -397,9 +398,9 @@ const BasicSettings = () => { {/* 角色权限概览 */} {t('systemSetting.fixed2RolePermissionFixed2OverviewFixed2')}} - bordered={false} + variant="borderless" style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} - bodyStyle={{ padding: '10px' }} + styles={{ body: { padding: '10px' } }} > {roleOverview.map((role, idx) => ( @@ -428,9 +429,9 @@ const BasicSettings = () => { {t('systemSetting.fixed2DeviceAccessFixed2StatusFixed2')}} extra={} - bordered={false} + variant="borderless" style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} - bodyStyle={{ padding: '12px' }} + styles={{ body: { padding: '12px' } }} >
@@ -487,9 +488,9 @@ const BasicSettings = () => { {/* 数据与安全 */} {t('systemSetting.dataSafety')}} - bordered={false} + variant="borderless" style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} - bodyStyle={{ padding: '12px' }} + styles={{ body: { padding: '12px' } }} >
{[ @@ -518,9 +519,9 @@ const BasicSettings = () => { {t('systemSetting.systemMaintenance')}} extra={} - bordered={false} + variant="borderless" style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} - bodyStyle={{ padding: '12px' }} + styles={{ body: { padding: '12px' } }} > {[ diff --git a/src/components/SystemSetting/LogManagement.tsx b/src/components/SystemSetting/LogManagement.tsx index d69bac0..45f2689 100644 --- a/src/components/SystemSetting/LogManagement.tsx +++ b/src/components/SystemSetting/LogManagement.tsx @@ -104,7 +104,7 @@ const LogManagement = () => { {t('systemSetting.equipmentControlActionsSuperAdminViewFixed2')}
- +
{ {/* ====================== Tab 1:在线用户 ====================== */} {activeTab === 'onlineUser' && ( - + {/* 搜索栏 */}
@@ -140,14 +140,14 @@ const OnlineUserPage = () => { showTotal: (total) => `${t('common.total')} ${total} ${t('common.items')}`, showQuickJumper: true }} - bordered={false} + variant="borderless" /> )} {/* ====================== Tab 2:其他页面(你可以随便改内容) ====================== */} {activeTab === 'other' && ( - +

{t('systemSetting.fixed2OthersContentFixed2')}

{t('systemSetting.statusCpuContentFixed2')}

diff --git a/src/components/SystemSetting/VideoManagement.tsx b/src/components/SystemSetting/VideoManagement.tsx index dba53da..7c1da34 100644 --- a/src/components/SystemSetting/VideoManagement.tsx +++ b/src/components/SystemSetting/VideoManagement.tsx @@ -185,7 +185,7 @@ const VideoManagement = () => {
- +
{t('systemSetting.s0')} @@ -225,7 +225,7 @@ const VideoManagement = () => { - + {loading ? (
) : !channel ? ( diff --git a/src/components/alerts/AlarmOverview.tsx b/src/components/alerts/AlarmOverview.tsx index 3823f54..91b1e99 100644 --- a/src/components/alerts/AlarmOverview.tsx +++ b/src/components/alerts/AlarmOverview.tsx @@ -618,8 +618,8 @@ export default function AlarmCenterPage() { ].map((item, idx) => (
@@ -658,7 +658,7 @@ export default function AlarmCenterPage() { - +
{t('alerts.alertLevel')}
@@ -747,7 +747,7 @@ export default function AlarmCenterPage() { {/* 表格 */} - +
- + - + - + { return (
- +
@@ -153,13 +153,13 @@ const AlarmStatistics = () => { - +
- +
diff --git a/src/components/devices/DeviceOverviewPage.tsx b/src/components/devices/DeviceOverviewPage.tsx index 2af36f1..de1c003 100644 --- a/src/components/devices/DeviceOverviewPage.tsx +++ b/src/components/devices/DeviceOverviewPage.tsx @@ -586,8 +586,8 @@ export default function DeviceOverviewPage() { {dynamicTopCards.map((card, idx) => (
{/* 左侧文字区域 */} @@ -627,7 +627,7 @@ export default function DeviceOverviewPage() { - {t('devices.fixed2Equipment')}} extra={
record.id || record.serialNumber || record.device_sn} size="small" pagination={false} columns={[ { title: t('devices.fixed2EquipmentFixed2NameFixed2'), dataIndex: 'name', width: 140 }, @@ -720,7 +720,7 @@ export default function DeviceOverviewPage() { /> - {t('devices.fixed2ControlFixed2LogDesc6Alert')}} bordered={false} style={{ borderRadius: 8 }} extra={
}> + {t('devices.fixed2ControlFixed2LogDesc6Alert')}} variant="borderless" style={{ borderRadius: 8 }} extra={
}>
{t} }, @@ -736,7 +736,7 @@ export default function DeviceOverviewPage() { - {t('devices.deviceControlPanel')}} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }} bodyStyle={{ padding: 12, paddingBottom: 0 }}> + {t('devices.deviceControlPanel')}} variant="borderless" style={{ borderRadius: 8, marginBottom: 8 }} styles={{ body: { padding: 12, paddingBottom: 0 } }}>
{t('devices.taskOrchestrationAI')}} - bordered={false} - bodyStyle={{ padding: '12px 16px' }} + variant="borderless" + styles={{ body: { padding: '12px 16px' } }} style={{ ...cardStyle, marginBottom: 8 }} >
{t('devices.waylineParamsTitle')}} extra={{t('devices.currentWayline')}{selectedTask?.name || '-'}} - bordered={false} - bodyStyle={{ padding: '16px' }} + variant="borderless" + styles={{ body: { padding: '16px' } }} style={{ ...cardStyle, marginBottom: 8 }} >
@@ -1141,8 +1141,8 @@ export default function WayLinePage({ onRefresh }) { {t('devices.weatherWindowTitle')}} - bordered={false} - bodyStyle={{ padding: '16px' }} + variant="borderless" + styles={{ body: { padding: '16px' } }} style={{ ...cardStyle, flex: 1, }} >
@@ -1248,8 +1248,8 @@ export default function WayLinePage({ onRefresh }) { />
} - bordered={false} - bodyStyle={{ padding: '12px', display: 'flex', flexDirection: 'column', height: 480 }} + variant="borderless" + styles={{ body: { padding: '12px', display: 'flex', flexDirection: 'column', height: 480 } }} style={{ ...cardStyle, height: '100%' }} > {t('devices.ganttViewTitle')} } extra={} - bordered={false} - bodyStyle={{ padding: 16 }} + variant="borderless" + styles={{ body: { padding: 16 } }} style={{ ...cardStyle, height: '100%' }} >
@@ -1393,8 +1393,8 @@ export default function WayLinePage({ onRefresh }) {
} - bordered={false} - bodyStyle={{ padding: 16 }} + variant="borderless" + styles={{ body: { padding: 16 } }} style={{ ...cardStyle, height: '100%', maxHeight: 480, overflow: "auto" }} > diff --git a/src/components/recharts.jsx b/src/components/recharts.jsx index d16b064..e76d002 100644 --- a/src/components/recharts.jsx +++ b/src/components/recharts.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React from 'react'; import { ResponsiveContainer, LineChart, @@ -55,8 +55,8 @@ export const UniversalLineChart = ({ padding: 12, }} > - - + + {showGrid && ( )} @@ -114,8 +114,8 @@ export const UniversalBarChart = ({ padding: 12, }} > - - + + {showGrid && ( )} @@ -171,8 +171,8 @@ export const UniversalPieChart = ({ ...style }} > - - + + {showTooltip && } {showLegend && } diff --git a/src/index.css b/src/index.css index 2c7d8fb..e941a8a 100644 --- a/src/index.css +++ b/src/index.css @@ -154,6 +154,11 @@ h4, .ant-typography h4 { font-size: clamp(1rem, 1.5vw, 1.25rem) !important; } background-color: #f0f7ff !important; } + .recharts-responsive-container>div{ + width: 100% !important; + height: 100% !important; + } + diff --git a/src/locales/zh/index.ts b/src/locales/zh/index.ts index cf63c37..2ca065b 100644 --- a/src/locales/zh/index.ts +++ b/src/locales/zh/index.ts @@ -345,7 +345,7 @@ const zh = { good: '良好', robotRouteMonitor: '机器人路径规划与监控', clearRealtimeTrack: '清空实时轨迹', - clearPlanRoute: '清空规划航线', + clearPlanRoute: '清空规划区域', controlMode: '控制模式:', localMode: '本地', remoteMode: '远程', diff --git a/src/pages/AIAnalysis.tsx b/src/pages/AIAnalysis.tsx index 1191276..24f8754 100644 --- a/src/pages/AIAnalysis.tsx +++ b/src/pages/AIAnalysis.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState } from 'react'; import { Row, Col, Card, Button, Tag, Table, Typography, Space, Statistic, message, Divider, Tooltip, Avatar, Empty } from 'antd'; @@ -210,8 +210,8 @@ export default function AIDiagnosisPage() { ].map((item, index) => (
@@ -245,8 +245,8 @@ export default function AIDiagnosisPage() { {t('aiAnalysis.fixed2UavInspection')}} extra={{t('aiAnalysis.fixed2Inspection202505200930')}} - bordered={false} - bodyStyle={{ padding: '16px 20px' }} + variant="borderless" + styles={{ body: { padding: '16px 20px' } }} style={{ ...cardStyle, height: '100%' }} > @@ -288,8 +288,8 @@ export default function AIDiagnosisPage() { {t('aiAnalysis.s9')}160 {t('aiAnalysis.fixed2Abnormal')}8 } - bordered={false} - bodyStyle={{ padding: '16px 20px' }} + variant="borderless" + styles={{ body: { padding: '16px 20px' } }} style={{ ...cardStyle, height: '100%' }} > @@ -383,8 +383,8 @@ export default function AIDiagnosisPage() {
{t('aiAnalysis.s13')}} - bordered={false} - bodyStyle={{ padding: '16px 20px' }} + variant="borderless" + styles={{ body: { padding: '16px 20px' } }} style={{ ...cardStyle, height: '100%' }} >
@@ -432,8 +432,8 @@ export default function AIDiagnosisPage() {
{t('aiAnalysis.generation')}} - bordered={false} - bodyStyle={{ padding: '16px 20px' }} + variant="borderless" + styles={{ body: { padding: '16px 20px' } }} style={{ ...cardStyle, height: '100%' }} >
@@ -487,8 +487,8 @@ export default function AIDiagnosisPage() {
{/* AI诊断总结 */} @@ -498,6 +498,7 @@ export default function AIDiagnosisPage() { {t('aiAnalysis.fixed2UpdatedAt202505200945')}
{t('aiAnalysis.fixed2Ai')}
{t('aiAnalysis.sourceFixed2')}} - bordered={false} - bodyStyle={{ padding: '16px 20px' }} + variant="borderless" + styles={{ body: { padding: '16px 20px' } }} style={cardStyle} > diff --git a/src/pages/CleanOptimization.tsx b/src/pages/CleanOptimization.tsx index 6af5893..4429e0b 100644 --- a/src/pages/CleanOptimization.tsx +++ b/src/pages/CleanOptimization.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState } from 'react'; import { Row, Col, Card, Button, Table, Tag, Typography, Space, Statistic, DatePicker, Divider, Progress, Badge, Select, Tooltip, Avatar @@ -226,8 +226,8 @@ export default function CleanOptimizationPage() { ].map((item, index) => (
@@ -298,7 +298,7 @@ export default function CleanOptimizationPage() { {/* 左侧:分析图表 */}
- {t('clean.s6')}} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}> + {t('clean.s6')}} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
{t('clean.s7')} @@ -329,7 +329,7 @@ export default function CleanOptimizationPage() { /> - {t('clean.fixed2Generation')}{t('clean.near7Days')}} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}> + {t('clean.fixed2Generation')}{t('clean.near7Days')}} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
- {t('clean.fixed2Cleaning2')}{t('clean.nearLast')}} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}> + {t('clean.fixed2Cleaning2')}{t('clean.nearLast')}} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}> - {t('clean.fixed2CleaningFixed2')}} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}> + {t('clean.fixed2CleaningFixed2')}} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
{t('clean.generation')}
@@ -398,9 +398,9 @@ export default function CleanOptimizationPage() { {t('clean.recommendedCleanBlock')}} - bordered={false} + variant="borderless" style={{ ...cardStyle, }} - bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden', minHeight: 500 }} + styles={{ body: { padding: 0, position: 'relative', overflow: 'hidden', minHeight: 500 } }} >
@@ -455,11 +455,12 @@ export default function CleanOptimizationPage() { {t('clean.fixed2Cleaning2')}} extra={} - bordered={false} + variant="borderless" style={cardStyle} - bodyStyle={{ padding: 0 }} + styles={{ body: { padding: 0 } }} >
- {t('clean.cleaning2')}} bordered={false} style={cardStyle} bodyStyle={{ padding: 0 }}> + {t('clean.cleaning2')}} variant="borderless" style={cardStyle} styles={{ body: { padding: 0 } }}>
{t('clean.algorithmModel')}
{p}, width: 65 }, @@ -498,7 +500,7 @@ export default function CleanOptimizationPage() { /> - {t('clean.fixed2Cleaning2')}} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}> + {t('clean.fixed2Cleaning2')}} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
@@ -529,7 +531,7 @@ export default function CleanOptimizationPage() { - {t('clean.fixed2WeatherAdvice2')}({t('clean.plan', { name: '01' })})} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}> + {t('clean.fixed2WeatherAdvice2')}({t('clean.plan', { name: '01' })})} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
@@ -561,7 +563,7 @@ export default function CleanOptimizationPage() { - {t('clean.fixed2Cleaning')}} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}> + {t('clean.fixed2Cleaning')}} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}> {[ { icon: , bg: '#E8F3FF', label: t('clean.s52'), value: t('clean.tonUnit', { value: '18' }), sub: t('clean.waterSaveWithRobot', { value: '30%' }), subColor: '#00B42A' }, diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 3cd0d03..2bb3404 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useRef } from 'react'; +import React, { useState, useEffect, useRef } from 'react'; import { Card, Row, Col, Statistic, Button, Space, Tag, Typography, Table, message } from 'antd'; import { CloudOutlined, ThunderboltOutlined, BarChartOutlined, @@ -254,7 +254,7 @@ export default function StationDashboard() { maxWidth: '240px', minWidth: '160px' }}> - +
{item.title}
@@ -282,7 +282,7 @@ export default function StationDashboard() { {/* 左侧图表 */}
- {t('home.generationTrend')}} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '8px' }}> + {t('home.generationTrend')}} extra={} variant="borderless" style={cardStyle} styles={{ body: { padding: '8px' } }}>
今日发电功率趋势 (kW)
- {t('home.irradianceTempTrend')}} bordered={false} style={cardStyle} bodyStyle={{ padding: '8px' }}> + {t('home.irradianceTempTrend')}} variant="borderless" style={cardStyle} styles={{ body: { padding: '8px' } }}> - {t('home.inverterEfficiency')}} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}> + {t('home.inverterEfficiency')}} variant="borderless" style={cardStyle} styles={{ body: { padding: '12px' } }}> - {t('home.maintenanceProgress')}} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}> + {t('home.maintenanceProgress')}} extra={} variant="borderless" style={cardStyle} styles={{ body: { padding: '12px' } }}>
} - bordered={false} + variant="borderless" style={cardStyle} - bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden', height: 500 }} + styles={{ body: { padding: 0, position: 'relative', overflow: 'hidden', height: 500 } }} >
{/*