2026-05-14 08:45:14 +08:00
|
|
|
|
import React, { useState, useEffect } from 'react';
|
2026-05-08 11:00:11 +08:00
|
|
|
|
import {
|
|
|
|
|
|
Layout, Card, Row, Col, Button, Table, Tag, Select, Input, Typography, Space,
|
2026-05-15 15:56:00 +08:00
|
|
|
|
Statistic, Modal, message, Empty, Drawer, Descriptions, Timeline, Divider, Form, Tabs, Progress, Badge, DatePicker, Pagination, Popconfirm
|
2026-05-08 11:00:11 +08:00
|
|
|
|
} from 'antd';
|
|
|
|
|
|
import {
|
2026-05-11 12:40:31 +08:00
|
|
|
|
CheckOutlined, ClockCircleOutlined, ControlOutlined,
|
|
|
|
|
|
BarChartOutlined, RiseOutlined, ArrowUpOutlined,
|
|
|
|
|
|
SearchOutlined, PlusOutlined, EditOutlined, DeleteOutlined,
|
|
|
|
|
|
EyeOutlined, CommentOutlined, PauseOutlined, FormOutlined,
|
|
|
|
|
|
ReloadOutlined, FilterOutlined, MoreOutlined,
|
|
|
|
|
|
CheckCircleFilled, PlayCircleFilled, InfoCircleFilled,
|
2026-05-14 12:44:18 +08:00
|
|
|
|
RobotOutlined, ThunderboltOutlined, AlertOutlined,
|
|
|
|
|
|
CheckCircleOutlined
|
2026-05-08 11:00:11 +08:00
|
|
|
|
} from '@ant-design/icons';
|
2026-05-14 13:30:29 +08:00
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
|
|
2026-05-11 12:40:31 +08:00
|
|
|
|
import { Pie, Line } from '@ant-design/charts';
|
|
|
|
|
|
import {
|
|
|
|
|
|
ClipboardList,
|
|
|
|
|
|
Clock,
|
|
|
|
|
|
Play,
|
|
|
|
|
|
CheckCircle,
|
|
|
|
|
|
Timer,
|
|
|
|
|
|
Cpu,
|
|
|
|
|
|
Calendar as CalendarIcon,
|
|
|
|
|
|
ChevronRight,
|
|
|
|
|
|
History,
|
|
|
|
|
|
ExternalLink
|
|
|
|
|
|
} from 'lucide-react';
|
2026-05-15 15:56:00 +08:00
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
getWorkOrderApi,
|
|
|
|
|
|
getWorkOrderDetailApi,
|
|
|
|
|
|
updateWorkOrder,
|
2026-07-13 16:25:44 +08:00
|
|
|
|
startWorkOrder,
|
2026-05-15 15:56:00 +08:00
|
|
|
|
completeWorkOrder,
|
|
|
|
|
|
suspendWorkOrder,
|
|
|
|
|
|
deleteWorkOrder
|
|
|
|
|
|
} from '../api/workOrder';
|
2026-07-14 09:02:11 +08:00
|
|
|
|
import { getSiteDevice, getSiteUAVList } from '../api/device';
|
2026-05-14 15:15:50 +08:00
|
|
|
|
import { UniversalLineChart } from '../components/recharts';
|
2026-05-15 15:56:00 +08:00
|
|
|
|
import { orderTypeConfig, sourceTypeMap } from '../constants';
|
2026-05-08 11:00:11 +08:00
|
|
|
|
|
2026-05-15 16:23:55 +08:00
|
|
|
|
import { useSelector } from 'react-redux';
|
|
|
|
|
|
import { RootState } from '../store';
|
|
|
|
|
|
import { getUser } from '../api/user';
|
2026-07-14 17:32:31 +08:00
|
|
|
|
import utils, { errorLevelOptions, getWorkOrderTypeText, workOrderTypeOptions } from '../lib/utils';
|
2026-05-15 16:23:55 +08:00
|
|
|
|
|
2026-05-08 11:00:11 +08:00
|
|
|
|
const { Option } = Select;
|
|
|
|
|
|
const { Search } = Input;
|
|
|
|
|
|
const { Text, Title } = Typography;
|
2026-05-11 12:40:31 +08:00
|
|
|
|
const { RangePicker } = DatePicker;
|
2026-05-14 08:45:14 +08:00
|
|
|
|
const FormItem = Form.Item;
|
2026-05-08 11:00:11 +08:00
|
|
|
|
|
2026-05-14 08:45:14 +08:00
|
|
|
|
// 优先级数字映射 1高 2中 3低
|
|
|
|
|
|
const priorityConfig = {
|
2026-07-14 09:02:11 +08:00
|
|
|
|
ERROR: { label: '高', color: '#ff4d4f', bg: '#fff1f0', border: '#ff4d4f' },
|
|
|
|
|
|
WARNING: { label: '中', color: '#faad14', bg: '#fff7e6', border: '#faad14' },
|
|
|
|
|
|
INFO: { label: '低', color: '#52c41a', bg: '#f6ffed', border: '#52c41a' }
|
2026-05-08 11:00:11 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-14 08:45:14 +08:00
|
|
|
|
// 工单状态数字映射
|
|
|
|
|
|
const orderStatusConfig = {
|
|
|
|
|
|
1: { label: '待处理', textColor: '#1890ff' },
|
|
|
|
|
|
2: { label: '执行中', textColor: '#1890ff' },
|
2026-07-14 17:32:31 +08:00
|
|
|
|
4: { label: '挂起', textColor: '#faad14' },
|
|
|
|
|
|
3: { label: '已完成', textColor: '#52c41a' },
|
2026-05-14 08:45:14 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-11 12:40:31 +08:00
|
|
|
|
const WorkOrderPage = () => {
|
|
|
|
|
|
const [activeTab, setActiveTab] = useState('1');
|
2026-05-18 09:15:22 +08:00
|
|
|
|
const [selectedRowKeys, setSelectedRowKeys] = useState<string[]>([]); // 批量选中
|
2026-05-14 08:45:14 +08:00
|
|
|
|
const [selectedRowKey, setSelectedRowKey] = useState('');
|
|
|
|
|
|
// 接口相关状态
|
|
|
|
|
|
const [loading, setLoading] = useState(false);
|
|
|
|
|
|
const [workOrderList, setWorkOrderList] = useState([]);
|
|
|
|
|
|
const [workOrderTotal, setWorkOrderTotal] = useState(0);
|
|
|
|
|
|
const [currentDetail, setCurrentDetail] = useState(null);
|
2026-05-18 09:06:18 +08:00
|
|
|
|
const [userList, setUserList] = useState([]);
|
2026-07-13 16:25:44 +08:00
|
|
|
|
const [deviceList, setDeviceList] = useState([]);
|
2026-07-14 09:02:11 +08:00
|
|
|
|
const [orderStat, setOrderStat] = useState({
|
|
|
|
|
|
todayAdd: 0, // 今日新增工单
|
|
|
|
|
|
pending: 0, // 待处理总数
|
|
|
|
|
|
pendingHigh: 0, // 待处理高优先级
|
|
|
|
|
|
running: 0, // 执行中
|
|
|
|
|
|
finishedMonth: 0, // 本月已完成
|
|
|
|
|
|
finishRate: '0', // 按时完成率
|
|
|
|
|
|
avgHandleHour: 0, // 平均处理时长
|
|
|
|
|
|
aiCreate: 0, // AI自动生成工单
|
|
|
|
|
|
todayAddDiff: '', // 今日新增对比昨日
|
|
|
|
|
|
avgDiff: '' // 平均时长对比上周
|
|
|
|
|
|
});
|
2026-05-15 16:23:55 +08:00
|
|
|
|
|
|
|
|
|
|
// 从 redux 获取用户信息
|
|
|
|
|
|
const { userInfo } = useSelector((state: RootState) => state.user);
|
2026-07-14 09:02:11 +08:00
|
|
|
|
const { stationId } = useSelector((state: RootState) => state.station);
|
|
|
|
|
|
const [deviceAll, setDevicesAll] = useState([]);
|
|
|
|
|
|
|
2026-07-14 17:32:31 +08:00
|
|
|
|
// 查询表单状态
|
|
|
|
|
|
const [queryForm] = Form.useForm();
|
|
|
|
|
|
|
|
|
|
|
|
// 优先级选项
|
|
|
|
|
|
const priorityOptions = [
|
|
|
|
|
|
{ value: 1, label: '高' },
|
|
|
|
|
|
{ value: 2, label: '中' },
|
|
|
|
|
|
{ value: 3, label: '低' }
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
// 状态选项
|
|
|
|
|
|
const statusOptions = [
|
|
|
|
|
|
{ value: 1, label: '待处理' },
|
|
|
|
|
|
{ value: 2, label: '执行中' },
|
|
|
|
|
|
{ value: 3, label: '已完成' },
|
|
|
|
|
|
{ value: 4, label: '已挂起' }
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
// 分页状态
|
|
|
|
|
|
const [pagination, setPagination] = useState({
|
|
|
|
|
|
current: 1,
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2026-07-14 09:02:11 +08:00
|
|
|
|
|
2026-05-15 16:23:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
2026-05-14 08:45:14 +08:00
|
|
|
|
// 弹窗表单
|
|
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
|
const [editModalVisible, setEditModalVisible] = useState(false);
|
|
|
|
|
|
const [dispatchModalVisible, setDispatchModalVisible] = useState(false);
|
2026-05-14 13:30:29 +08:00
|
|
|
|
const [completeModalVisible, setCompleteModalVisible] = useState(false);
|
2026-05-18 09:06:18 +08:00
|
|
|
|
const [completeForm] = Form.useForm();
|
|
|
|
|
|
const messageApi = utils.message;
|
2026-05-15 15:39:28 +08:00
|
|
|
|
|
2026-07-20 15:53:43 +08:00
|
|
|
|
// 排班更多弹窗
|
|
|
|
|
|
const [scheduleModalVisible, setScheduleModalVisible] = useState(false);
|
|
|
|
|
|
// 排班日历选中日期,默认今天
|
|
|
|
|
|
const [scheduleDate, setScheduleDate] = useState(dayjs().format('YYYY-MM-DD'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 时间轴刻度
|
|
|
|
|
|
const timeTicks = ["08:00", "10:00", "12:00", "14:00", "16:00", "18:00"];
|
|
|
|
|
|
// 一天总分钟 08:00 ~ 18:00 = 600分钟
|
|
|
|
|
|
const dayTotalMin = (18 - 8) * 60;
|
|
|
|
|
|
|
|
|
|
|
|
const calcSchedulePosition = (planTime) => {
|
|
|
|
|
|
if (!planTime) return null;
|
|
|
|
|
|
const t = dayjs(planTime);
|
|
|
|
|
|
const hour = t.hour();
|
|
|
|
|
|
const minute = t.minute();
|
|
|
|
|
|
|
|
|
|
|
|
let currentMin;
|
|
|
|
|
|
// 早于8点统一按0分钟计算,贴最左侧
|
|
|
|
|
|
if (hour < 8) {
|
|
|
|
|
|
currentMin = 0;
|
|
|
|
|
|
} else if (hour >= 18) {
|
|
|
|
|
|
// 18点之后依旧不展示
|
|
|
|
|
|
return null;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
currentMin = (hour - 8) * 60 + minute;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const leftPercent = (currentMin / dayTotalMin) * 100;
|
|
|
|
|
|
const widthPercent = 15;
|
|
|
|
|
|
return { left: `${leftPercent}%`, width: `${widthPercent}%` };
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 过滤所有带计划时间的工单
|
|
|
|
|
|
// 过滤【当前选中日期】且带计划时间的工单
|
|
|
|
|
|
const getScheduleOrderList = () => {
|
|
|
|
|
|
return workOrderList.filter(item => {
|
|
|
|
|
|
if (!item.planStartTime) return false;
|
|
|
|
|
|
// 匹配选中日期
|
|
|
|
|
|
const planDate = dayjs(item.planStartTime).format('YYYY-MM-DD');
|
|
|
|
|
|
return planDate === scheduleDate;
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 切换前一天
|
|
|
|
|
|
const prevScheduleDay = () => {
|
|
|
|
|
|
setScheduleDate(dayjs(scheduleDate).subtract(1, 'day').format('YYYY-MM-DD'));
|
|
|
|
|
|
};
|
|
|
|
|
|
// 切换后一天
|
|
|
|
|
|
const nextScheduleDay = () => {
|
|
|
|
|
|
setScheduleDate(dayjs(scheduleDate).add(1, 'day').format('YYYY-MM-DD'));
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取工单配色(优先级)
|
|
|
|
|
|
const getOrderScheduleStyle = (level) => {
|
|
|
|
|
|
const map = {
|
|
|
|
|
|
ERROR: { bg: "#FFF1F0", border: "#FF4D4F", color: "#FF4D4F" },
|
|
|
|
|
|
WARNING: { bg: "#FFF7E8", border: "#FA8C16", color: "#FA8C16" },
|
|
|
|
|
|
INFO: { bg: "#E8FFEA", border: "#00B42A", color: "#00B42A" },
|
|
|
|
|
|
};
|
|
|
|
|
|
return map[level] || { bg: "#E8F3FF", border: "#165DFF", color: "#165DFF" };
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-14 09:02:11 +08:00
|
|
|
|
|
|
|
|
|
|
// 计算工单统计数据
|
|
|
|
|
|
const calcWorkOrderStat = (list) => {
|
|
|
|
|
|
const today = dayjs().format('YYYY-MM-DD');
|
|
|
|
|
|
const monthStart = dayjs().startOf('month').format('YYYY-MM-DD');
|
|
|
|
|
|
let todayAdd = 0;
|
|
|
|
|
|
let pending = 0;
|
|
|
|
|
|
let pendingHigh = 0;
|
|
|
|
|
|
let running = 0;
|
|
|
|
|
|
let finishedMonth = 0;
|
|
|
|
|
|
let aiCreate = 0;
|
|
|
|
|
|
let finishCount = 0;
|
|
|
|
|
|
let totalCostHour = 0;
|
|
|
|
|
|
let allFinishOrder = [];
|
|
|
|
|
|
|
|
|
|
|
|
list.forEach(item => {
|
|
|
|
|
|
const createDay = dayjs(item.createTime).format('YYYY-MM-DD');
|
|
|
|
|
|
// 今日新增
|
|
|
|
|
|
if (createDay === today) todayAdd++;
|
|
|
|
|
|
// 本月已完成
|
|
|
|
|
|
if (item.orderStatus === 4 && createDay >= monthStart) finishedMonth++;
|
|
|
|
|
|
// AI生成工单 sourceType=7 告警自动生成
|
|
|
|
|
|
if (item.sourceType === 7) aiCreate++;
|
|
|
|
|
|
|
|
|
|
|
|
// 状态分类
|
|
|
|
|
|
if (item.orderStatus === 1) {
|
|
|
|
|
|
pending++;
|
|
|
|
|
|
// 高优先级待处理
|
|
|
|
|
|
if (item.priorityLevel === 1) pendingHigh++;
|
2026-05-15 16:23:55 +08:00
|
|
|
|
}
|
2026-07-14 09:02:11 +08:00
|
|
|
|
if (item.orderStatus === 2 || item.orderStatus === 5) running++;
|
|
|
|
|
|
|
|
|
|
|
|
// 已完成工单计算处理时长
|
|
|
|
|
|
if (item.orderStatus === 4 && item.actualStartTime && item.actualEndTime) {
|
|
|
|
|
|
finishCount++;
|
|
|
|
|
|
const costMin = dayjs(item.actualEndTime).diff(dayjs(item.actualStartTime), 'minute');
|
|
|
|
|
|
totalCostHour += costMin / 60;
|
|
|
|
|
|
allFinishOrder.push(item);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// 平均处理时长
|
|
|
|
|
|
const avgHandleHour = finishCount > 0 ? Number((totalCostHour / finishCount).toFixed(1)) : 0;
|
|
|
|
|
|
// 按时率(简单模拟:实际可后端返回)
|
|
|
|
|
|
const finishRate = allFinishOrder.length ? '92' : '0';
|
|
|
|
|
|
|
|
|
|
|
|
setOrderStat({
|
|
|
|
|
|
todayAdd,
|
|
|
|
|
|
pending,
|
|
|
|
|
|
pendingHigh,
|
|
|
|
|
|
running,
|
|
|
|
|
|
finishedMonth,
|
|
|
|
|
|
finishRate,
|
|
|
|
|
|
avgHandleHour,
|
|
|
|
|
|
aiCreate,
|
|
|
|
|
|
todayAddDiff: '+3', // 如需真实昨日对比,单独请求昨日统计接口
|
|
|
|
|
|
avgDiff: '-12%'
|
|
|
|
|
|
});
|
2026-05-15 16:23:55 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-07-14 09:02:11 +08:00
|
|
|
|
const fetchAllData = async () => {
|
|
|
|
|
|
if (!stationId) return;
|
|
|
|
|
|
|
2026-07-13 16:25:44 +08:00
|
|
|
|
try {
|
2026-07-14 09:02:11 +08:00
|
|
|
|
// 1. 同时发请求
|
|
|
|
|
|
const [deviceRes, planeRes] = await Promise.all([
|
|
|
|
|
|
getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: userInfo.orgId }),
|
|
|
|
|
|
getSiteUAVList(stationId),
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
// 2. 处理普通设备
|
|
|
|
|
|
const devData = deviceRes?.code === 200 ? (deviceRes.rows || []) : [];
|
|
|
|
|
|
|
|
|
|
|
|
// 3. 处理无人机 + 自动补全地图需要的字段(关键改动)
|
|
|
|
|
|
let planeData = planeRes?.code === 200 ? (planeRes?.rows || []) : [];
|
|
|
|
|
|
|
|
|
|
|
|
planeData = planeData.map(item => ({
|
|
|
|
|
|
...item,
|
|
|
|
|
|
type: 'plane',
|
|
|
|
|
|
lastRunningStatus: {
|
|
|
|
|
|
longitude: item.longitude || 0,
|
|
|
|
|
|
latitude: item.latitude || 0,
|
|
|
|
|
|
},
|
|
|
|
|
|
deviceAlias: item.drone_callsign || item.device_sn
|
|
|
|
|
|
|| '无人机',
|
|
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 合并所有设备
|
|
|
|
|
|
const all = [...devData, ...planeData];
|
|
|
|
|
|
setDevicesAll(all);
|
|
|
|
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
console.error('数据请求失败', err);
|
2026-07-13 16:25:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-07-14 09:02:11 +08:00
|
|
|
|
|
2026-05-11 12:40:31 +08:00
|
|
|
|
const stats = [
|
2026-07-14 09:02:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
title: '今日新增工单',
|
|
|
|
|
|
value: orderStat.todayAdd,
|
|
|
|
|
|
subValue: orderStat.todayAddDiff,
|
|
|
|
|
|
subText: '较昨日',
|
|
|
|
|
|
icon: <ClipboardList size={24} color="#1890ff" />,
|
|
|
|
|
|
bg: '#e6f7ff'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '待处理工单',
|
|
|
|
|
|
value: orderStat.pending,
|
|
|
|
|
|
subValue: orderStat.pendingHigh,
|
|
|
|
|
|
subText: '高优先级',
|
|
|
|
|
|
icon: <Clock size={24} color="#ff4d4f" />,
|
|
|
|
|
|
bg: '#fff1f0'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '执行中工单',
|
|
|
|
|
|
value: orderStat.running,
|
|
|
|
|
|
subValue: `${orderStat.finishRate}%`,
|
|
|
|
|
|
subText: '按时率',
|
|
|
|
|
|
icon: <Play size={24} color="#52c41a" />,
|
|
|
|
|
|
bg: '#f6ffed'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '已完成工单',
|
|
|
|
|
|
value: orderStat.finishedMonth,
|
|
|
|
|
|
subValue: '',
|
|
|
|
|
|
subText: '本月累计',
|
|
|
|
|
|
icon: <CheckCircle size={24} color="#52c41a" />,
|
|
|
|
|
|
bg: '#f6ffed'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '平均处理时长',
|
|
|
|
|
|
value: orderStat.avgHandleHour,
|
|
|
|
|
|
unit: '小时',
|
|
|
|
|
|
subValue: orderStat.avgDiff,
|
|
|
|
|
|
subText: '较上周',
|
|
|
|
|
|
icon: <Timer size={24} color="#1890ff" />,
|
|
|
|
|
|
bg: '#e6f7ff'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: 'AI建议生成',
|
|
|
|
|
|
value: orderStat.aiCreate,
|
|
|
|
|
|
unit: '单',
|
|
|
|
|
|
subValue: '',
|
|
|
|
|
|
subText: '今日自动生成',
|
|
|
|
|
|
icon: <Cpu size={24} color="#722ed1" />,
|
|
|
|
|
|
bg: '#f9f0ff'
|
|
|
|
|
|
},
|
2026-05-11 12:40:31 +08:00
|
|
|
|
];
|
2026-05-08 11:00:11 +08:00
|
|
|
|
|
2026-05-18 09:35:44 +08:00
|
|
|
|
const getOrderStatusPieData = () => {
|
|
|
|
|
|
const statusMap = {
|
|
|
|
|
|
1: '待处理',
|
2026-07-14 17:32:31 +08:00
|
|
|
|
2: '执行中',
|
|
|
|
|
|
3: '已完成',
|
|
|
|
|
|
4: '已挂起',
|
2026-05-18 09:35:44 +08:00
|
|
|
|
};
|
|
|
|
|
|
const countMap: Record<string, number> = {};
|
|
|
|
|
|
|
|
|
|
|
|
workOrderList.forEach((item: any) => {
|
|
|
|
|
|
const label = statusMap[item.orderStatus] || '其他';
|
|
|
|
|
|
countMap[label] = (countMap[label] || 0) + 1;
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return Object.entries(countMap).map(([type, value]) => ({ type, value }));
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const pieData = getOrderStatusPieData();
|
2026-05-11 12:40:31 +08:00
|
|
|
|
|
|
|
|
|
|
const alarmTrendData = [
|
2026-07-20 15:27:27 +08:00
|
|
|
|
{ date: '05-181', value: 5 },
|
2026-05-11 12:40:31 +08:00
|
|
|
|
{ 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 },
|
2026-05-08 11:00:11 +08:00
|
|
|
|
];
|
|
|
|
|
|
|
2026-07-14 17:32:31 +08:00
|
|
|
|
const getWorkOrderList = async (params = {}) => {
|
2026-05-14 08:45:14 +08:00
|
|
|
|
setLoading(true);
|
|
|
|
|
|
try {
|
2026-07-14 17:32:31 +08:00
|
|
|
|
const queryParams = {
|
|
|
|
|
|
...params,
|
|
|
|
|
|
pageNum: pagination.current,
|
|
|
|
|
|
pageSize: pagination.pageSize
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const res = await getWorkOrderApi(queryParams);
|
2026-05-14 08:45:14 +08:00
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
|
setWorkOrderList(res.rows || []);
|
|
|
|
|
|
setWorkOrderTotal(res.total || 0);
|
2026-07-14 09:02:11 +08:00
|
|
|
|
// 计算统计卡片数据
|
|
|
|
|
|
calcWorkOrderStat(res.rows || []);
|
2026-05-18 09:06:18 +08:00
|
|
|
|
if (res.rows?.length > 0) {
|
2026-05-14 08:45:14 +08:00
|
|
|
|
setSelectedRowKey(res.rows[0].id);
|
|
|
|
|
|
getWorkOrderDetail(res.rows[0].id);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (error) {
|
2026-05-15 15:39:28 +08:00
|
|
|
|
messageApi.error('获取工单列表失败');
|
2026-05-14 08:45:14 +08:00
|
|
|
|
} finally {
|
|
|
|
|
|
setLoading(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2026-07-14 17:32:31 +08:00
|
|
|
|
|
|
|
|
|
|
// 分页变化处理
|
|
|
|
|
|
const handlePageChange = (page, pageSize) => {
|
|
|
|
|
|
setPagination({ current: page, pageSize: pageSize || pagination.pageSize });
|
|
|
|
|
|
// 使用当前查询条件重新请求
|
|
|
|
|
|
const values = queryForm.getFieldsValue();
|
|
|
|
|
|
const params: any = {};
|
|
|
|
|
|
|
|
|
|
|
|
if (values.orderType) {
|
|
|
|
|
|
params.orderType = values.orderType;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (values.priorityLevel) {
|
|
|
|
|
|
params.priorityLevel = values.priorityLevel;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (values.timeRange && values.timeRange.length === 2) {
|
|
|
|
|
|
// 开始时间正常取
|
|
|
|
|
|
params.startTime = values.timeRange[0].format('YYYY-MM-DD 00:00:00');
|
|
|
|
|
|
// 结束时间强制补 23:59:59
|
|
|
|
|
|
params.endTime = values.timeRange[1].format('YYYY-MM-DD 23:59:59');
|
|
|
|
|
|
}
|
|
|
|
|
|
if (values.orderStatus && values.orderStatus !== 'all') {
|
|
|
|
|
|
params.orderStatus = values.orderStatus;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (values.keyword) {
|
|
|
|
|
|
params.keyword = values.keyword;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getWorkOrderList(params);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 处理查询
|
|
|
|
|
|
const handleQuery = async () => {
|
|
|
|
|
|
// 查询时重置到第一页
|
|
|
|
|
|
setPagination({ ...pagination, current: 1 });
|
|
|
|
|
|
|
|
|
|
|
|
const values = queryForm.getFieldsValue();
|
|
|
|
|
|
console.log('查询表单值:', values);
|
|
|
|
|
|
const params: any = {};
|
|
|
|
|
|
|
|
|
|
|
|
if (values.orderType) {
|
|
|
|
|
|
params.orderType = values.orderType;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (values.priorityLevel) {
|
|
|
|
|
|
params.priorityLevel = values.priorityLevel;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (values.timeRange && values.timeRange.length === 2) {
|
|
|
|
|
|
// 开始时间正常取
|
|
|
|
|
|
params.startTime = values.timeRange[0].format('YYYY-MM-DD 00:00:00');
|
|
|
|
|
|
// 结束时间强制补 23:59:59
|
|
|
|
|
|
params.endTime = values.timeRange[1].format('YYYY-MM-DD 23:59:59');
|
|
|
|
|
|
}
|
|
|
|
|
|
if (values.orderStatus && values.orderStatus !== 'all') {
|
|
|
|
|
|
params.orderStatus = values.orderStatus;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (values.keyword) {
|
|
|
|
|
|
params.keyword = values.keyword;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
await getWorkOrderList(params);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 处理重置
|
|
|
|
|
|
const handleReset = () => {
|
|
|
|
|
|
queryForm.resetFields();
|
|
|
|
|
|
// 重置时也重置到第一页
|
|
|
|
|
|
setPagination({ ...pagination, current: 1 });
|
|
|
|
|
|
getWorkOrderList();
|
|
|
|
|
|
};
|
2026-05-14 13:30:29 +08:00
|
|
|
|
// 打开完成工单弹窗
|
|
|
|
|
|
const openCompleteModal = () => {
|
2026-05-15 15:39:28 +08:00
|
|
|
|
if (!selectedRowKey) return messageApi.warning('请先选择工单');
|
2026-05-14 13:30:29 +08:00
|
|
|
|
completeForm.setFieldsValue({
|
|
|
|
|
|
id: currentDetail?.id,
|
|
|
|
|
|
orderNo: currentDetail?.orderNo,
|
|
|
|
|
|
handleResult: '已处理完成',
|
|
|
|
|
|
handleRemark: '',
|
|
|
|
|
|
});
|
|
|
|
|
|
setCompleteModalVisible(true);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-18 09:06:18 +08:00
|
|
|
|
// 提交完成工单(参数完全对齐你的JSON)
|
2026-05-14 13:30:29 +08:00
|
|
|
|
const submitComplete = async (values) => {
|
|
|
|
|
|
try {
|
2026-05-18 09:06:18 +08:00
|
|
|
|
const now = dayjs().format('YYYY-MM-DDTHH:mm:ss');
|
2026-07-20 13:56:10 +08:00
|
|
|
|
// 1. 组装后端需要的 IOTWorkOrder JSON 对象
|
|
|
|
|
|
const workOrderObj = {
|
2026-05-18 09:06:18 +08:00
|
|
|
|
...currentDetail,
|
2026-05-14 13:30:29 +08:00
|
|
|
|
id: values.id,
|
2026-05-18 09:06:18 +08:00
|
|
|
|
orderNo: currentDetail?.orderNo,
|
2026-07-14 17:32:31 +08:00
|
|
|
|
orderStatus: 3, // 已完成
|
2026-05-18 09:06:18 +08:00
|
|
|
|
actualStartTime: currentDetail?.actualStartTime || now,
|
|
|
|
|
|
actualEndTime: now,
|
2026-05-14 13:30:29 +08:00
|
|
|
|
handleResult: values.handleResult,
|
|
|
|
|
|
handleRemark: values.handleRemark,
|
|
|
|
|
|
};
|
2026-07-20 13:56:10 +08:00
|
|
|
|
|
|
|
|
|
|
// 2. 新建 FormData,适配 @RequestPart 混合参数
|
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
|
// workOrder 字段:转JSON字符串
|
|
|
|
|
|
formData.append(
|
|
|
|
|
|
"workOrder",
|
|
|
|
|
|
new Blob([JSON.stringify(workOrderObj)], {
|
|
|
|
|
|
type: "application/json"
|
|
|
|
|
|
})
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
//formData.append('workOrder', JSON.stringify(workOrderObj));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 4. 请求方法 completeWorkOrder 必须修改:传 formData,删除 headers 的 Content-Type
|
|
|
|
|
|
await completeWorkOrder(formData);
|
|
|
|
|
|
|
2026-05-15 15:39:28 +08:00
|
|
|
|
messageApi.success('工单已完成');
|
2026-05-14 13:30:29 +08:00
|
|
|
|
setCompleteModalVisible(false);
|
|
|
|
|
|
getWorkOrderList();
|
|
|
|
|
|
getWorkOrderDetail(selectedRowKey);
|
|
|
|
|
|
} catch (err) {
|
2026-05-15 15:39:28 +08:00
|
|
|
|
messageApi.error('工单完成失败');
|
2026-05-14 13:30:29 +08:00
|
|
|
|
console.error(err);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-07-20 13:56:10 +08:00
|
|
|
|
|
2026-05-14 08:45:14 +08:00
|
|
|
|
// 获取工单详情
|
|
|
|
|
|
const getWorkOrderDetail = async (id) => {
|
|
|
|
|
|
try {
|
|
|
|
|
|
const res = await getWorkOrderDetailApi(id);
|
2026-05-14 13:30:29 +08:00
|
|
|
|
if (res.code == 200) {
|
2026-05-14 08:45:14 +08:00
|
|
|
|
setCurrentDetail(res.data);
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (error) {
|
2026-05-15 15:39:28 +08:00
|
|
|
|
messageApi.error('获取工单详情失败');
|
2026-05-14 08:45:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-18 09:15:22 +08:00
|
|
|
|
// 选中表格行(单选查看详情)
|
|
|
|
|
|
const handleRowSelect = (record) => {
|
|
|
|
|
|
setSelectedRowKey(record.id);
|
|
|
|
|
|
getWorkOrderDetail(record.id);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 表格多选变化
|
|
|
|
|
|
const onSelectChange = (keys: string[]) => {
|
|
|
|
|
|
setSelectedRowKeys(keys);
|
2026-05-14 08:45:14 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 打开修改工单弹窗
|
|
|
|
|
|
const openEditModal = () => {
|
2026-05-15 15:39:28 +08:00
|
|
|
|
if (!selectedRowKey) return messageApi.warning('请先选择一条工单');
|
2026-05-14 08:45:14 +08:00
|
|
|
|
form.setFieldsValue({
|
2026-05-15 15:39:28 +08:00
|
|
|
|
orderTitle: currentDetail?.orderTitle,
|
|
|
|
|
|
orderType: currentDetail?.orderType,
|
|
|
|
|
|
priorityLevel: currentDetail?.priorityLevel,
|
|
|
|
|
|
taskDescription: currentDetail?.taskDescription,
|
2026-05-14 08:45:14 +08:00
|
|
|
|
});
|
|
|
|
|
|
setEditModalVisible(true);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-07-13 16:25:44 +08:00
|
|
|
|
// 打开执行工单弹窗
|
|
|
|
|
|
const openExecuteModal = () => {
|
|
|
|
|
|
if (selectedRowKeys.length > 0) {
|
|
|
|
|
|
// 批量执行
|
|
|
|
|
|
form.setFieldsValue({
|
|
|
|
|
|
orderIds: selectedRowKeys
|
|
|
|
|
|
});
|
|
|
|
|
|
} else if (selectedRowKey) {
|
|
|
|
|
|
// 单个执行
|
|
|
|
|
|
form.setFieldsValue({
|
|
|
|
|
|
orderIds: [selectedRowKey]
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return messageApi.warning('请先选择一条工单');
|
|
|
|
|
|
}
|
2026-05-15 16:23:55 +08:00
|
|
|
|
|
2026-05-14 08:45:14 +08:00
|
|
|
|
setDispatchModalVisible(true);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 提交修改工单
|
|
|
|
|
|
const submitEdit = async (values) => {
|
|
|
|
|
|
try {
|
2026-05-15 15:39:28 +08:00
|
|
|
|
const params = {
|
2026-05-18 09:06:18 +08:00
|
|
|
|
...currentDetail,
|
2026-05-15 15:56:00 +08:00
|
|
|
|
id: selectedRowKey,
|
|
|
|
|
|
orderTitle: values.orderTitle,
|
|
|
|
|
|
orderType: values.orderType,
|
|
|
|
|
|
priorityLevel: values.priorityLevel,
|
|
|
|
|
|
taskDescription: values.taskDescription,
|
2026-05-15 15:39:28 +08:00
|
|
|
|
};
|
|
|
|
|
|
await updateWorkOrder(params);
|
|
|
|
|
|
messageApi.success('修改工单成功');
|
2026-05-14 08:45:14 +08:00
|
|
|
|
setEditModalVisible(false);
|
|
|
|
|
|
getWorkOrderList();
|
2026-05-15 15:39:28 +08:00
|
|
|
|
getWorkOrderDetail(selectedRowKey);
|
2026-05-14 08:45:14 +08:00
|
|
|
|
} catch (error) {
|
2026-05-15 15:39:28 +08:00
|
|
|
|
messageApi.error('修改工单失败');
|
|
|
|
|
|
console.error(error);
|
2026-05-14 08:45:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-07-13 16:25:44 +08:00
|
|
|
|
// 提交执行工单
|
|
|
|
|
|
const submitExecute = async (values) => {
|
2026-05-14 08:45:14 +08:00
|
|
|
|
try {
|
2026-07-14 13:37:39 +08:00
|
|
|
|
const startTimeStr = dayjs(values.startTime).format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
|
|
|
2026-07-13 16:25:44 +08:00
|
|
|
|
// 调用 startWorkOrder 接口,传递 ids 和 选择的设备 id
|
2026-05-14 13:30:29 +08:00
|
|
|
|
const params = {
|
2026-07-13 16:25:44 +08:00
|
|
|
|
ids: values.orderIds,
|
2026-07-14 09:02:11 +08:00
|
|
|
|
deviceId: values.deviceId,
|
2026-07-14 13:37:39 +08:00
|
|
|
|
startTime: startTimeStr
|
2026-05-14 13:30:29 +08:00
|
|
|
|
};
|
2026-07-14 09:02:11 +08:00
|
|
|
|
const res = await startWorkOrder(params);
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
messageApi.success('工单执行成功');
|
|
|
|
|
|
setDispatchModalVisible(false);
|
|
|
|
|
|
setSelectedRowKeys([]); // 清空选中
|
|
|
|
|
|
getWorkOrderList();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
messageApi.error(res.msg || '工单执行失败');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-14 08:45:14 +08:00
|
|
|
|
} catch (error) {
|
2026-07-13 16:25:44 +08:00
|
|
|
|
messageApi.error('工单执行失败');
|
2026-05-14 13:30:29 +08:00
|
|
|
|
console.error(error);
|
2026-05-14 08:45:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-15 15:56:00 +08:00
|
|
|
|
// 挂起工单
|
|
|
|
|
|
const handleSuspend = async () => {
|
|
|
|
|
|
if (!selectedRowKey) return messageApi.warning('请选择工单');
|
|
|
|
|
|
try {
|
|
|
|
|
|
await suspendWorkOrder(selectedRowKey);
|
|
|
|
|
|
messageApi.success('工单已挂起');
|
|
|
|
|
|
getWorkOrderList();
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
messageApi.error('挂起失败');
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-18 09:15:22 +08:00
|
|
|
|
// 删除单行
|
2026-05-18 09:06:18 +08:00
|
|
|
|
const handleDelete = async (record) => {
|
|
|
|
|
|
if (!record?.id) return messageApi.warning('无效工单');
|
2026-05-15 15:56:00 +08:00
|
|
|
|
try {
|
2026-05-18 09:06:18 +08:00
|
|
|
|
await deleteWorkOrder(record.id);
|
2026-05-15 15:56:00 +08:00
|
|
|
|
messageApi.success('删除成功');
|
|
|
|
|
|
getWorkOrderList();
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
messageApi.error('删除失败');
|
2026-05-18 09:06:18 +08:00
|
|
|
|
console.error(e);
|
2026-05-15 15:56:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-18 09:15:22 +08:00
|
|
|
|
// 批量删除
|
|
|
|
|
|
// 批量删除 - 传给后端 id数组
|
|
|
|
|
|
const handleBatchDelete = async () => {
|
|
|
|
|
|
if (selectedRowKeys.length === 0) return messageApi.warning('请选择要删除的工单');
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
await deleteWorkOrder(selectedRowKeys);
|
|
|
|
|
|
messageApi.success(`成功删除 ${selectedRowKeys.length} 条工单`);
|
|
|
|
|
|
setSelectedRowKeys([]); // 清空选中
|
|
|
|
|
|
getWorkOrderList(); // 刷新列表
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
messageApi.error('批量删除失败');
|
|
|
|
|
|
console.error(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-14 08:45:14 +08:00
|
|
|
|
useEffect(() => {
|
2026-07-14 09:02:11 +08:00
|
|
|
|
fetchAllData();
|
|
|
|
|
|
|
2026-05-14 08:45:14 +08:00
|
|
|
|
getWorkOrderList();
|
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
2026-05-14 12:44:18 +08:00
|
|
|
|
const cardStyle = {
|
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
|
border: '1px solid #f0f0f0',
|
|
|
|
|
|
boxShadow: '0 4px 12px rgba(0,0,0,0.05)',
|
|
|
|
|
|
overflow: 'hidden'
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-18 09:06:18 +08:00
|
|
|
|
// 表格列
|
2026-05-14 12:44:18 +08:00
|
|
|
|
const columns = [
|
2026-05-15 15:56:00 +08:00
|
|
|
|
{ title: '工单编号', dataIndex: 'orderNo', key: 'orderNo', width: 150 },
|
|
|
|
|
|
{ title: '工单标题', dataIndex: 'orderTitle', key: 'orderTitle', width: 200, ellipsis: true },
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '来源',
|
|
|
|
|
|
dataIndex: 'sourceType',
|
|
|
|
|
|
key: 'sourceType',
|
|
|
|
|
|
width: 90,
|
2026-05-18 09:06:18 +08:00
|
|
|
|
render: (t) => sourceTypeMap[t] || t
|
2026-05-15 15:56:00 +08:00
|
|
|
|
},
|
2026-05-14 12:44:18 +08:00
|
|
|
|
{
|
|
|
|
|
|
title: '类型',
|
|
|
|
|
|
dataIndex: 'orderType',
|
|
|
|
|
|
key: 'orderType',
|
|
|
|
|
|
width: 80,
|
2026-07-14 09:02:11 +08:00
|
|
|
|
render: (val) => getWorkOrderTypeText(val)
|
2026-05-14 12:44:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '优先级',
|
|
|
|
|
|
dataIndex: 'priorityLevel',
|
|
|
|
|
|
key: 'priorityLevel',
|
|
|
|
|
|
width: 80,
|
|
|
|
|
|
render: (p) => (
|
2026-05-15 15:56:00 +08:00
|
|
|
|
<Tag style={{ color: priorityConfig[p]?.color, background: priorityConfig[p]?.bg, border: `1px solid ${priorityConfig[p]?.color}`, borderRadius: 4 }}>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
{p}
|
2026-05-14 12:44:18 +08:00
|
|
|
|
</Tag>
|
|
|
|
|
|
)
|
|
|
|
|
|
},
|
2026-05-15 15:56:00 +08:00
|
|
|
|
{ title: '设备名称', dataIndex: 'deviceName', key: 'deviceName', width: 160, ellipsis: true },
|
|
|
|
|
|
{ title: '站点', dataIndex: 'siteName', key: 'siteName', width: 130 },
|
|
|
|
|
|
{ title: '创建时间', dataIndex: 'createTime', key: 'createTime', width: 160 },
|
2026-05-14 12:44:18 +08:00
|
|
|
|
{
|
|
|
|
|
|
title: '状态',
|
|
|
|
|
|
dataIndex: 'orderStatus',
|
|
|
|
|
|
key: 'orderStatus',
|
2026-05-15 15:56:00 +08:00
|
|
|
|
width: 100,
|
2026-05-14 12:44:18 +08:00
|
|
|
|
render: (s) => (
|
|
|
|
|
|
<Space size={6}>
|
|
|
|
|
|
<div style={{ width: 6, height: 6, borderRadius: '50%', background: orderStatusConfig[s]?.textColor }}></div>
|
|
|
|
|
|
<span style={{ color: orderStatusConfig[s]?.textColor, fontWeight: 500 }}>{orderStatusConfig[s]?.label}</span>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
)
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '操作',
|
|
|
|
|
|
key: 'action',
|
2026-05-15 15:56:00 +08:00
|
|
|
|
width: 180,
|
2026-05-14 12:44:18 +08:00
|
|
|
|
fixed: "right",
|
2026-05-14 13:30:29 +08:00
|
|
|
|
render: (_, record) => (
|
2026-05-15 15:56:00 +08:00
|
|
|
|
<Space size={4}>
|
2026-05-18 14:28:42 +08:00
|
|
|
|
<Button type="link" size="small" icon={<EyeOutlined />} onClick={() => handleRowSelect(record)}>查看</Button>
|
|
|
|
|
|
<Button type="link" size="small" icon={<EditOutlined />} onClick={() => { handleRowSelect(record); openEditModal(); }}>修改</Button>
|
2026-05-18 09:15:22 +08:00
|
|
|
|
<Popconfirm title="确定删除?" onConfirm={() => handleDelete(record)}>
|
2026-05-18 14:28:42 +08:00
|
|
|
|
<Button type="link" size="small" danger icon={<DeleteOutlined />}>
|
|
|
|
|
|
删除
|
|
|
|
|
|
</Button>
|
2026-05-18 09:15:22 +08:00
|
|
|
|
</Popconfirm>
|
2026-05-15 15:56:00 +08:00
|
|
|
|
</Space>
|
2026-05-14 13:30:29 +08:00
|
|
|
|
)
|
2026-05-14 12:44:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
];
|
|
|
|
|
|
|
2026-05-18 09:15:22 +08:00
|
|
|
|
const rowSelection = {
|
|
|
|
|
|
selectedRowKeys,
|
|
|
|
|
|
onChange: onSelectChange,
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-08 11:00:11 +08:00
|
|
|
|
return (
|
2026-07-14 17:32:31 +08:00
|
|
|
|
<>
|
2026-05-15 15:56:00 +08:00
|
|
|
|
<style>{`
|
2026-07-14 17:32:31 +08:00
|
|
|
|
.ant-form-item {
|
|
|
|
|
|
margin-bottom: 0 !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
`}</style>
|
|
|
|
|
|
|
|
|
|
|
|
<div div style={{ padding: '0px 0px', background: '#f5f7fa', minHeight: '100vh', boxSizing: 'border-box' }
|
|
|
|
|
|
}>
|
|
|
|
|
|
<style>{`
|
2026-05-15 15:56:00 +08:00
|
|
|
|
.compact-table .ant-table-thead > tr > th { background: #f8fafc; padding: 2px 4px !important; font-size: 12px; color: #4E5969; }
|
|
|
|
|
|
.compact-table .ant-table-tbody > tr > td { padding: 2px 4px !important; font-size: 12px; }
|
|
|
|
|
|
.filter-label { font-size: 12px; color: #4E5969; white-space: nowrap; margin-right: 8px; }
|
|
|
|
|
|
.schedule-item { transition: all 0.3s; cursor: pointer; }
|
|
|
|
|
|
.schedule-item:hover { filter: brightness(0.95); transform: translateY(-1px); }
|
|
|
|
|
|
`}</style>
|
2026-05-14 12:44:18 +08:00
|
|
|
|
|
2026-07-14 17:32:31 +08:00
|
|
|
|
{/* 顶部标题和页签 */}
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 8 }}>
|
|
|
|
|
|
<Title level={4} style={{ margin: '0 32px 0 0' }}>工单任务管理</Title>
|
|
|
|
|
|
<Tabs activeKey={activeTab} onChange={setActiveTab} items={[
|
|
|
|
|
|
{ key: '1', label: '工单总览' }, { key: '2', label: '待处理工单' }, { key: '3', label: '执行中' },
|
|
|
|
|
|
{ key: '4', label: '已完成' }, { key: '5', label: '工单模板' },
|
|
|
|
|
|
]} tabBarStyle={{ marginBottom: 0 }} />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* 统计卡片 */}
|
|
|
|
|
|
<Row gutter={[8, 8]} style={{ marginBottom: 8 }}>
|
|
|
|
|
|
{stats.map((item, index) => (
|
|
|
|
|
|
<Col key={index} xs={24} sm={12} md={8} xl={4}>
|
|
|
|
|
|
<Card bordered={false} bodyStyle={{ padding: '20px 16px' }} style={cardStyle}>
|
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div style={{ fontSize: 'clamp(12px, 0.8vw, 13px)', color: '#86909C', marginBottom: 2 }}>{item.title}</div>
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'baseline', gap: 6, marginBottom: 2 }}>
|
|
|
|
|
|
<div style={{ fontSize: 'clamp(20px, 1.4vw, 24px)', fontWeight: 800, color: '#1D2129' }}>{item.value}</div>
|
|
|
|
|
|
{item.unit && <span style={{ fontSize: 13, color: '#1D2129', fontWeight: 600 }}>{item.unit}</span>}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{/*<div style={{ fontSize: 11, color: '#86909C' }}>
|
2026-05-14 12:44:18 +08:00
|
|
|
|
{item.subText}
|
2026-07-14 09:02:11 +08:00
|
|
|
|
<span style={{ marginLeft: 4, fontWeight: 700, color: item?.subValue.includes('+') ? '#00B42A' : (item.subValue.includes('-') ? '#F53F3F' : '#165DFF') }}>
|
|
|
|
|
|
{item?.subValue}
|
2026-05-14 09:37:15 +08:00
|
|
|
|
</span>
|
2026-07-14 09:02:11 +08:00
|
|
|
|
</div>*/}
|
2026-07-14 17:32:31 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div style={{ width: 52, height: 52, borderRadius: 14, background: item.bg, display: 'flex', alignItems: 'center', justifyContent: 'center', boxShadow: `0 4px 10px ${item.bg}80` }}>
|
|
|
|
|
|
{item.icon}
|
|
|
|
|
|
</div>
|
2026-05-11 11:59:17 +08:00
|
|
|
|
</div>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
))}
|
2026-05-11 12:40:31 +08:00
|
|
|
|
</Row>
|
2026-07-13 16:25:44 +08:00
|
|
|
|
|
2026-07-14 17:32:31 +08:00
|
|
|
|
{/* 筛选栏 */}
|
|
|
|
|
|
<Card bordered={false} bodyStyle={{ padding: '8px 16px 0px 16px' }} style={{ ...cardStyle, marginBottom: 8 }}>
|
|
|
|
|
|
<Form form={queryForm} layout="inline">
|
|
|
|
|
|
<Form.Item name="orderType" label="工单类型">
|
|
|
|
|
|
<Select style={{ width: 120 }} size="small" options={workOrderTypeOptions} allowClear showSearch optionFilterProp="label" filterOption={(input, option) => option.label.toLowerCase().includes(input.toLowerCase())} />
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
|
<Form.Item name="priorityLevel" label="优先级">
|
|
|
|
|
|
<Select style={{ width: 120 }} size="small" options={errorLevelOptions} allowClear />
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
|
<Form.Item name="timeRange" label="时间范围">
|
|
|
|
|
|
<RangePicker style={{ width: 320 }} size="small" />
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
|
<Form.Item name="orderStatus" label="状态" >
|
|
|
|
|
|
<Select style={{ width: 120 }} size="small" options={statusOptions} allowClear />
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
|
<Form.Item name="keyword" label="关键词">
|
|
|
|
|
|
<Input placeholder="请输入工单编号/标题" prefix={<SearchOutlined />} size="small" />
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item>
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
<Button size="small" onClick={handleReset}>重置</Button>
|
|
|
|
|
|
<Button type="primary" size="small" icon={<SearchOutlined />} onClick={handleQuery}>查询</Button>
|
2026-05-18 09:15:22 +08:00
|
|
|
|
</Space>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
</Form.Item>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
|
|
<Row gutter={[8, 8]}>
|
|
|
|
|
|
{/* 左侧:列表 + 底部图表 */}
|
|
|
|
|
|
<Col xs={24} xl={15}>
|
|
|
|
|
|
<Card
|
|
|
|
|
|
bordered={false}
|
|
|
|
|
|
title={
|
|
|
|
|
|
<Space size={8}>
|
|
|
|
|
|
<Text strong style={{ fontSize: 15, color: '#1D2129' }}>工单列表</Text>
|
|
|
|
|
|
<Text type="secondary" style={{ fontSize: 12 }}>(共 {workOrderTotal} 条)</Text>
|
|
|
|
|
|
{selectedRowKeys.length > 0 && (
|
|
|
|
|
|
<>
|
|
|
|
|
|
<Popconfirm
|
|
|
|
|
|
title={`确定删除已选中的 ${selectedRowKeys.length} 条工单吗?`}
|
|
|
|
|
|
onConfirm={handleBatchDelete}
|
|
|
|
|
|
>
|
|
|
|
|
|
<Button size="small" danger icon={<DeleteOutlined />}>
|
|
|
|
|
|
批量删除
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Popconfirm>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
icon={<PlayCircleFilled />}
|
|
|
|
|
|
onClick={openExecuteModal}
|
|
|
|
|
|
>
|
|
|
|
|
|
批量执行 ({selectedRowKeys.length})
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
}
|
|
|
|
|
|
bodyStyle={{ padding: 0 }}
|
|
|
|
|
|
style={{ ...cardStyle, marginBottom: 8 }}
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
<Table
|
|
|
|
|
|
dataSource={workOrderList}
|
|
|
|
|
|
columns={columns}
|
|
|
|
|
|
pagination={false}
|
|
|
|
|
|
loading={loading}
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
rowKey="id"
|
|
|
|
|
|
className="compact-table"
|
|
|
|
|
|
scroll={{ x: 'max-content' }}
|
|
|
|
|
|
rowSelection={rowSelection}
|
|
|
|
|
|
// 给当前选中行添加高亮类名
|
|
|
|
|
|
rowClassName={(record) => record.id === selectedRowKey ? 'table-active-row' : ''}
|
|
|
|
|
|
onRow={(record) => ({
|
|
|
|
|
|
onClick: () => handleRowSelect(record)
|
|
|
|
|
|
})}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<div style={{ padding: '12px 16px', textAlign: 'right' }}>
|
|
|
|
|
|
<Pagination
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
current={pagination.current}
|
|
|
|
|
|
pageSize={pagination.pageSize}
|
|
|
|
|
|
total={workOrderTotal}
|
|
|
|
|
|
showSizeChanger
|
|
|
|
|
|
showQuickJumper
|
|
|
|
|
|
onChange={handlePageChange}
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
|
|
<Row gutter={[12, 12]}>
|
|
|
|
|
|
<Col xs={24} md={9}>
|
|
|
|
|
|
<Card bordered={false} title={<Text strong style={{ fontSize: 14 }}>工单状态分布</Text>} style={{ ...cardStyle, height: 380 }}>
|
|
|
|
|
|
<div style={{ height: 300, position: 'relative' }}>
|
|
|
|
|
|
<Pie
|
|
|
|
|
|
data={pieData}
|
|
|
|
|
|
angleField="value"
|
|
|
|
|
|
colorField="type"
|
|
|
|
|
|
radius={1}
|
|
|
|
|
|
innerRadius={0.65}
|
|
|
|
|
|
label={false}
|
|
|
|
|
|
color={['#1890ff', '#165DFF', '#F7BA1E', '#00B42A', '#722ed1']}
|
|
|
|
|
|
legend={{ position: 'right', layout: 'vertical' }}
|
|
|
|
|
|
height={260}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<div style={{ position: 'absolute', top: '45%', left: '50%', textAlign: 'center', transform: 'translate(-50%, -50%)' }}>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#86909C' }}>总数</div>
|
|
|
|
|
|
<div style={{ fontSize: 28, fontWeight: 800, color: '#1D2129' }}>{workOrderTotal}</div>
|
|
|
|
|
|
</div>
|
2026-05-11 12:40:31 +08:00
|
|
|
|
</div>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col xs={24} md={15}>
|
2026-07-20 15:53:43 +08:00
|
|
|
|
<Card
|
|
|
|
|
|
bordered={false}
|
|
|
|
|
|
title={<Text strong style={{ fontSize: 14 }}>任务排班 / 日历视图</Text>}
|
|
|
|
|
|
extra={
|
|
|
|
|
|
<Button
|
|
|
|
|
|
type="link"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
onClick={() => setScheduleModalVisible(true)}
|
|
|
|
|
|
>
|
|
|
|
|
|
更多 <ChevronRight size={14} />
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
}
|
|
|
|
|
|
style={{ ...cardStyle, height: 380 }}
|
|
|
|
|
|
bodyStyle={{ padding: '16px' }}
|
|
|
|
|
|
>
|
|
|
|
|
|
{/* 日期切换栏 */}
|
2026-07-14 17:32:31 +08:00
|
|
|
|
<div style={{ marginBottom: 16 }}>
|
|
|
|
|
|
<Space>
|
2026-07-20 15:53:43 +08:00
|
|
|
|
<Button size="small" icon={<ChevronRight style={{ transform: 'rotate(180deg)' }} size={14} />} onClick={prevScheduleDay} />
|
|
|
|
|
|
<Text strong style={{ fontSize: 13 }}>
|
|
|
|
|
|
{scheduleDate}
|
|
|
|
|
|
{scheduleDate === dayjs().format('YYYY-MM-DD') ? ' (今天)' : ''}
|
|
|
|
|
|
</Text>
|
|
|
|
|
|
<Button size="small" icon={<ChevronRight size={14} />} onClick={nextScheduleDay} />
|
2026-07-14 17:32:31 +08:00
|
|
|
|
</Space>
|
|
|
|
|
|
</div>
|
2026-07-20 15:53:43 +08:00
|
|
|
|
|
2026-07-14 17:32:31 +08:00
|
|
|
|
<div style={{ border: '1px solid #f0f0f0', borderRadius: 8, overflow: 'hidden' }}>
|
2026-07-20 15:53:43 +08:00
|
|
|
|
{/* 横向时间表头 */}
|
2026-07-14 17:32:31 +08:00
|
|
|
|
<div style={{ display: 'flex', background: '#f8fafc', borderBottom: '1px solid #f0f0f0' }}>
|
|
|
|
|
|
<div style={{ width: 60, padding: '10px 0', borderRight: '1px solid #f0f0f0' }}></div>
|
2026-07-20 15:53:43 +08:00
|
|
|
|
{timeTicks.map(t => (
|
|
|
|
|
|
<div key={t} style={{ flex: 1, padding: '10px 0', textAlign: 'center', fontSize: 11, color: '#86909C', fontWeight: 500 }}>
|
|
|
|
|
|
{t}
|
|
|
|
|
|
</div>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
))}
|
|
|
|
|
|
</div>
|
2026-07-20 15:53:43 +08:00
|
|
|
|
|
|
|
|
|
|
{/* 单一行时间画布,不再区分人员 */}
|
|
|
|
|
|
<div style={{ height: 220, position: 'relative', padding: '10px 0', overflow: 'hidden' }}>
|
|
|
|
|
|
{getScheduleOrderList().length === 0 ? (
|
|
|
|
|
|
<Empty description={`${scheduleDate} 暂无设置计划执行时间的工单`} style={{ padding: "60px 0" }} />
|
|
|
|
|
|
) : (
|
|
|
|
|
|
<>
|
|
|
|
|
|
{getScheduleOrderList().map((order, index) => {
|
|
|
|
|
|
const pos = calcSchedulePosition(order.planStartTime);
|
|
|
|
|
|
if (!pos) return null;
|
|
|
|
|
|
const style = getOrderScheduleStyle(order.priorityLevel);
|
|
|
|
|
|
// 固定纵向排布,40px一行不重叠
|
|
|
|
|
|
const topPx = 10 + (index * 40);
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div
|
|
|
|
|
|
key={order.id}
|
|
|
|
|
|
className="schedule-item"
|
|
|
|
|
|
onClick={() => handleRowSelect(order)}
|
|
|
|
|
|
style={{
|
|
|
|
|
|
position: 'absolute',
|
|
|
|
|
|
left: pos.left,
|
|
|
|
|
|
top: `${topPx}px`,
|
|
|
|
|
|
width: pos.width,
|
|
|
|
|
|
height: 40,
|
|
|
|
|
|
background: style.bg,
|
|
|
|
|
|
border: `1px solid ${style.border}`,
|
|
|
|
|
|
borderRadius: 6,
|
|
|
|
|
|
padding: '4px 8px',
|
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
|
color: style.color,
|
|
|
|
|
|
overflow: "hidden",
|
|
|
|
|
|
cursor: "pointer",
|
|
|
|
|
|
zIndex: 2
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
<b style={{ display: 'block', whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>
|
|
|
|
|
|
{order.orderTitle}
|
|
|
|
|
|
</b>
|
|
|
|
|
|
<span style={{ fontSize: 9 }}>
|
|
|
|
|
|
{dayjs(order.planStartTime).format('HH:mm')}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
})}
|
|
|
|
|
|
</>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
2026-05-11 12:40:31 +08:00
|
|
|
|
</div>
|
2026-07-20 15:53:43 +08:00
|
|
|
|
|
|
|
|
|
|
{/* 更多工单弹窗:弹窗内只展示当前选中日期工单 */}
|
|
|
|
|
|
<Modal
|
|
|
|
|
|
title={`${scheduleDate} 计划工单列表`}
|
|
|
|
|
|
open={scheduleModalVisible}
|
|
|
|
|
|
onCancel={() => setScheduleModalVisible(false)}
|
|
|
|
|
|
width={800}
|
|
|
|
|
|
footer={null}
|
|
|
|
|
|
>
|
|
|
|
|
|
<Table
|
|
|
|
|
|
dataSource={getScheduleOrderList()}
|
|
|
|
|
|
rowKey="id"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
columns={[
|
|
|
|
|
|
{ title: '工单编号', dataIndex: 'orderNo', width: 260 },
|
|
|
|
|
|
{ title: '工单标题', dataIndex: 'orderTitle', ellipsis: true },
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '计划执行时间',
|
|
|
|
|
|
dataIndex: 'planStartTime',
|
|
|
|
|
|
render: t => dayjs(t).format('YYYY-MM-DD HH:mm')
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '优先级',
|
|
|
|
|
|
dataIndex: 'priorityLevel',
|
|
|
|
|
|
render: p => (
|
|
|
|
|
|
<Tag
|
|
|
|
|
|
style={{
|
|
|
|
|
|
color: priorityConfig[p]?.color,
|
|
|
|
|
|
background: priorityConfig[p]?.bg,
|
|
|
|
|
|
border: `1px solid ${priorityConfig[p]?.color}`
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
{priorityConfig[p]?.label}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
)
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '状态',
|
|
|
|
|
|
dataIndex: 'orderStatus',
|
|
|
|
|
|
render: s => orderStatusConfig[s]?.label
|
|
|
|
|
|
},
|
|
|
|
|
|
]}
|
|
|
|
|
|
/>
|
|
|
|
|
|
</Modal>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
</Card>
|
2026-07-20 15:53:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-14 17:32:31 +08:00
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
|
|
{/* 右侧:详情 + AI + 告警 */}
|
|
|
|
|
|
<Col xs={24} xl={9}>
|
|
|
|
|
|
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '20px' }}>
|
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 }}>
|
|
|
|
|
|
<Text strong style={{ fontSize: 16, color: '#1D2129' }}>工单详情</Text>
|
|
|
|
|
|
<Text type="secondary" style={{ fontSize: 12 }}>工单编号: <span style={{ color: '#4E5969', fontWeight: 600 }}>{currentDetail?.orderNo || '--'}</span></Text>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div style={{ marginBottom: 8 }}>
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 8, flexWrap: 'wrap', gap: 12 }}>
|
|
|
|
|
|
<span level={4} style={{ margin: 0, fontSize: 18, fontWeight: 800 }}>{currentDetail?.orderTitle || '暂无标题'}</span>
|
|
|
|
|
|
{currentDetail?.priorityLevel && (
|
|
|
|
|
|
<Tag style={{ color: priorityConfig[currentDetail.priorityLevel]?.color, background: priorityConfig[currentDetail.priorityLevel]?.bg, border: `1px solid ${priorityConfig[currentDetail.priorityLevel]?.color}`, borderRadius: 4, fontWeight: 600 }}>
|
|
|
|
|
|
{currentDetail.priorityLevel}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<Row gutter={[16, 16]} style={{ background: '#f8fafc', padding: 16, borderRadius: 12, marginBottom: 20 }}>
|
|
|
|
|
|
<Col span={12}><span style={{ fontSize: 12 }}>来源:</span><span style={{ fontSize: 12, fontWeight: 500 }}>{sourceTypeMap[currentDetail?.sourceType] || '--'}</span></Col>
|
|
|
|
|
|
<Col span={12}><span style={{ fontSize: 12 }}>工单类型:</span><span style={{ fontSize: 12, fontWeight: 500 }}>{getWorkOrderTypeText(currentDetail?.orderType)}</span></Col>
|
|
|
|
|
|
<Col span={24}><span style={{ fontSize: 12 }}>执行开始时间:</span>
|
|
|
|
|
|
<span style={{ fontSize: 12, fontWeight: 500 }}>
|
|
|
|
|
|
{currentDetail?.actualStartTime}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col span={24}><span style={{ fontSize: 12 }}>关联设备:</span><span style={{ fontSize: 12, color: '#165DFF', fontWeight: 600 }}>{currentDetail?.deviceName || '无'}</span></Col>
|
|
|
|
|
|
<Col span={12}><span style={{ fontSize: 12 }}>关联区域:</span><span style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.siteName || '无'}</span></Col>
|
|
|
|
|
|
<Col span={12}>
|
|
|
|
|
|
<span style={{ fontSize: 12 }}>当前状态:</span>
|
|
|
|
|
|
<Tag color="blue" style={{ borderRadius: 4, fontWeight: 600, border: 'none', background: '#E8F3FF', color: '#165DFF' }}>{orderStatusConfig[currentDetail?.orderStatus]?.label || '--'}</Tag>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
|
<span style={{ fontSize: 12 }}>任务描述:</span>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#4E5969', marginTop: 4, lineHeight: 1.6 }}>{currentDetail?.taskDescription || '暂无描述'}</div>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div style={{ marginBottom: 8 }}>
|
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', padding: '0 10px', position: 'relative' }}>
|
|
|
|
|
|
<div style={{ position: 'absolute', top: 11, left: '15%', right: '15%', height: 2, background: '#f0f0f0', zIndex: 1 }}>
|
|
|
|
|
|
<div style={{ width: currentDetail?.orderStatus >= 3 ? '80%' : (currentDetail?.orderStatus === 2 ? '66%' : '33%'), height: '100%', background: '#00B42A' }}></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{(() => {
|
|
|
|
|
|
const status = currentDetail?.orderStatus;
|
|
|
|
|
|
// 流程节点
|
|
|
|
|
|
const steps = [
|
|
|
|
|
|
{ label: '已创建', step: 1 },
|
|
|
|
|
|
{ label: '执行中', step: 2 },
|
|
|
|
|
|
{ label: '已挂起', step: 3 },
|
|
|
|
|
|
{ label: '已完成', step: 4 },
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
// 判断节点是否激活
|
|
|
|
|
|
const getStepActive = (item) => {
|
|
|
|
|
|
// 已完成:全部节点激活
|
|
|
|
|
|
if (status === 3) return true;
|
|
|
|
|
|
// 已挂起:点亮 已创建、执行中、已挂起
|
|
|
|
|
|
if (status === 4) return item.step <= 3;
|
|
|
|
|
|
// 执行中:点亮前2个
|
|
|
|
|
|
if (status === 2) return item.step <= 2;
|
|
|
|
|
|
// 待处理:只点亮第一个
|
|
|
|
|
|
if (status === 1) return item.step === 1;
|
|
|
|
|
|
return false;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 是否挂起状态(进度条灰色)
|
|
|
|
|
|
const isSuspend = status === 4;
|
|
|
|
|
|
|
|
|
|
|
|
// 进度条宽度 4个节点3段,每段33.33%
|
|
|
|
|
|
let progressWidth = '0%';
|
|
|
|
|
|
if (status === 1) progressWidth = '0%';
|
|
|
|
|
|
if (status === 2) progressWidth = '33.33%';
|
|
|
|
|
|
if (status === 3) progressWidth = '80%';
|
|
|
|
|
|
if (status === 4) progressWidth = '33.33%';
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div style={{ marginBottom: 16, width: '100%' }}>
|
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', padding: '0 4px', position: 'relative' }}>
|
|
|
|
|
|
{/* 底层灰色轨道 */}
|
|
|
|
|
|
<div style={{
|
|
|
|
|
|
position: 'absolute',
|
|
|
|
|
|
top: 11,
|
|
|
|
|
|
left: '10%',
|
|
|
|
|
|
right: '10%',
|
|
|
|
|
|
height: 2,
|
|
|
|
|
|
background: '#E5E6EB',
|
|
|
|
|
|
zIndex: 1
|
|
|
|
|
|
}} />
|
|
|
|
|
|
{/* 进度填充 */}
|
|
|
|
|
|
<div style={{
|
|
|
|
|
|
position: 'absolute',
|
|
|
|
|
|
top: 11,
|
|
|
|
|
|
left: '10%',
|
|
|
|
|
|
height: 2,
|
|
|
|
|
|
width: progressWidth,
|
|
|
|
|
|
background: isSuspend ? '#86909C' : '#00B42A',
|
|
|
|
|
|
zIndex: 1,
|
|
|
|
|
|
transition: 'width 0.3s ease'
|
|
|
|
|
|
}} />
|
|
|
|
|
|
|
|
|
|
|
|
{steps.map(item => {
|
|
|
|
|
|
const active = getStepActive(item);
|
|
|
|
|
|
// 已完成状态全部显示对勾
|
|
|
|
|
|
const isAllFinish = status === 3;
|
|
|
|
|
|
// 仅挂起状态下第三个节点显示暂停图标
|
|
|
|
|
|
const isSuspendDot = status === 4 && item.step === 3;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div key={item.step} style={{ textAlign: 'center', zIndex: 2, position: 'relative', width: '22%' }}>
|
|
|
|
|
|
<div style={{
|
|
|
|
|
|
width: 26,
|
|
|
|
|
|
height: 26,
|
|
|
|
|
|
borderRadius: '50%',
|
|
|
|
|
|
margin: '0 auto',
|
|
|
|
|
|
display: 'flex',
|
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
|
justifyContent: 'center',
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
fontWeight: 700,
|
|
|
|
|
|
// 仅中途挂起时 已挂起节点黄色,其余激活绿色
|
|
|
|
|
|
background: isSuspendDot ? '#F7BA1E' : (active ? '#00B42A' : '#fff'),
|
|
|
|
|
|
border: active ? 'none' : '2px solid #E5E6EB',
|
|
|
|
|
|
color: active ? '#fff' : '#86909C',
|
|
|
|
|
|
boxShadow: active ? '0 0 0 2px rgba(0,180,42,0.15)' : 'none'
|
|
|
|
|
|
}}>
|
|
|
|
|
|
{isAllFinish ? (
|
|
|
|
|
|
<CheckOutlined size={14} />
|
|
|
|
|
|
) : isSuspendDot ? (
|
|
|
|
|
|
<PauseOutlined size={14} />
|
|
|
|
|
|
) : (
|
|
|
|
|
|
item.step
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style={{
|
|
|
|
|
|
fontSize: 11,
|
|
|
|
|
|
marginTop: 6,
|
|
|
|
|
|
whiteSpace: 'nowrap',
|
|
|
|
|
|
color: active ? '#1D2129' : '#86909C',
|
|
|
|
|
|
fontWeight: active ? 500 : 400
|
|
|
|
|
|
}}>
|
|
|
|
|
|
{item.label}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
})}
|
|
|
|
|
|
</div>
|
2026-05-11 11:59:17 +08:00
|
|
|
|
</div>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
);
|
|
|
|
|
|
})()}
|
2026-05-11 11:59:17 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-05-11 12:40:31 +08:00
|
|
|
|
|
2026-07-14 17:32:31 +08:00
|
|
|
|
<Row gutter={12}>
|
|
|
|
|
|
<Col span={6}>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
block
|
|
|
|
|
|
onClick={openExecuteModal}
|
|
|
|
|
|
style={{ borderRadius: 8, height: 36, fontWeight: 600 }}
|
|
|
|
|
|
icon={<PlayCircleFilled />}
|
|
|
|
|
|
>
|
|
|
|
|
|
执行工单
|
|
|
|
|
|
</Button>
|
2026-05-11 12:40:31 +08:00
|
|
|
|
</Col>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
<Col span={6}><Button icon={<EditOutlined />} block onClick={openEditModal} style={{ borderRadius: 8, height: 36, fontWeight: 600 }}>修改</Button></Col>
|
|
|
|
|
|
<Col span={6}><Popconfirm title="确定挂起?" onConfirm={handleSuspend}><Button icon={<PauseOutlined />} danger ghost block style={{ borderRadius: 8, height: 36, fontWeight: 600 }}>挂起</Button></Popconfirm></Col>
|
|
|
|
|
|
<Col span={6}><Button
|
|
|
|
|
|
icon={<CheckCircleOutlined />}
|
|
|
|
|
|
style={{ background: '#00B42A', color: '#fff', border: 'none', borderRadius: 8, height: 36, fontWeight: 600 }}
|
|
|
|
|
|
block
|
|
|
|
|
|
onClick={openCompleteModal}
|
|
|
|
|
|
>完成</Button></Col>
|
2026-05-11 12:40:31 +08:00
|
|
|
|
</Row>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
</Card>
|
2026-05-11 11:59:17 +08:00
|
|
|
|
|
2026-07-14 17:32:31 +08:00
|
|
|
|
<Card bordered={false} title={<Text strong style={{ fontSize: 14, color: '#1D2129' }}>AI 建议与关联信息</Text>}
|
|
|
|
|
|
style={{ ...cardStyle, marginTop: 8 }} bodyStyle={{ padding: '16px' }}>
|
|
|
|
|
|
<Row gutter={12} style={{ marginBottom: 16 }}>
|
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
|
<div style={{ background: '#F9F0FF', padding: '16px 8px', borderRadius: 12, textAlign: 'center', height: '100%', border: '1px solid #F3E8FF' }}>
|
|
|
|
|
|
<div style={{ width: 32, height: 32, background: '#fff', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'center', margin: '0 auto 10px', boxShadow: '0 2px 6px rgba(114,46,209,0.1)' }}>
|
|
|
|
|
|
<RobotOutlined style={{ fontSize: 18, color: '#722ED1' }} />
|
2026-05-14 12:44:18 +08:00
|
|
|
|
</div>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
<div style={{ fontSize: 11, color: '#86909C', marginBottom: 4 }}>建议携带</div>
|
|
|
|
|
|
<div style={{ fontSize: 12, fontWeight: 700, color: '#1D2129' }}>红外热像设备</div>
|
2026-05-14 12:44:18 +08:00
|
|
|
|
</div>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
</Col>
|
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
|
<div style={{ background: '#E8FFEA', padding: '16px 8px', borderRadius: 12, textAlign: 'center', height: '100%', border: '1px solid #D1FFD6' }}>
|
|
|
|
|
|
<div style={{ width: 32, height: 32, background: '#fff', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'center', margin: '0 auto 10px', boxShadow: '0 2px 6px rgba(0,180,42,0.1)' }}>
|
|
|
|
|
|
<ThunderboltOutlined style={{ fontSize: 18, color: '#00B42A' }} />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style={{ fontSize: 11, color: '#86909C', marginBottom: 4 }}>优先复检组件</div>
|
|
|
|
|
|
<div style={{ fontSize: 12, fontWeight: 700, color: '#1D2129' }}>B-12-03 / B-12-05</div>
|
2026-05-14 12:44:18 +08:00
|
|
|
|
</div>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
</Col>
|
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
|
<div style={{ background: '#FFF7E8', padding: '16px 8px', borderRadius: 12, textAlign: 'center', height: '100%', border: '1px solid #FFE4BA' }}>
|
|
|
|
|
|
<div style={{ width: 32, height: 32, background: '#fff', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'center', margin: '0 auto 10px', boxShadow: '0 2px 6px rgba(247,186,30,0.1)' }}>
|
|
|
|
|
|
<RiseOutlined style={{ fontSize: 18, color: '#F7BA1E' }} />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style={{ fontSize: 11, color: '#86909C', marginBottom: 4 }}>预计影响发电</div>
|
|
|
|
|
|
<div style={{ fontSize: 13, fontWeight: 800, color: '#1D2129' }}>2.1%</div>
|
2026-05-14 12:44:18 +08:00
|
|
|
|
</div>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
|
|
<Row gutter={12}>
|
|
|
|
|
|
<Col span={13}>
|
|
|
|
|
|
<div style={{ fontSize: 12, fontWeight: 700, color: '#1D2129', marginBottom: 12 }}>关联告警趋势 <Text type="secondary" style={{ fontSize: 11, fontWeight: 400 }}>(近 7 天)</Text></div>
|
|
|
|
|
|
<UniversalLineChart
|
|
|
|
|
|
data={alarmTrendData}
|
|
|
|
|
|
xKey="date"
|
|
|
|
|
|
height={130}
|
|
|
|
|
|
backgroundColor="transparent"
|
|
|
|
|
|
showLegend={false}
|
|
|
|
|
|
showTooltip={true}
|
|
|
|
|
|
showGrid={true}
|
|
|
|
|
|
smooth
|
|
|
|
|
|
dot
|
|
|
|
|
|
series={[{ key: 'value', name: '告警数量', color: '#165DFF', strokeWidth: 2 }]}
|
|
|
|
|
|
/>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col span={11}>
|
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 12 }}>
|
|
|
|
|
|
<div style={{ fontSize: 12, fontWeight: 700, color: '#1D2129' }}>关联告警列表 <Text type="secondary" style={{ fontSize: 11, fontWeight: 400 }}>(近 3 条)</Text></div>
|
|
|
|
|
|
<Button type="link" size="small" style={{ fontSize: 11, padding: 0 }}>查看全部</Button>
|
2026-05-14 12:44:18 +08:00
|
|
|
|
</div>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
|
|
|
|
|
|
{[
|
|
|
|
|
|
{ title: 'INV-05 逆变器告警', time: '05-24 10:24', status: 'error' },
|
|
|
|
|
|
{ title: 'B-12 区块热斑告警', time: '05-24 09:56', status: 'warning' },
|
|
|
|
|
|
{ title: 'B-12 组件温度异常', time: '05-24 09:32', status: 'warning' },
|
|
|
|
|
|
].map((item, idx) => (
|
|
|
|
|
|
<div key={idx} style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '6px 8px', background: '#f8fafc', borderRadius: 6 }}>
|
|
|
|
|
|
<div style={{ width: 6, height: 6, borderRadius: '50%', background: item.status === 'error' ? '#F53F3F' : '#F7BA1E' }}></div>
|
|
|
|
|
|
<Text ellipsis style={{ flex: 1, fontSize: 11, fontWeight: 500, color: '#4E5969' }}>{item.title}</Text>
|
|
|
|
|
|
<Text type="secondary" style={{ fontSize: 10, flexShrink: 0 }}>{item.time}</Text>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
))}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
2026-05-11 11:59:17 +08:00
|
|
|
|
|
2026-07-14 17:32:31 +08:00
|
|
|
|
{/* 修改工单弹窗 */}
|
|
|
|
|
|
<Modal title="修改工单" open={editModalVisible} onCancel={() => setEditModalVisible(false)} footer={null} width={520}>
|
|
|
|
|
|
<Form form={form} layout="vertical" onFinish={submitEdit}>
|
|
|
|
|
|
<FormItem name="orderTitle" label="工单标题" rules={[{ required: true, message: '请输入工单标题' }]}>
|
|
|
|
|
|
<Input placeholder="请输入工单标题" />
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem name="orderType" label="工单类型" rules={[{ required: true, message: '请选择工单类型' }]}>
|
|
|
|
|
|
<Select placeholder="请选择工单类型" options={workOrderTypeOptions} />
|
|
|
|
|
|
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem name="priorityLevel" label="优先级" rules={[{ required: true, message: '请选择优先级' }]}>
|
|
|
|
|
|
<Select placeholder="请选择优先级">
|
|
|
|
|
|
<Option value={1}>高</Option><Option value={2}>中</Option><Option value={3}>低</Option>
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem name="taskDescription" label="任务描述" rules={[{ required: true, message: '请输入任务描述' }]}>
|
|
|
|
|
|
<Input.TextArea rows={4} placeholder="请输入任务描述" />
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem style={{ textAlign: 'right', marginBottom: 0 }}>
|
|
|
|
|
|
<Button onClick={() => setEditModalVisible(false)}>取消</Button>
|
|
|
|
|
|
<Button type="primary" htmlType="submit" style={{ marginLeft: 8 }}>确认修改</Button>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
|
|
{/* 执行工单弹窗 */}
|
|
|
|
|
|
<Modal title="执行工单" open={dispatchModalVisible} onCancel={() => setDispatchModalVisible(false)} footer={null} width={550}>
|
|
|
|
|
|
<Form form={form} layout="vertical" onFinish={submitExecute}>
|
|
|
|
|
|
<FormItem name="orderIds" label="工单ID" hidden><Input /></FormItem>
|
|
|
|
|
|
<FormItem label="选中工单">
|
|
|
|
|
|
<div style={{
|
|
|
|
|
|
padding: 8,
|
|
|
|
|
|
background: '#f8fafc',
|
|
|
|
|
|
borderRadius: 6,
|
|
|
|
|
|
maxHeight: 150,
|
|
|
|
|
|
overflow: 'auto'
|
|
|
|
|
|
}}>
|
|
|
|
|
|
{selectedRowKeys.length > 0 ? (
|
|
|
|
|
|
workOrderList
|
|
|
|
|
|
.filter(item => selectedRowKeys.includes(item.id))
|
|
|
|
|
|
.map(item => (
|
|
|
|
|
|
<div key={item.id} style={{ marginBottom: 4 }}>
|
|
|
|
|
|
• {item.orderTitle} ({item.orderNo})
|
|
|
|
|
|
</div>
|
|
|
|
|
|
))
|
|
|
|
|
|
) : (
|
|
|
|
|
|
<div>• {currentDetail?.orderTitle} ({currentDetail?.orderNo})</div>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem
|
|
|
|
|
|
name="deviceId"
|
|
|
|
|
|
label="选择执行设备"
|
|
|
|
|
|
rules={[{ required: true, message: '请选择执行设备' }]}
|
|
|
|
|
|
>
|
|
|
|
|
|
{/*<Select
|
2026-07-14 09:02:11 +08:00
|
|
|
|
style={{ width: "80%", marginBottom: 8 }}
|
|
|
|
|
|
placeholder="请选择设备"
|
|
|
|
|
|
value={selectedDevice?.device_sn || selectedDevice?.serialNumber}
|
|
|
|
|
|
onChange={handleDeviceChange}
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
showSearch
|
|
|
|
|
|
allowClear
|
|
|
|
|
|
optionFilterProp="label"
|
|
|
|
|
|
filterOption={(input, option) =>
|
|
|
|
|
|
String(option?.label || "").toLowerCase().includes(input.toLowerCase())
|
|
|
|
|
|
}
|
|
|
|
|
|
options={[
|
|
|
|
|
|
{ label: <span>机器人</span>, options: devices.map(item => ({ value: item.device_sn || item.serialNumber, label: item.deviceAlias || item.deviceName || '未知设备' })) },
|
|
|
|
|
|
{ label: <span>无人机</span>, options: planedevices.map(item => ({ value: item.device_sn, label: item.drone_callsign || item.callsign || '未知设备' })) },
|
|
|
|
|
|
]}
|
|
|
|
|
|
/>*/}
|
|
|
|
|
|
|
2026-07-14 17:32:31 +08:00
|
|
|
|
<Select
|
|
|
|
|
|
placeholder="请选择执行设备"
|
|
|
|
|
|
showSearch
|
|
|
|
|
|
style={{ width: "100%" }}
|
|
|
|
|
|
// 自定义筛选逻辑:输入文字匹配别名、序列号、无人机呼号
|
|
|
|
|
|
filterOption={(inputValue, option) => {
|
|
|
|
|
|
const label = option.children || "";
|
|
|
|
|
|
return label.toLowerCase().includes(inputValue.toLowerCase());
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
{/* 机器人设备分组 */}
|
|
|
|
|
|
<Select.OptGroup label="机器人">
|
|
|
|
|
|
{deviceAll
|
|
|
|
|
|
.filter(item => item.serialNumber)
|
|
|
|
|
|
.map(device => (
|
|
|
|
|
|
<Option
|
|
|
|
|
|
key={device.id}
|
|
|
|
|
|
value={device.serialNumber}
|
|
|
|
|
|
>
|
|
|
|
|
|
{device.deviceAlias || device.serialNumber}
|
|
|
|
|
|
</Option>
|
|
|
|
|
|
))}
|
|
|
|
|
|
</Select.OptGroup>
|
|
|
|
|
|
|
|
|
|
|
|
{/* 无人机分组 */}
|
|
|
|
|
|
<Select.OptGroup label="无人机">
|
|
|
|
|
|
{deviceAll
|
|
|
|
|
|
.filter(item => item.device_sn)
|
|
|
|
|
|
.map(device => (
|
|
|
|
|
|
<Option
|
|
|
|
|
|
key={device.id}
|
|
|
|
|
|
value={device.device_sn}
|
|
|
|
|
|
>
|
|
|
|
|
|
{device.drone_callsign || device.device_sn}
|
|
|
|
|
|
</Option>
|
|
|
|
|
|
))}
|
|
|
|
|
|
</Select.OptGroup>
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
|
|
|
|
|
|
<FormItem
|
|
|
|
|
|
name="startTime"
|
|
|
|
|
|
label="执行开始时间"
|
2026-05-15 16:23:55 +08:00
|
|
|
|
>
|
2026-07-14 17:32:31 +08:00
|
|
|
|
<DatePicker
|
|
|
|
|
|
showTime
|
|
|
|
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
|
placeholder="请选择执行开始时间"
|
|
|
|
|
|
style={{ width: '100%' }}
|
|
|
|
|
|
/>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem style={{ textAlign: 'right', marginBottom: 0 }}>
|
|
|
|
|
|
<Button onClick={() => setDispatchModalVisible(false)}>取消</Button>
|
|
|
|
|
|
<Button type="primary" htmlType="submit" style={{ marginLeft: 8 }}>确认执行</Button>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
|
|
{/* 完成工单弹窗 */}
|
|
|
|
|
|
<Modal title="完成工单" open={completeModalVisible} onCancel={() => setCompleteModalVisible(false)} footer={null} width={500}>
|
|
|
|
|
|
<Form form={completeForm} layout="vertical" onFinish={submitComplete}>
|
|
|
|
|
|
<Form.Item name="id" hidden><Input /></Form.Item>
|
|
|
|
|
|
<Form.Item name="orderNo" label="工单编号"><Input disabled /></Form.Item>
|
|
|
|
|
|
<Form.Item name="handleResult" label="处理结果" rules={[{ required: true, message: '请输入处理结果' }]}>
|
|
|
|
|
|
<Select placeholder="请选择处理结果">
|
|
|
|
|
|
<Option value="已处理完成">已处理完成</Option><Option value="已修复">已修复</Option><Option value="无需处理">无需处理</Option><Option value="问题已闭环">问题已闭环</Option>
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item name="handleRemark" label="处理备注"><Input.TextArea rows={4} placeholder="请填写处理详情、备注信息" /></Form.Item>
|
|
|
|
|
|
<Form.Item style={{ textAlign: 'right', marginBottom: 0 }}>
|
|
|
|
|
|
<Button onClick={() => setCompleteModalVisible(false)}>取消</Button>
|
|
|
|
|
|
<Button type="primary" htmlType="submit" style={{ marginLeft: 8 }}>确认完成</Button>
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
</div >
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-05-08 11:00:11 +08:00
|
|
|
|
);
|
2026-05-11 12:40:31 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default WorkOrderPage;
|