diff --git a/src/api/workOrder.ts b/src/api/workOrder.ts index e273085..bf32ed5 100644 --- a/src/api/workOrder.ts +++ b/src/api/workOrder.ts @@ -61,3 +61,22 @@ export function completeWorkOrder(data) { data }); } + +//挂起 + + +export function suspendWorkOrder(id) { + return request({ + url: `/iot/ioTworkOrder/suspend/${id}`, + method: 'post', + }); +} + +//删除工单 + +export function deleteWorkOrder(ids) { + return request({ + url: `/iot/ioTworkOrder/${ids}`, + method: 'post', + }); +} diff --git a/src/components/SystemSetting/BasicSettings.tsx b/src/components/SystemSetting/BasicSettings.tsx index 222b7a5..c5b44e1 100644 --- a/src/components/SystemSetting/BasicSettings.tsx +++ b/src/components/SystemSetting/BasicSettings.tsx @@ -167,7 +167,7 @@ const BasicSettings = () => { ]; return ( -
+
{/* 顶部统计卡片 */} diff --git a/src/components/SystemSetting/DeviceAccessPage.tsx b/src/components/SystemSetting/DeviceAccessPage.tsx index a6cee6e..5bc4dee 100644 --- a/src/components/SystemSetting/DeviceAccessPage.tsx +++ b/src/components/SystemSetting/DeviceAccessPage.tsx @@ -501,7 +501,7 @@ export default function DeviceAccessPage() { }]; return ( -
+
{contextHolder} diff --git a/src/components/SystemSetting/DeviceManagement.tsx b/src/components/SystemSetting/DeviceManagement.tsx index 316e390..327efa2 100644 --- a/src/components/SystemSetting/DeviceManagement.tsx +++ b/src/components/SystemSetting/DeviceManagement.tsx @@ -140,11 +140,11 @@ export default function DeviceManagementPage() { }; return ( -
+
diff --git a/src/components/SystemSetting/MenuList.tsx b/src/components/SystemSetting/MenuList.tsx index 98609c7..33c25a2 100644 --- a/src/components/SystemSetting/MenuList.tsx +++ b/src/components/SystemSetting/MenuList.tsx @@ -185,7 +185,7 @@ export default function MenuList() { }; return ( -
+
{contextHolder}
diff --git a/src/components/SystemSetting/OnlineUser.tsx b/src/components/SystemSetting/OnlineUser.tsx index 24d64b2..81f837c 100644 --- a/src/components/SystemSetting/OnlineUser.tsx +++ b/src/components/SystemSetting/OnlineUser.tsx @@ -86,12 +86,12 @@ const OnlineUserPage = () => { ]; return ( -
+
{/* ====================== 顶部 Tabs ====================== */} diff --git a/src/components/SystemSetting/Organization.tsx b/src/components/SystemSetting/Organization.tsx index 03c0de8..719756d 100644 --- a/src/components/SystemSetting/Organization.tsx +++ b/src/components/SystemSetting/Organization.tsx @@ -148,7 +148,7 @@ export default function Organization() { ]; return ( -
+
{contextHolder} diff --git a/src/components/SystemSetting/StationManage.tsx b/src/components/SystemSetting/StationManage.tsx index d034bde..0440506 100644 --- a/src/components/SystemSetting/StationManage.tsx +++ b/src/components/SystemSetting/StationManage.tsx @@ -252,7 +252,7 @@ export default function StationManage() { ]; return ( -
+
{contextHolder} diff --git a/src/components/SystemSetting/UserPage.tsx b/src/components/SystemSetting/UserPage.tsx index a9e30ed..c053057 100644 --- a/src/components/SystemSetting/UserPage.tsx +++ b/src/components/SystemSetting/UserPage.tsx @@ -389,7 +389,7 @@ export default function UserRolePage() { overflowY: 'auto', scrollbarWidth: 'none', msOverflowStyle: 'none', - padding: '20px', + padding: '8px 0px', background: '#f5f7fa' }}> {contextHolder} diff --git a/src/components/alerts/AlarmOverview.tsx b/src/components/alerts/AlarmOverview.tsx index 4314b94..024dad1 100644 --- a/src/components/alerts/AlarmOverview.tsx +++ b/src/components/alerts/AlarmOverview.tsx @@ -20,6 +20,7 @@ import { exportAlarm } from '../../api/alarmApi.js'; import { UniversalBarChart, UniversalLineChart, UniversalPieChart } from '../recharts.jsx'; +import { addWorkOrder } from '@/api/workOrder.js'; const { RangePicker } = DatePicker; const { Text } = Typography; @@ -70,6 +71,8 @@ export default function AlarmCenterPage() { const [total, setTotal] = useState(0); const [pageNum, setPageNum] = useState(1); const [pageSize] = useState(10); + const [messageApi, contextHolder] = message.useMessage(); + // 查询条件 const [queryParams, setQueryParams] = useState({ @@ -103,7 +106,7 @@ export default function AlarmCenterPage() { setTotal(res.total || 0); } } catch (err) { - message.error('加载失败'); + messageApi.error('加载失败'); } finally { setLoading(false); } @@ -134,7 +137,7 @@ export default function AlarmCenterPage() { setDrawerVisible(true); } } catch (err) { - message.error('加载详情失败'); + messageApi.error('加载详情失败'); } finally { setDetailLoading(false); } @@ -148,12 +151,12 @@ export default function AlarmCenterPage() { handleStatus: values.handleStatus, handleRemark: values.handleRemark || '已处理' }); - message.success('处理成功'); + messageApi.success('处理成功'); setDrawerVisible(false); fetchList(); fetchStat(); } catch (err) { - message.error('处理失败'); + messageApi.error('处理失败'); } }; @@ -273,9 +276,63 @@ export default function AlarmCenterPage() { color: '#1890FF', }, ].filter(i => i.value > 0); + // 生成工单 + const handleaddOrder = async () => { + if (!currentAlarm) { + messageApi.warning('无告警信息,无法生成工单'); + return; + } + try { + // 组装接口需要的所有参数(你给的格式) + const params = { + id: '', + orderNo: '', + orderTitle: currentAlarm.alarmTitle || '告警生成工单', + sourceType: 7, // 来源 7=告警 + orderType: 5, // 类型 5=运维 + priorityLevel: currentAlarm.alarmLevel === 1 ? 1 : 2, // 严重=高,其他=中 + deviceId: currentAlarm.deviceId || '', + deviceName: currentAlarm.deviceName || '', + deviceType: '', // 没有就传空 + siteId: '', + siteName: '', + orgId: '', + assigneeId: '', + assigneeName: '', + collaboratorIds: '', + collaboratorNames: '', + planStartTime: '', + planEndTime: '', + deadlineTime: '', + actualStartTime: '', + actualEndTime: '', + orderStatus: 1, // 1-待处理 + alarmId: currentAlarm.id || '', // 关联告警ID + alarmNo: currentAlarm.alarmNo || '', // 关联告警编号 + taskDescription: currentAlarm.alarmContent || '', // 任务描述=告警内容 + aiSuggestion: currentAlarm.rootCause || '', // AI建议 + requiredEquipment: '', + estimatedImpact: '', + handleResult: '', + handleRemark: '' + }; + + // 调用新增接口 + const res = await addWorkOrder(params); + if (res.code === 0 || res.code === 200) { + messageApi.success('工单生成成功'); + } else { + messageApi.error(res.msg || '工单生成失败'); + } + } catch (error) { + messageApi.error('接口调用失败'); + console.error(error); + } + }; return ( -
+
+ {contextHolder} {/* 查询栏 */} @@ -639,6 +696,13 @@ export default function AlarmCenterPage() { {/* 推荐处理措施 */}
{currentAlarm.handleSuggestion || '-'}
+
+
+ +
+ + +
{/* 处理操作 */} diff --git a/src/index.css b/src/index.css index 224c1a8..9550352 100644 --- a/src/index.css +++ b/src/index.css @@ -80,8 +80,10 @@ h4, .ant-typography h4 { font-size: clamp(1rem, 1.5vw, 1.25rem) !important; } .custom-scrollbar::-webkit-scrollbar-track { background: transparent; } .custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); } - -.ant-card-head-title { +.ant-typography{ + color: #0837A8 !important; +} +.ant-card-head-title{ color: #0837A8; font-weight: 700 !important; font-size: clamp(14px, 0.85vw, 16px) !important; @@ -91,7 +93,7 @@ h4, .ant-typography h4 { font-size: clamp(1rem, 1.5vw, 1.25rem) !important; } } .ant-card-head-title>span { - color: #0837A8; + color: #0837A8 !important; font-weight: 700 !important; font-size: clamp(14px, 0.85vw, 16px) !important; } diff --git a/src/pages/AIAnalysis.tsx b/src/pages/AIAnalysis.tsx index 27fea28..3059e67 100644 --- a/src/pages/AIAnalysis.tsx +++ b/src/pages/AIAnalysis.tsx @@ -171,7 +171,7 @@ export default function AIDiagnosisPage() { }; return ( -
+
- + AI 智能诊断与分析中心 diff --git a/src/pages/CleanOptimization.tsx b/src/pages/CleanOptimization.tsx index 6c477b2..4b839a9 100644 --- a/src/pages/CleanOptimization.tsx +++ b/src/pages/CleanOptimization.tsx @@ -126,7 +126,7 @@ export default function CleanOptimizationPage() { }; return ( -
+
+ - 清洗优化管理 + 清洗优化管理 diff --git a/src/pages/Devices.tsx b/src/pages/Devices.tsx index 734f682..518a219 100644 --- a/src/pages/Devices.tsx +++ b/src/pages/Devices.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { Layout, Typography, Menu } from 'antd'; +import { Layout, Typography, Menu, Tabs } from 'antd'; import { AimOutlined, AppstoreOutlined, SettingOutlined } from '@ant-design/icons'; import DeviceOverviewPage from '../components/devices/DeviceOverviewPage'; import DeviceStatusPage from '../components/devices/DeviceStatusPage'; @@ -96,21 +96,30 @@ export default function DeviceIndexPage() { }; return ( - +
装备控制 - 装备总览、状态监控与参数配置 + {/*装备总览、状态监控与参数配置*/}
-
+
+ setActiveTab(key)} items={tabs} - style={{ border: 0, height: 40, lineHeight: '40px' }} - /> + style={{ + border: '0', + height: 40, + lineHeight: '40px', + background: 'transparent', // 这里直接写,不需要 !important + backgroundColor: 'transparent' // 兼容更好 + }} />
@@ -118,7 +127,7 @@ export default function DeviceIndexPage() { maxHeight: 'calc(100vh - 40px)', overflowY: 'auto', background: '#f5f7fa', - padding: '8px', + padding: '8px 0px', scrollbarWidth: "thin" }}> {renderContent()} diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 3db1fd3..8dd1a9d 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -153,7 +153,7 @@ export default function StationDashboard() { }; return ( -
+
{[ { title: '今日发电量', value: '4,752', unit: 'kWh', sub: '日目标 5,000 kWh', color: '#00B42A', bg: '#E8FFEA', icon: }, diff --git a/src/pages/RealTimeMonitor.tsx b/src/pages/RealTimeMonitor.tsx index 3be7d44..3197d83 100644 --- a/src/pages/RealTimeMonitor.tsx +++ b/src/pages/RealTimeMonitor.tsx @@ -97,7 +97,7 @@ const RealTimeMonitorPage = () => { ]; return ( -
+
实时监控中心 全方位实时掌握电站设备运行状态与发电表现 diff --git a/src/pages/ReportCenter.tsx b/src/pages/ReportCenter.tsx index 8d3a5c8..a0a833c 100644 --- a/src/pages/ReportCenter.tsx +++ b/src/pages/ReportCenter.tsx @@ -116,7 +116,7 @@ export default function ReportCenterPage() { }; return ( -
+
+
+ 报表中心 + + {/* 页面头部标签 */} + + + + + + + +
- 报表中心 - {/* 页面头部标签 */} - - - - - - - + -
+
系统设置 告警规则配置、用户角色、通知管理与系统参数设置
-
+
+
{/* 顶部标题和页签 */} -
- 工单任务管理 +
+ 工单任务管理 {
- {currentDetail?.orderTitle || '暂无标题'} + {currentDetail?.orderTitle || '暂无标题'} {currentDetail?.priorityLevel && ( {
- 来源:{currentDetail?.sourceType || '--'} - 工单类型:{orderTypeConfig[currentDetail?.orderType] || '--'} - 负责人:{currentDetail?.assigneeName || '--'} - 协同人员:{currentDetail?.collaboratorNames || '无'} - 计划时间:{currentDetail?.planStartTime ? `${currentDetail.planStartTime} ~ ${currentDetail.planEndTime}` : '--'} - 关联设备:{currentDetail?.deviceName || '无'} - 关联区域:{currentDetail?.siteName || '无'} + 来源:{currentDetail?.sourceType || '--'} + 工单类型:{orderTypeConfig[currentDetail?.orderType] || '--'} + 负责人:{currentDetail?.assigneeName || '--'} + 协同人员:{currentDetail?.collaboratorNames || '无'} + 计划时间:{currentDetail?.planStartTime ? `${currentDetail.planStartTime} ~ ${currentDetail.planEndTime}` : '--'} + 关联设备:{currentDetail?.deviceName || '无'} + 关联区域:{currentDetail?.siteName || '无'} - 当前状态: + 当前状态: {orderStatusConfig[currentDetail?.orderStatus]?.label || '--'} - 任务描述: + 任务描述:
{currentDetail?.taskDescription || '暂无描述'}
@@ -750,31 +784,57 @@ const WorkOrderPage = () => { + {/* 修改工单弹窗 */} {/* 修改工单弹窗 */} setEditModalVisible(false)} footer={null} width={520}>
- + - - + + + - + + - - - - - + + + + - +