import React, { useState } from 'react'; import { Layout, Card, Row, Col, Button, Table, Tag, Select, Input, Typography, Space, Statistic, Modal, message, Empty, Drawer, Descriptions, Timeline, Divider, Form, Tabs, Progress, Badge, DatePicker, Pagination } from 'antd'; import { CheckOutlined, ClockCircleOutlined, ControlOutlined, BarChartOutlined, RiseOutlined, ArrowUpOutlined, SearchOutlined, PlusOutlined, EditOutlined, DeleteOutlined, EyeOutlined, CommentOutlined, PauseOutlined, FormOutlined, ReloadOutlined, FilterOutlined, MoreOutlined, CheckCircleFilled, PlayCircleFilled, InfoCircleFilled, RobotOutlined, ThunderboltOutlined, AlertOutlined } from '@ant-design/icons'; import { Pie, Line } from '@ant-design/charts'; import { ClipboardList, Clock, Play, CheckCircle, Timer, Cpu, Calendar as CalendarIcon, ChevronRight, History, ExternalLink } from 'lucide-react'; const { Option } = Select; const { Search } = Input; const { Text, Title } = Typography; const { RangePicker } = DatePicker; // 模拟数据 const workOrderData = [ { id: 'WO20250524001', title: '逆变器 INV-05 告警排查', source: 'AI诊断', type: '检修', priority: 'high', status: 'pending', handler: '李工', deadline: '2025-05-24 14:30', }, { id: 'WO20250524002', title: '区块 B-12 热斑复检', source: '无人机巡检', type: '巡检', priority: 'high', status: 'processing', handler: '王工', deadline: '2025-05-24 15:00', }, { id: 'WO20250524003', title: '组件清洗任务 C-05', source: '清洗优化', type: '清洗', priority: 'medium', status: 'dispatched', handler: '赵工', deadline: '2025-05-24 16:00', }, { id: 'WO20250524004', title: '周界摄像头 CAM-08 离线修复', source: '视频监控', type: '维修', priority: 'medium', status: 'processing', handler: '陈工', deadline: '2025-05-24 17:30', }, { id: 'WO20250524005', title: '除草机器人补给', source: '装备控制', type: '运维', priority: 'low', status: 'pending', handler: '刘工', deadline: '2025-05-24 18:00', }, { id: 'WO20250524006', title: '逆变器室夜间巡检', source: '人工创建', type: '巡检', priority: 'medium', status: 'completed', handler: '张运维', deadline: '2025-05-24 21:00', } ]; // 工单状态配置 const statusConfig = { pending: { label: '待处理', color: '#52c41a', textColor: '#1890ff', bg: '#e6f7ff', border: '#91d5ff' }, dispatched: { label: '已派发', color: '#52c41a', textColor: '#52c41a', bg: '#f6ffed', border: '#b7eb8f' }, processing: { label: '执行中', color: '#1890ff', textColor: '#1890ff', bg: '#e6f7ff', border: '#91d5ff' }, completed: { label: '已完成', color: '#52c41a', textColor: '#52c41a', bg: '#f6ffed', border: '#b7eb8f' }, suspended: { label: '已挂起', color: '#faad14', textColor: '#faad14', bg: '#fff7e6', border: '#ffe7ba' } }; // 优先级配置 const priorityConfig = { low: { label: '低', color: '#52c41a', bg: '#f6ffed' }, medium: { label: '中', color: '#faad14', bg: '#fff7e6' }, high: { label: '高', color: '#ff4d4f', bg: '#fff1f0' } }; const WorkOrderPage = () => { const [activeTab, setActiveTab] = useState('1'); const [selectedRowKey, setSelectedRowKey] = useState('WO20250524002'); // 统计数据 const stats = [ { title: '今日新增工单', value: 18, subValue: '+3', subText: '较昨日', icon: , bg: '#e6f7ff' }, { title: '待处理工单', value: 12, subValue: '5', subText: '高优先级', icon: , bg: '#fff1f0' }, { title: '执行中工单', value: 9, subValue: '92%', subText: '按时率', icon: , bg: '#f6ffed' }, { title: '已完成工单', value: 126, subValue: '', subText: '本月累计', icon: , bg: '#f6ffed' }, { title: '平均处理时长', value: 4.3, unit: '小时', subValue: '-12%', subText: '较上周', icon: , bg: '#e6f7ff' }, { title: 'AI建议生成', value: 7, unit: '单', subValue: '', subText: '今日自动生成', icon: , bg: '#f9f0ff' }, ]; // 表格列 const columns = [ { title: '工单编号', dataIndex: 'id', key: 'id', width: 130 }, { title: '工单标题', dataIndex: 'title', key: 'title', width: 180, ellipsis: true }, { title: '来源', dataIndex: 'source', key: 'source', width: 100 }, { title: '类型', dataIndex: 'type', key: 'type', width: 80 }, { title: '优先级', dataIndex: 'priority', key: 'priority', width: 80, render: (p) => ( {priorityConfig[p].label} ) }, { title: '负责人', dataIndex: 'handler', key: 'handler', width: 80 }, { title: '截止时间', dataIndex: 'deadline', key: 'deadline', width: 150 }, { title: '状态', dataIndex: 'status', key: 'status', width: 90, render: (s) => ( {statusConfig[s].label} ) }, { title: '操作', key: 'action', width: 60, render: () => }, ]; // 图表数据 const pieData = [ { type: '待处理', value: 12 }, { type: '执行中', value: 9 }, { type: '已完成', value: 126 }, { type: '已挂起', value: 4 }, ]; const alarmTrendData = [ { date: '05-18', value: 5 }, { date: '05-19', value: 10 }, { date: '05-20', value: 7 }, { date: '05-21', value: 12 }, { date: '05-22', value: 8 }, { date: '05-23', value: 15 }, { date: '05-24', value: 11 }, ]; return (
{/* 顶部标题和页签 */}
工单任务
{/* 统计卡片 */} {stats.map((item, index) => (
{item.title}
{item.value} {item.unit && {item.unit}}
{item.subText} {item.subValue}
{item.icon}
))}
{/* 筛选栏 */}
工单类型
优先级
负责人
时间范围
状态
关键词 } />
{/* 左侧:列表 + 底部图表 */} 工单列表(共 147 条)
} bodyStyle={{ padding: 0 }} style={{ borderRadius: 8, marginBottom: 16 }} > setSelectedRowKey(keys[0] as string) }} />
{ const total = pieData.reduce((a, b) => a + b.value, 0); const percent = ((item.value / total) * 100).toFixed(2); return `${item.value} (${percent}%)`; } } }} height={240} />
总数
147
更多 } style={{ borderRadius: 8, height: 360 }} >
{['08:00', '10:00', '12:00', '14:00', '16:00', '18:00'].map(t => (
{t}
))}
{['李工', '王工', '赵工', '陈工'].map((name, idx) => (
{name}
{idx === 0 &&
INV-05 告警排查
08:30 - 12:00
} {idx === 1 &&
B-12 热斑复检
13:30 - 15:00
} {idx === 1 &&
无人机巡检
16:00-18:00
} {idx === 2 &&
组件清洗 C-05
09:00 - 12:00
} {idx === 2 &&
清洗效果复检
15:00 - 17:00
} {idx === 3 &&
周界摄像头修复
10:00 - 12:30
} {idx === 3 &&
设备巡检
15:30 - 17:30
}
))}
{/* 右侧:详情 + AI + 告警 */}
工单详情 工单编号: WO20250524002
区块 B-12 热斑复检 高优先级
来源:无人机巡检工单类型:巡检负责人:王工协同人员:无人机 A01 / 张运维计划时间:2025-05-24 13:30 - 15:00关联设备:UAV-A01关联区域:B-12当前状态:执行中任务描述:对 AI 识别热斑区域进行复检与红外复核,确认是否需要更换组件。
已创建
已派发
3
执行中
4
已完成
AI 建议与关联信息} style={{ borderRadius: 8, marginBottom: 16 }} bodyStyle={{ padding: '12px' }} >
建议携带
红外热像设备
优先复检组件
B-12-03 / B-12-05
预计影响发电
2.1%
查看全部 } style={{ borderRadius: 8 }}>
INV-05 逆变器告警 05-24 10:24
B-12 区块热斑告警 05-24 09:56
B-12 组件温度异常 05-24 09:32
); }; export default WorkOrderPage;