{list.map((item: any, idx: number) => {
- const isReturnPoint = activeType === 'returnPoint';
- const isActive = focusOverlay
- ? isReturnPoint
- ? focusOverlay.type === 'returnPoint' && focusOverlay.index === idx
- : focusOverlay.type === 'region' && String(focusOverlay.id) === String(item.id)
- : false;
- return (
+ const isReturnPoint =
+ activeType === 'returnPoint';
+ const isObstaclePoint =
+ activeType === 'obstaclePoint';
+
+
+ const isActive = isObstaclePoint
+ ? focusOverlay?.type === 'obstaclePoint' &&
+ String(focusOverlay?.id) === String(item.id)
+ : isReturnPoint
+ ? focusOverlay?.type === 'returnPoint' &&
+ focusOverlay?.index === idx
+ : focusOverlay?.type === 'region' &&
+ String(focusOverlay?.id) === String(item.id);
+
+
+
+
+ return (
setFocusOverlay({
- type: isReturnPoint ? 'returnPoint' : 'region',
- index: idx,
- id: item.id,
- nonce: Date.now(),
- })}
+ onClick={() => {
+ // 障碍物点暂不修改地图聚焦逻辑
+ //if (isObstaclePoint) return;
+
+ setFocusOverlay({
+ type: isReturnPoint
+ ? 'returnPoint'
+ : isObstaclePoint ? 'obstaclePoint' : 'region',
+ index: idx,
+ id: item.id,
+ nonce: Date.now(),
+ });
+ }}
style={{
- cursor: 'pointer',
+ cursor: "pointer",
padding: '8px 10px',
borderRadius: 6,
- border: isActive ? '1px solid #1677ff' : '1px solid #f0f0f0',
- background: isActive ? '#e8f3ff' : '#fafafa',
+ border: isActive
+ ? '1px solid #1677ff'
+ : '1px solid #f0f0f0',
+ background: isActive
+ ? '#e8f3ff'
+ : '#fafafa',
display: 'flex',
- alignItems: 'center',
+ alignItems: 'flex-start',
gap: 8,
}}
>
- {activeType === 'returnPoint'
- ?
- :
}
-
-
- {item.alias || item.regionName || t('devices.mapEditor.unnamed')}
+ {isReturnPoint ? (
+
+ ) : (
+
+ )}
+
+
+
e.stopPropagation()}>
+ {
+ const value = e.target.value;
+
+ if (isReturnPoint) {
+ setReturnPointConfigList(prev =>
+ prev.map((p: any, i: number) =>
+ i === idx ? { ...p, alias: value } : p
+ )
+ );
+ } else if (isObstaclePoint) {
+ setObstaclePointConfigList(prev =>
+ prev.map((p: any, i: number) =>
+ i === idx ? { ...p, name: value } : p
+ )
+ );
+ } else {
+ setRegionList(prev =>
+ prev.map((p: any) =>
+ String(p.id) === String(item.id)
+ ? { ...p, regionName: value }
+ : p
+ )
+ );
+ }
+ }}
+ onBlur={(e) => {
+ const value = e.target.value.trim();
+
+ // 名称不能为空
+ if (!value) {
+ messageApi.warning('名称不能为空');
+ getSiteMapInfoFn();
+
+ if (!isReturnPoint && !isObstaclePoint) {
+ getStationRegions({ siteId: stationId }).then((r: any) => {
+ if (r?.code === 200) {
+ const list = r.data || r.rows || [];
+ setRegionList(Array.isArray(list) ? list : []);
+ }
+ });
+ }
+
+ return;
+ }
+
+ if (isReturnPoint) {
+ console.log(value, "43424", item.alias)
+ handleUpdateReturnPointAlias(idx, value);
+ } else if (isObstaclePoint) {
+ handleUpdateObstacleAlias(item, value);
+ } else {
+ handleUpdateRegionName(item, value);
+ }
+ }}
+ onPressEnter={(e) => {
+ (e.target as HTMLInputElement).blur();
+ }}
+ style={{
+ fontSize: 13,
+ fontWeight: 500,
+ }}
+ />
- {activeType === 'returnPoint' ? (
-
e.stopPropagation()}>
+
+ {/* 已配置障碍物点:展示半径与坐标 */}
+ {isObstaclePoint && (
+
+
+ 半径:
+ {
+ const value = e.target.value;
+ setObstaclePointConfigList(prev =>
+ prev.map((pt, i) =>
+ i === idx
+ ? {
+ ...pt,
+ radius: value === '' ? '' : Number(value),
+ }
+ : pt
+ )
+ );
+ }}
+ onBlur={() => {
+ const radius = Number(item.radius);
+
+ if (!Number.isFinite(radius)) {
+ //messageApi.warning('半径不能小于 0.1');
+ return;
+ }
+
+ handleUpdateObstacleRadius(item, radius);
+ }}
+ onPressEnter={(e) => {
+ (e.target as HTMLInputElement).blur();
+ }}
+ />
+
+ {/*
+ 半径:{Number(item.radius ?? 2)} m
+
*/}
+
+ 经度:{Number(
+ item?.position?.lng?.toFixed(2) ??
+ item?.position?.lon?.toFixed(2) ??
+ item?.lon?.toFixed(2) ??
+ 0
+ )}
+
+
+ 纬度:{Number(
+ item?.position?.lat?.toFixed(2) ??
+ item?.lat?.toFixed(2) ??
+ 0
+ )}
+
+
+ )}
+
+ {/* 已配置返航点:保留设备绑定功能 */}
+ {isReturnPoint && (
+
+ e.stopPropagation()
+ }
+ >
- ) : (
- <>
-
- {item.scope?.length ? `${t('devices.mapEditor.scopeCount')}: ${item.scope.length}` : ''}
-
- {item.bindRoutes?.length > 0 && (
-
- {item.bindRoutes.map((rid: number) => {
- const r = presetRoutes.find((x: any) => Number(x.id) === Number(rid));
- return r ? (
- {r.workName || r.name}
- ) : (
- {rid}
- );
- })}
-
- )}
- >
)}
+
+ {/* 已配置分区:保留原有信息 */}
+ {!isReturnPoint &&
+ !isObstaclePoint && (
+ <>
+
+ {item.scope?.length ? `${t('devices.mapEditor.scopeCount')}: ${item.scope.length}` : ''}
+
+
+
+ {item.bindRoutes?.length >
+ 0 && (
+
+ {item.bindRoutes.map(
+ (rid: number) => {
+ const route =
+ presetRoutes.find(
+ (r: any) =>
+ Number(
+ r.id
+ ) ===
+ Number(
+ rid
+ )
+ );
+
+ return (
+
+ {route
+ ? route.workName ||
+ route.name
+ : rid}
+
+ );
+ }
+ )}
+
+ )}
+ >
+ )}
{activeType === 'restArea' && (
<>
@@ -1289,8 +1932,8 @@ export default function MapEditorPage() {
>
)}
- );
- })}
+ );
+ })}
);
})()}
diff --git a/src/components/devices/deviceController.js b/src/components/devices/deviceController.js
index ce1137b..de4b754 100644
--- a/src/components/devices/deviceController.js
+++ b/src/components/devices/deviceController.js
@@ -159,6 +159,9 @@ export default class DeviceController {
}
+ if (msg?.type == 'device_status_changed') {
+ this.deviceStatusChangedMsg?.(msg);
+ }
};
ws.onerror = () => {
diff --git a/src/pages/TaskMonitorPage.tsx b/src/pages/TaskMonitorPage.tsx
new file mode 100644
index 0000000..0755968
--- /dev/null
+++ b/src/pages/TaskMonitorPage.tsx
@@ -0,0 +1,636 @@
+import React, { useState, useEffect, useMemo, useRef } from 'react';
+import {
+ Row, Col, Card, Typography, Space, Table, Tag, Progress, Badge,
+ List, Avatar, Button, Statistic, Timeline, Empty, message,
+ Select
+} from 'antd';
+import {
+ LayoutGrid, PlayCircle, CheckCircle, AlertCircle,
+ TrendingUp, Bell, PieChart, Activity, Video,
+ Clock, Map as MapIcon, Box, Zap, AlertTriangle,
+ X
+} from 'lucide-react';
+import {
+ EnvironmentOutlined,
+ VideoCameraOutlined,
+ SyncOutlined,
+ FullscreenOutlined,
+ RobotOutlined,
+ RocketOutlined,
+ WarningOutlined
+} from '@ant-design/icons';
+import { UniversalLineChart, UniversalPieChart } from '../components/recharts';
+import CesiumMap from '../components/Map';
+import { useSelector } from 'react-redux';
+import { RootState } from '../store';
+import { useTranslation } from 'react-i18next';
+import dayjs from 'dayjs';
+import { getRobotTaskList, getSiteDevice, getDeviceTastPool, getSiteDeviceTaskHistory } from '../api/device';
+import { getAlarmList, getAlarmStatistics } from '../api/alarmApi';
+import { alarmTypeMap } from '@/constants.js';
+import { useNavigate } from 'react-router-dom';
+import DeviceController from '../components/devices/DeviceController';
+import VideoPlayer from '../components/VideoPlayer';
+import { log } from 'console';
+
+const { Title, Text } = Typography;
+
+// 浅色主题卡片组件
+const MonitorCard: React.FC<{ title: string; icon: React.ReactNode; children: React.ReactNode; extra?: React.ReactNode; height?: number | string; bodyOverflow?: string }> = ({ title, icon, children, extra, height, bodyOverflow = 'auto' }) => (
+
+ {icon}
+ {title}
+
+ }
+ extra={extra}
+ variant="borderless"
+ style={{
+ background: '#fff',
+ boxShadow: '0 2px 12px rgba(0,0,0,0.04)',
+ borderRadius: 12,
+ marginBottom: 8,
+ height: height || 'auto',
+ display: 'flex',
+ flexDirection: 'column'
+ }}
+ styles={{
+ header: { borderBottom: '1px solid #f0f0f0', padding: '12px 20px', minHeight: 48 },
+ body: { padding: 16, flex: 1, overflow: bodyOverflow }
+ }}
+ >
+ {children}
+
+);
+
+const TaskMonitorPage: React.FC = () => {
+ const { t } = useTranslation();
+ const { stationId, currentStation } = useSelector((state: RootState) => state.station);
+ const navigate = useNavigate();
+ const { userInfo } = useSelector((state: RootState) => state.user);
+
+ const [loading, setLoading] = useState(false);
+ const [taskList, setTaskList] = useState([]);
+ const [alarmList, setAlarmList] = useState([]);
+ const [alarmStats, setAlarmStats] = useState
(null);
+ const [devices, setDevices] = useState([]);
+ const [taskListHis, setTaskHistoryLisy] = useState([]);
+ const [realtimeMap, setRealtimeMap] = useState({});
+ // 当前选中的车辆:列表高亮与地图信息浮窗共用此状态
+ const [selectedDeviceSerial, setSelectedDeviceSerial] = useState(null);
+ const [focusLocation, setFocusLocation] = useState(null);
+ const [messageApi, contextHolder] = message.useMessage();
+
+ const controllerRef = useRef(null);
+
+ // 初始化实时数据控制器
+ useEffect(() => {
+ if (!userInfo || !stationId) return;
+ const controller = new DeviceController(userInfo, messageApi, stationId);
+ controller.initMapPush((rtMap: any) => setRealtimeMap(rtMap || {}));
+ controllerRef.current = controller;
+ return () => {
+ controller.closeMapPush();
+ };
+ }, [userInfo, stationId]);
+
+ // 获取基础数据
+ const fetchData = async () => {
+ if (!stationId) return;
+ setLoading(true);
+ try {
+ const [taskRes, alarmRes, alarmStatRes, deviceRes, taskHistoreList] = await Promise.all([
+ getRobotTaskList({ siteId: String(stationId), pageNum: 1, pageSize: 999 }),
+ getAlarmList({ siteId: stationId, pageNum: 1, pageSize: 9999 }),
+ getAlarmStatistics({ siteId: stationId }),
+ getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: currentStation?.orgId }),
+ getSiteDeviceTaskHistory({
+ siteId: stationId,
+ orgId: currentStation?.orgId,
+ pageNum: 1,
+ pageSize: 99999999
+ })
+ ]);
+
+ if (taskRes.code === 200) setTaskList(taskRes.data || []);
+ if (alarmRes.code === 200) setAlarmList(alarmRes.rows || []);
+ if (alarmStatRes.code === 200) setAlarmStats(alarmStatRes.data || null);
+ if (deviceRes.code === 200) setDevices(deviceRes.rows || []);
+ if (taskHistoreList.code == 200) setTaskHistoryLisy(taskHistoreList.rows || []);
+ } catch (err) {
+ console.error('Fetch monitoring data failed', err);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ useEffect(() => {
+ fetchData();
+ //const timer = setInterval(fetchData, 60000); // 每分钟刷新一次
+ //return () => clearInterval(timer);
+ }, [stationId]);
+ const mapDevices = useMemo(() => {
+ const base = [...devices];
+ const knownKeys = new Set();
+ base.forEach((d: any) => {
+ const k = d?.serialNumber ?? d?.device_sn ?? d?.id;
+ if (k != null && k !== '') knownKeys.add(String(k));
+ });
+ const extras = (Array.isArray(realtimeMap) ? realtimeMap : [])
+ .filter((rt: any) =>
+ Number.isFinite(Number(rt.lng)) &&
+ Number.isFinite(Number(rt.lat)) &&
+ !(Number(rt.lng) === 0 && Number(rt.lat) === 0) &&
+ !knownKeys.has(String(rt.id))
+ )
+ .map((rt: any) => ({
+ id: rt.id,
+ name: rt.name || rt.alias || `设备-${String(rt.id).slice(-4)}`,
+ serialNumber: rt.id,
+ deviceType: 'ROBOT',
+ type: 'ROBOT',
+ category: 'robot',
+ typeText: '机器人',
+ status: rt.status,
+ onlineStatus: rt.status,
+ longitude: rt.lng,
+ latitude: rt.lat,
+ heading: rt.yaw,
+ batteryLevel: rt.battery,
+ updateTime: rt.updateTime,
+ feStatus: rt.feStatus,
+ taskId: rt.t,
+ isRealtimeOnly: true,
+ // 同步写入 locationMessage / lastRunningStatus,确保 Map.jsx 设备渲染 useEffect 能读到实时坐标
+ locationMessage: { longitude: rt.lng, latitude: rt.lat, heading: rt.yaw, batteryLevel: rt.battery },
+ lastRunningStatus: { longitude: rt.lng, latitude: rt.lat, heading: rt.yaw, batteryLevel: rt.battery },
+ raw: { ...rt },
+ }));
+ const all = [...base, ...extras];
+
+ return all.filter((d: any) =>
+ (d?.lastRunningStatus?.latitude && d?.lastRunningStatus?.longitude) ||
+ (d?.locationMessage?.latitude && d?.locationMessage?.longitude) ||
+ (d?.longitude && d?.latitude)
+ );
+ }, [devices, realtimeMap]);
+
+ // 计算统计数据
+ const taskSummary = useMemo(() => {
+ const todayTasks = taskList.filter(t => dayjs(t.createTime).isSame(dayjs(), 'day'));
+ return {
+ pending: todayTasks.filter(t => t.taskStaus === 'NEW').length,
+ running: todayTasks.filter(t => t.taskStaus === 'EXECUTING').length,
+ completed: todayTasks.filter(t => ['FINISH', 'FINISHED'].includes(t.taskStaus)).length,
+ failed: todayTasks.filter(t => t.taskStaus === 'FAILED').length,
+ total: todayTasks.length
+ };
+ }, [taskList]);
+
+ const deviceStats = useMemo(() => {
+ const total = devices.length;
+ const online = devices.filter(d => d.onlineStatus === 1).length;
+ // feStatus: 1=作业中, 2=空闲
+ const working = devices.filter(d => String(d.feStatus) === '1').length;
+ const idle = devices.filter(d => String(d.feStatus) === '2').length;
+ const alarm = alarmList.length;
+ return { total, online, working, idle, alarm };
+ }, [devices, realtimeMap, alarmList]);
+
+
+
+ const selectedDevice: any = useMemo(
+ () => devices.find((device: any) => device.serialNumber === selectedDeviceSerial) || null,
+ [devices, selectedDeviceSerial]
+ );
+ const selectedRealtime: any = selectedDevice ? (realtimeMap[selectedDevice.serialNumber] || {}) : {};
+
+ const trendData = useMemo(() => {
+ const countMap: Record = {};
+
+ (taskListHis ?? []).forEach((item: any) => {
+ const date = dayjs(item.createTime).format('YYYY-MM-DD');
+
+ if (item.taskStaus === 'FINISH') {
+ countMap[date] = (countMap[date] ?? 0) + 1;
+ } else {
+ countMap[date] ??= 0;
+ }
+ });
+
+ return Object.entries(countMap)
+ .map(([date, value]) => ({ date, value }))
+ .sort((a, b) => a.date.localeCompare(b.date));
+ }, [taskListHis]);
+
+
+ const pieData = useMemo(() => {
+ if (!alarmList?.length) return [];
+ const counter = {};
+ alarmList.forEach(a => {
+ const t = a.alarmType || 'OTHER_DEVICE_FAULT';
+ counter[t] = (counter[t] || 0) + 1;
+ });
+ const colorMap = { UAV_FAULT: '#ff4d4f', MOWER_FAULT: '#faad14', OTHER_DEVICE_FAULT: '#722ed1', SERVER_FAILURE: '#1890ff', SYSTEM_ERROR: '#8c8c8c' };
+ return Object.keys(counter).map(t => ({
+ name: alarmTypeMap[t] || t,
+ value: counter[t],
+ color: colorMap[t] || '#8c8c8c',
+ })).filter(d => d.value > 0);
+ }, [alarmList]);
+
+ const columnHeight = 'calc(100vh - 52px)';
+
+ return (
+
+ {contextHolder}
+
+
+
任务监控指挥中心
+
+
+
+ {/* 左侧面板 */}
+
+ } height="30%">
+
+ {[
+ { label: '待部署', value: taskSummary.pending, color: '#faad14', bg: '#fff7e6' },
+ { label: '进行中', value: taskSummary.running, color: '#1890ff', bg: '#e6f7ff' },
+ { label: '已完成', value: taskSummary.completed, color: '#52c41a', bg: '#f6ffed' },
+ { label: '故障', value: taskSummary.failed, color: '#ff4d4f', bg: '#fff1f0' }
+ ].map((item, index) => (
+
+
+
{item.value}
+
{item.label}
+
+
+ ))}
+
+
+ {taskList.slice(0, 2).map((task, idx) => (
+
+
+ {task.planName}
+ {Math.floor(Math.random() * 40 + 60)}%
+
+
+
+
+ {dayjs(task.createTime).format('HH:mm:ss')} 下发
+
+
+ ))}
+
+
+
+ } height="22%">
+
+ {trendData.length > 0 ? (
+
+
+
+
) : ()}
+
+
+
+ } extra={ a.handleStatus === 1).length} overflowCount={99} />} height="25%">
+ a.handleStatus === 1).slice(0, 3)}
+ renderItem={(item: any) => (
+
+
+
+
+
+ {item.alarmTitle}
+
+ {item.alarmLevel === 'ERROR' ? '紧急' : '重要'}
+
+
+
+ {item.deviceName} | {dayjs(item.alarmTime).format('HH:mm:ss')}
+
+
+
+
+ )}
+ locale={{ emptyText: }}
+ />
+
+
+ } height="30%" >
+ {pieData.length > 0 ? (
+
+
+ {/*
+ {pieData.map((item, idx) => (
+
+ {item.name}
+ {item.value}
+
+ ))}
+
*/}
+
) : ()}
+
+
+
+ {/* 中间面板 */}
+
+ {/* 顶部车辆统计栏 */}
+
+ {[
+ { label: '机器总数', value: deviceStats.total, online: deviceStats.online, offline: deviceStats.total - deviceStats.online, icon:
, bg: '#e6f7ff' },
+ { label: '在线总数', value: deviceStats.online, subLeft: { label: '空闲', value: deviceStats.idle, color: '#1890ff' }, subRight: { label: '工作中', value: deviceStats.working, color: '#52c41a' }, icon:
, bg: '#f6ffed' },
+ { label: '告警车辆', value: deviceStats.alarm, online: deviceStats.alarm, offline: 0, icon:
, bg: '#fff1f0' }
+ ].map((item, index) => (
+
+
+ {item.icon}
+
+
+
{item.label}
+
+ {item.value}
+
+ {item.subLeft ? (
+ <>
+ {item.subLeft.label}: {item.subLeft.value} |
+ {item.subRight.label}: {item.subRight.value}
+ >
+ ) : (
+ <>
+ 在线: {item.online} |
+ 离线: {item.offline}
+ >
+ )}
+
+
+
+
+ ))}
+
+
+ {/* 地图区域 */}
+
+
+
+ {/* 选中车辆的信息浮窗;不接管地图内部交互,只叠加展示详情 */}
+ {selectedDevice && (
+
+
+
+
:
} style={{ background: '#e6f7ff', color: '#0788ed', borderRadius: 10 }} />
+
{selectedDevice.deviceAlias || selectedDevice.deviceName || '车辆'}
{selectedDevice.serialNumber || '--'}
+
+
} onClick={() => setSelectedDeviceSerial(null)} />
+
+
+
当前状态{selectedRealtime.status === 'EXECUTING' ? '执行中' : '待命'}
+
剩余电量{selectedRealtime.battery ?? 85}%
+
当前任务{selectedRealtime.currentTaskName || '常规巡检'}
+
设备类型{selectedDevice.deviceTypeName || selectedDevice.deviceType || '车辆'}
+
任务进度{selectedRealtime.taskProgress ?? 0}%
+
+
+ )}
+
+ {/* 地图上的图例 */}
+
+ {[
+ { label: '巡逻车辆', color: '#1890ff' },
+ { label: '作业车辆', color: '#52c41a' },
+ { label: '异常告警', color: '#ff4d4f' }
+ ].map((item, index) => (
+
+ ))}
+
+
+
+
+
+
+ {/* 右侧面板 */}
+
+ } height="35%">
+ d.deviceType !== 'CAMERA')}
+ renderItem={(item: any) => {
+ const rt = realtimeMap[item.serialNumber] || {};
+
+ return (
+ {
+ setSelectedDeviceSerial(item.serialNumber);
+ const pos = item.lastRunningStatus || item.locationMessage || {};
+ const lon = Number(pos.longitude ?? pos.lng);
+ const lat = Number(pos.latitude ?? pos.lat);
+ if (Number.isFinite(lon) && Number.isFinite(lat)) {
+ setFocusLocation({ lon, lat, type: item.deviceType === 'UAV' ? 'drone' : 'robot', });
+ }
+ }}
+ aria-pressed={selectedDeviceSerial === item.serialNumber}
+ tabIndex={0}
+ onKeyDown={(event: any) => { if (event.key === 'Enter' || event.key === ' ') { setSelectedDeviceSerial(item.serialNumber); const pos = item.lastRunningStatus || item.locationMessage || {}; const lon = Number(pos.longitude ?? pos.lng); const lat = Number(pos.latitude ?? pos.lat); if (Number.isFinite(lon) && Number.isFinite(lat)) setFocusLocation({ lon, lat, type: item.deviceType === 'UAV' ? 'drone' : 'robot', height: 800 }); } }}
+ >
+
+
:
} style={{ background: '#f0f7ff', color: '#1890ff' }} />
+
+
+ {item.deviceAlias || item.deviceName}
+
+ {rt.status === 'EXECUTING' ? '进行中' : '待命'}
+
+
+
任务: {rt.currentTaskName || '常规巡检'}
+
+
+ {rt.battery ?? 85}%
+
+
+
+
+
+
+ );
+ }}
+ />
+
+
+ } extra={} height="35%">
+
+ d.deviceType === 'ROBOT' || d.deviceType === 'CLEANING')?.serialNumber}
+ idx={1}
+ className="w-full h-full object-cover"
+ />
+
+
+
+ {['前视', '后视', '左视', '右视'].map((v, i) => (
+
+ ))}
+
+
+
+ } height="30%">
+ {taskListHis.filter(t => ['FINISH', 'FINISHED'].includes(t.taskStaus)).length > 0 ? ( ({
+ color: '#52c41a',
+ children: (
+
+
+ {task.deviceAlias || task.deviceId}
+ {task.createTime}
+
+
{task.planName}
+
{task.taskStausTranslate}
+
+ )
+ }))}
+ />
+ ) : ()}
+
+
+
+
+
+
+ );
+};
+
+export default TaskMonitorPage;
diff --git a/src/router/routes.tsx b/src/router/routes.tsx
index 877b63b..aefa2c9 100644
--- a/src/router/routes.tsx
+++ b/src/router/routes.tsx
@@ -1,4 +1,4 @@
-import React, { lazy, Suspense } from 'react';
+import React, { lazy, Suspense } from 'react';
import type { RouteObject } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
@@ -32,6 +32,7 @@ const WayLineTask = lazy(() => import('../components/devices/WayLinePage'));
const RobotTask = lazy(() => import('../components/devices/RobotTaskPage'));
const MapEditorPage = lazy(() => import('../components/devices/MapEditorPage'));
const DevicesOverview = lazy(() => import('../components/devices/DeviceOverviewPage'));
+const TaskMonitorPage = lazy(() => import('../pages/TaskMonitorPage'));
const BasicSettings = lazy(() => import('../components/SystemSetting/BasicSettings'));
const UserRolePage = lazy(() => import('../components/SystemSetting/UserPage'));
@@ -113,6 +114,10 @@ export const routes: RouteObject[] = [
path: 'devices/overview',
element: withSuspense(DevicesOverview)
},
+ {
+ path: 'devices/taskMonitor',
+ element: withSuspense(TaskMonitorPage)
+ },
{
path: 'devices/status',
element: withSuspense(DeviceStatus)