根据二级路由 优化控制状态界面
This commit is contained in:
@@ -53,7 +53,7 @@ const logs = [
|
|||||||
{ time: '10:05:22', device: 'RBT-01', type: '事件', desc: '电量较低,建议回充', level: '低电量' },
|
{ time: '10:05:22', device: 'RBT-01', type: '事件', desc: '电量较低,建议回充', level: '低电量' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function DeviceOverviewPage({ onViewStatus, selectedSn, onDeviceSelect }) {
|
export default function DeviceOverviewPage() {
|
||||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||||
const { stationId } = useSelector((state: RootState) => state.station);
|
const { stationId } = useSelector((state: RootState) => state.station);
|
||||||
|
|
||||||
@@ -68,6 +68,7 @@ export default function DeviceOverviewPage({ onViewStatus, selectedSn, onDeviceS
|
|||||||
const [devicesAll, setDevicesAll] = useState([]);
|
const [devicesAll, setDevicesAll] = useState([]);
|
||||||
const [taskStats, setTaskStats] = useState({ completed: 12, total: 15 });
|
const [taskStats, setTaskStats] = useState({ completed: 12, total: 15 });
|
||||||
const [deviceStatistics, setDeviceStatistics] = useState(null);
|
const [deviceStatistics, setDeviceStatistics] = useState(null);
|
||||||
|
const [currentSelectedRobot, setCurrentSelectedRobot] = useState(null);
|
||||||
|
|
||||||
// 编辑机器人弹窗相关
|
// 编辑机器人弹窗相关
|
||||||
const [editRobotModalOpen, setEditRobotModalOpen] = useState(false);
|
const [editRobotModalOpen, setEditRobotModalOpen] = useState(false);
|
||||||
@@ -115,6 +116,7 @@ export default function DeviceOverviewPage({ onViewStatus, selectedSn, onDeviceS
|
|||||||
console.error('数据请求失败', err);
|
console.error('数据请求失败', err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const onViewStatus = (sn) => { }
|
||||||
|
|
||||||
|
|
||||||
// 打开编辑弹窗
|
// 打开编辑弹窗
|
||||||
@@ -233,9 +235,9 @@ export default function DeviceOverviewPage({ onViewStatus, selectedSn, onDeviceS
|
|||||||
|
|
||||||
// 当前选中设备(切换时才变)
|
// 当前选中设备(切换时才变)
|
||||||
const selectedDevice = useMemo(() => {
|
const selectedDevice = useMemo(() => {
|
||||||
const sn = selectedSn || (devicesAll?.[0]?.device_sn || devicesAll?.[0]?.serialNumber);
|
const sn = currentSelectedRobot || (devicesAll?.[0]?.device_sn || devicesAll?.[0]?.serialNumber);
|
||||||
return devicesAll?.find(item => (item.device_sn || item.serialNumber) === sn) || null;
|
return devicesAll?.find(item => (item.device_sn || item.serialNumber) === sn) || null;
|
||||||
}, [devicesAll, selectedSn]);
|
}, [devicesAll, currentSelectedRobot]);
|
||||||
|
|
||||||
const isUAV = !!selectedDevice?.gateway_sn;
|
const isUAV = !!selectedDevice?.gateway_sn;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -510,7 +512,7 @@ export default function DeviceOverviewPage({ onViewStatus, selectedSn, onDeviceS
|
|||||||
const getVal = (val) => val == "no_rain" ? "无" : (val || '-');
|
const getVal = (val) => val == "no_rain" ? "无" : (val || '-');
|
||||||
|
|
||||||
const handleDeviceChange = (id) => {
|
const handleDeviceChange = (id) => {
|
||||||
if (onDeviceSelect) onDeviceSelect(id);
|
setCurrentSelectedRobot(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取无人机状态
|
// 获取无人机状态
|
||||||
@@ -646,18 +648,19 @@ export default function DeviceOverviewPage({ onViewStatus, selectedSn, onDeviceS
|
|||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
width: 80,
|
width: 120,
|
||||||
//fixed: 'right',
|
//fixed: 'right',
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space size={4}>
|
<Space size={4}>
|
||||||
{/* 编辑按钮绑定弹窗 */}
|
|
||||||
<Button
|
<Button
|
||||||
size="small"
|
size="small"
|
||||||
type="text"
|
type="text"
|
||||||
icon={<EditOutlined />}
|
icon={<EditOutlined />}
|
||||||
onClick={() => openEditRobotModal(record)}
|
onClick={() => openEditRobotModal(record)}
|
||||||
|
title="编辑"
|
||||||
/>
|
/>
|
||||||
<Button size="small" type="text" icon={<SettingOutlined />} />
|
<Button size="small" type="text" icon={<SettingOutlined />} title="设置" />
|
||||||
</Space>
|
</Space>
|
||||||
)
|
)
|
||||||
}]}
|
}]}
|
||||||
@@ -718,7 +721,7 @@ export default function DeviceOverviewPage({ onViewStatus, selectedSn, onDeviceS
|
|||||||
<Button
|
<Button
|
||||||
type="primary" size="small" ghost icon={<InfoCircleOutlined />}
|
type="primary" size="small" ghost icon={<InfoCircleOutlined />}
|
||||||
style={{ borderRadius: 4, fontSize: 11, marginLeft: 'auto' }}
|
style={{ borderRadius: 4, fontSize: 11, marginLeft: 'auto' }}
|
||||||
onClick={() => onViewStatus && onViewStatus(selectedDevice.device_sn || selectedDevice.serialNumber)}
|
onClick={() => onViewStatus(selectedDevice.device_sn || selectedDevice.serialNumber)}
|
||||||
>详情</Button>
|
>详情</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -63,10 +63,7 @@ const { RangePicker } = DatePicker;
|
|||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
|
|
||||||
export default function DeviceStatusPage({
|
export default function DeviceStatusPage() {
|
||||||
serialNumber,
|
|
||||||
onDeviceChange,
|
|
||||||
}) {
|
|
||||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||||
const { stationId } = useSelector((state: RootState) => state.station);
|
const { stationId } = useSelector((state: RootState) => state.station);
|
||||||
const [persistentDroneData, setPersistentDroneData] = useState(null); // 持久化无人机数据
|
const [persistentDroneData, setPersistentDroneData] = useState(null); // 持久化无人机数据
|
||||||
@@ -175,24 +172,44 @@ export default function DeviceStatusPage({
|
|||||||
fetchAllData();
|
fetchAllData();
|
||||||
}, [userInfo, stationId]);
|
}, [userInfo, stationId]);
|
||||||
|
|
||||||
|
// 当前选中的设备SN
|
||||||
|
const [selectedSn, setSelectedSn] = useState('');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 当设备列表加载后,如果没有选中的设备,默认选中第一个
|
||||||
|
useEffect(() => {
|
||||||
|
if (devicesAll?.length > 0) {
|
||||||
|
const firstDevice = devicesAll[0];
|
||||||
|
setSelectedSn(firstDevice.device_sn || firstDevice.serialNumber);
|
||||||
|
}
|
||||||
|
}, [devicesAll]);
|
||||||
|
|
||||||
// 获取当前选中的无人机设备
|
// 获取当前选中的无人机设备
|
||||||
const device = useMemo(() => {
|
const device = useMemo(() => {
|
||||||
const sn =
|
const sn = selectedSn;
|
||||||
serialNumber ||
|
|
||||||
devicesAll?.[0]?.device_sn ||
|
|
||||||
devicesAll?.[0]?.serialNumber;
|
|
||||||
|
|
||||||
if (!sn) return null;
|
if (!sn) return null;
|
||||||
|
|
||||||
return devicesAll?.find(
|
return devicesAll?.find(
|
||||||
(d) => (d.device_sn || d.serialNumber) === sn,
|
(d) => (d.device_sn || d.serialNumber) == sn,
|
||||||
);
|
);
|
||||||
}, [devicesAll, serialNumber]);
|
}, [devicesAll, selectedSn]);
|
||||||
|
|
||||||
const isUAV = useMemo(() => {
|
const isUAV = useMemo(() => {
|
||||||
return !!device?.device_sn;
|
// 设备有 drone_callsign 或 gateway_sn 则是无人机
|
||||||
|
return !!(device?.drone_callsign || device?.gateway_sn);
|
||||||
}, [device]);
|
}, [device]);
|
||||||
|
|
||||||
|
// 设备选择变化时,调用回调并更新内部状态
|
||||||
|
const handleDeviceSelectChange = (val) => {
|
||||||
|
setSelectedSn(val);
|
||||||
|
// 切换设备时清空之前的标记点等
|
||||||
|
setMarkedPoints([]);
|
||||||
|
setCompleteFlag(false);
|
||||||
|
setSavePath(null);
|
||||||
|
};
|
||||||
|
|
||||||
// 当MQTT数据更新时,更新持久化数据(只在有新数据时更新)
|
// 当MQTT数据更新时,更新持久化数据(只在有新数据时更新)
|
||||||
const handleMqttMessage = (topic, message) => {
|
const handleMqttMessage = (topic, message) => {
|
||||||
|
|
||||||
@@ -357,8 +374,8 @@ export default function DeviceStatusPage({
|
|||||||
}, [device, wsDeviceInfo, isUAV]);
|
}, [device, wsDeviceInfo, isUAV]);
|
||||||
|
|
||||||
const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
||||||
!isUAV ? serialNumber : '',
|
!isUAV ? device?.serialNumber : '',
|
||||||
`webrtc://1.95.137.212/live/livestream/${serialNumber}`,
|
`webrtc://1.95.137.212/live/livestream/${device?.serialNumber}`,
|
||||||
);
|
);
|
||||||
const getVal = (val) => val === "no_rain" ? "无" : (val || '-');
|
const getVal = (val) => val === "no_rain" ? "无" : (val || '-');
|
||||||
|
|
||||||
@@ -850,40 +867,47 @@ export default function DeviceStatusPage({
|
|||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
gap: 12,
|
gap: 12,
|
||||||
|
flexWrap: 'wrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text strong>选择设备:</Text>
|
<Text strong>选择设备:</Text>
|
||||||
|
|
||||||
<Select
|
<Select
|
||||||
style={{ width: 380 }}
|
style={{ width: 380, minWidth: 280 }}
|
||||||
value={device?.device_sn || device?.serialNumber}
|
value={selectedSn}
|
||||||
onChange={(val) => onDeviceChange?.(val)}
|
onChange={handleDeviceSelectChange}
|
||||||
showSearch
|
showSearch
|
||||||
optionFilterProp="label"
|
optionFilterProp="label"
|
||||||
|
placeholder="请选择设备"
|
||||||
|
allowClear={false}
|
||||||
|
loading={devicesAll.length === 0}
|
||||||
options={[
|
options={[
|
||||||
{
|
{
|
||||||
label: <span>机器人</span>,
|
label: '机器人',
|
||||||
title: 'manager',
|
title: 'robot',
|
||||||
options: devicesAll.filter(item => item.serialNumber).map(item => ({
|
options: devicesAll.filter(item => !item.gateway_sn && !item.drone_callsign && item.serialNumber).map(item => ({
|
||||||
value: item.device_sn || item.serialNumber,
|
value: item.device_sn || item.serialNumber,
|
||||||
label: item.deviceAlias || item.deviceName || '未知设备'
|
label: `${item.deviceAlias || item.deviceName || '未知设备'} `,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: <span>无人机</span>,
|
label: '无人机',
|
||||||
title: 'engineer',
|
title: 'uav',
|
||||||
options: devicesAll.filter(item => item.gateway_sn).map(item => ({
|
options: devicesAll.filter(item => item.gateway_sn || item.drone_callsign).map(item => ({
|
||||||
value: item.device_sn,
|
value: item.device_sn,
|
||||||
label: item.drone_callsign || item.callsign || '未知设备'
|
label: `${item.drone_callsign || item.callsign || '未知无人机'}`,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
]}
|
].filter(group => group.options.length > 0)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Tag color="blue">
|
<Tag color={isUAV ? 'cyan' : 'blue'}>
|
||||||
{isUAV ? '无人机' : '机器人'}
|
{isUAV ? '无人机' : '机器人'}
|
||||||
</Tag>
|
</Tag>
|
||||||
|
|
||||||
|
<Tag color={device?.onlineStatus == 1 ? 'green' : 'default'}>
|
||||||
|
{device?.onlineStatus === 1 ? '在线' : '离线'}
|
||||||
|
</Tag>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1085,7 +1109,7 @@ export default function DeviceStatusPage({
|
|||||||
{robotVideo ? (
|
{robotVideo ? (
|
||||||
mowerView === 'all' ? (
|
mowerView === 'all' ? (
|
||||||
<MowerAllView
|
<MowerAllView
|
||||||
serialNumber={serialNumber}
|
serialNumber={device?.serialNumber}
|
||||||
robotVideo={robotVideo}
|
robotVideo={robotVideo}
|
||||||
error={error}
|
error={error}
|
||||||
ready={ready}
|
ready={ready}
|
||||||
@@ -1093,7 +1117,7 @@ export default function DeviceStatusPage({
|
|||||||
) : (
|
) : (
|
||||||
<div style={{ position: 'relative', width: '100%', height: '100%' }}>
|
<div style={{ position: 'relative', width: '100%', height: '100%' }}>
|
||||||
<VideoPlayer
|
<VideoPlayer
|
||||||
deviceId={serialNumber}
|
deviceId={device?.serialNumber}
|
||||||
idx={
|
idx={
|
||||||
mowerView === 'front' ? 1
|
mowerView === 'front' ? 1
|
||||||
: mowerView === 'back' ? 2
|
: mowerView === 'back' ? 2
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Layout, Typography, Menu } from 'antd';
|
import { Layout, Typography, Menu, Sider } from 'antd';
|
||||||
import { AimOutlined, AppstoreOutlined, SettingOutlined, BranchesOutlined } from '@ant-design/icons';
|
import { AimOutlined, AppstoreOutlined, SettingOutlined, BranchesOutlined } from '@ant-design/icons';
|
||||||
import DeviceOverviewPage from '../components/devices/DeviceOverviewPage';
|
import DeviceOverviewPage from '../components/devices/DeviceOverviewPage';
|
||||||
import DeviceStatusPage from '../components/devices/DeviceStatusPage';
|
import DeviceStatusPage from '../components/devices/DeviceStatusPage';
|
||||||
@@ -9,7 +9,7 @@ import { RootState } from '../store';
|
|||||||
import WayLinePage from '../components/devices/WayLinePage';
|
import WayLinePage from '../components/devices/WayLinePage';
|
||||||
import RobotTaskPage from '../components/devices/RobotTaskPage';
|
import RobotTaskPage from '../components/devices/RobotTaskPage';
|
||||||
|
|
||||||
const { Header, Content } = Layout;
|
const { Content } = Layout;
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
|
|
||||||
|
|
||||||
@@ -17,59 +17,33 @@ export default function DeviceIndexPage() {
|
|||||||
const [activeTab, setActiveTab] = useState('overview');
|
const [activeTab, setActiveTab] = useState('overview');
|
||||||
const [selectedSn, setSelectedSn] = useState(null);
|
const [selectedSn, setSelectedSn] = useState(null);
|
||||||
const { stationId } = useSelector((state: RootState) => state.station);
|
const { stationId } = useSelector((state: RootState) => state.station);
|
||||||
const [devices, setDevices] = useState([]);
|
|
||||||
const [planedevices, setPlaneDevices] = useState([]);
|
|
||||||
const [devicesAll, setDevicesAll] = useState([]);
|
const [devicesAll, setDevicesAll] = useState([]);
|
||||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||||
|
|
||||||
|
|
||||||
|
const menuItems = [
|
||||||
|
{ key: 'overview', label: '装备总览', icon: <AppstoreOutlined /> },
|
||||||
|
{ key: 'status', label: '设备状态', icon: <SettingOutlined /> },
|
||||||
|
{ key: 'wayLineTask', label: '航线任务', icon: <AimOutlined /> },
|
||||||
|
{ key: 'robotTask', label: '机器人任务', icon: <BranchesOutlined /> },
|
||||||
|
];
|
||||||
|
|
||||||
// 获取设备列表(用于默认选择第一个)
|
|
||||||
const fetchAllData = async () => {
|
|
||||||
if (!stationId) return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const [deviceRes, planeRes] = await Promise.all([
|
|
||||||
getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: userInfo.orgId }),
|
|
||||||
getSiteUAVList(stationId),
|
|
||||||
]);
|
|
||||||
|
|
||||||
const devData = deviceRes?.code === 200 ? (deviceRes.rows || []) : [];
|
|
||||||
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 || '无人机',
|
|
||||||
}));
|
|
||||||
|
|
||||||
setDevices(devData);
|
|
||||||
setPlaneDevices(planeData);
|
|
||||||
const all = [...devData, ...planeData];
|
|
||||||
setDevicesAll(all);
|
|
||||||
|
|
||||||
// 默认选中第一个设备
|
|
||||||
if (!selectedSn && all.length > 0) {
|
|
||||||
setSelectedSn(all[0].device_sn || all[0].serialNumber);
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('数据请求失败', err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchAllData();
|
|
||||||
}, [stationId]);
|
|
||||||
|
|
||||||
const handleViewStatus = (sn) => {
|
const handleViewStatus = (sn) => {
|
||||||
setSelectedSn(sn);
|
setSelectedSn(sn);
|
||||||
setActiveTab('status');
|
setActiveTab('status');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 切换菜单时,如果是航线任务或机器人任务,确保选择的是第一个设备
|
||||||
|
const handleMenuClick = ({ key }) => {
|
||||||
|
setActiveTab(key);
|
||||||
|
console.log('切换到', key, '当前选中设备SN', selectedSn);
|
||||||
|
// 如果没有选择设备,自动选择第一个
|
||||||
|
if ((key === 'wayLineTask' || key === 'robotTask') && devicesAll.length > 0) {
|
||||||
|
setSelectedSn(devicesAll[0].device_sn || devicesAll[0].serialNumber);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const renderContent = () => {
|
const renderContent = () => {
|
||||||
if (activeTab === 'overview') {
|
if (activeTab === 'overview') {
|
||||||
@@ -79,24 +53,58 @@ export default function DeviceIndexPage() {
|
|||||||
onDeviceSelect={(sn) => setSelectedSn(sn)}
|
onDeviceSelect={(sn) => setSelectedSn(sn)}
|
||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
|
if (activeTab === 'status') {
|
||||||
|
return <DeviceStatusPage
|
||||||
|
serialNumber={selectedSn}
|
||||||
|
onDeviceChange={(sn) => setSelectedSn(sn)}
|
||||||
|
/>;
|
||||||
|
}
|
||||||
|
if (activeTab === 'wayLineTask') return <WayLinePage />;
|
||||||
|
if (activeTab === 'robotTask') return <RobotTaskPage />;
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout style={{ minHeight: '100vh', overflow: 'hidden', scrollbarWidth: "thin", scrollbarColor: '#ccc transparent' }}>
|
<Layout style={{ minHeight: '100vh', overflow: 'hidden', scrollbarWidth: "thin", scrollbarColor: '#ccc transparent' }}>
|
||||||
|
<div style={{ padding: '12px 16px 8px', borderBottom: '1px solid #f0f0f0', background: '#fff' }}>
|
||||||
|
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(14px, 1.2vw, 18px)' }}>装备控制</Typography.Title>
|
||||||
|
</div>
|
||||||
|
<Layout>
|
||||||
|
<Sider
|
||||||
|
width={180}
|
||||||
|
style={{
|
||||||
|
background: '#fff',
|
||||||
|
borderRight: '1px solid #f0f0f0',
|
||||||
|
overflow: 'auto',
|
||||||
|
height: 'calc(100vh - 52px)',
|
||||||
|
left: 0,
|
||||||
|
top: 0,
|
||||||
|
bottom: 0,
|
||||||
|
}}
|
||||||
|
theme="light"
|
||||||
|
>
|
||||||
|
<Menu
|
||||||
|
mode="inline"
|
||||||
|
selectedKeys={[activeTab]}
|
||||||
|
onClick={handleMenuClick}
|
||||||
|
items={menuItems}
|
||||||
|
style={{
|
||||||
|
border: '0',
|
||||||
|
paddingTop: 8,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Sider>
|
||||||
|
|
||||||
|
<Content style={{
|
||||||
<Content style={{
|
maxHeight: 'calc(100vh - 52px)',
|
||||||
maxHeight: 'calc(100vh - 40px)',
|
overflowY: 'auto',
|
||||||
overflowY: 'auto',
|
background: '#f5f7fa',
|
||||||
background: '#f5f7fa',
|
padding: '8px 12px',
|
||||||
padding: '8px 0px',
|
scrollbarWidth: "thin"
|
||||||
scrollbarWidth: "thin"
|
}}>
|
||||||
}}>
|
{renderContent()}
|
||||||
{renderContent()}
|
</Content>
|
||||||
</Content>
|
</Layout>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const ProtectedRoute = lazy(() => import('../components/ProtectedRoute'));
|
|||||||
const Login = lazy(() => import('../pages/Login'));
|
const Login = lazy(() => import('../pages/Login'));
|
||||||
|
|
||||||
const Home = lazy(() => import('../pages/Home'));
|
const Home = lazy(() => import('../pages/Home'));
|
||||||
const Devices = lazy(() => import('../pages/Devices'));
|
|
||||||
const Video = lazy(() => import('../pages/Video'));
|
const Video = lazy(() => import('../pages/Video'));
|
||||||
const Alerts = lazy(() => import('../pages/Alerts'));
|
const Alerts = lazy(() => import('../pages/Alerts'));
|
||||||
const Downloads = lazy(() => import('../pages/Downloads'));
|
const Downloads = lazy(() => import('../pages/Downloads'));
|
||||||
@@ -32,6 +32,7 @@ const Profile = lazy(() => import('../pages/Profile'));
|
|||||||
const DeviceStatus = lazy(() => import('../components/devices/DeviceStatusPage'));
|
const DeviceStatus = lazy(() => import('../components/devices/DeviceStatusPage'));
|
||||||
const WayLineTask = lazy(() => import('../components/devices/WayLinePage'));
|
const WayLineTask = lazy(() => import('../components/devices/WayLinePage'));
|
||||||
const RobotTask = lazy(() => import('../components/devices/RobotTaskPage'));
|
const RobotTask = lazy(() => import('../components/devices/RobotTaskPage'));
|
||||||
|
const DevicesOverview = lazy(() => import('../components/devices/DeviceOverviewPage'));
|
||||||
|
|
||||||
|
|
||||||
const BasicSettings = lazy(() => import('../components/SystemSetting/BasicSettings'));
|
const BasicSettings = lazy(() => import('../components/SystemSetting/BasicSettings'));
|
||||||
@@ -123,7 +124,7 @@ const routes: RouteObject[] = [
|
|||||||
path: 'devices/overview',
|
path: 'devices/overview',
|
||||||
element: (
|
element: (
|
||||||
<Suspense fallback={<PageFallback />}>
|
<Suspense fallback={<PageFallback />}>
|
||||||
<Devices />
|
<DevicesOverview />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user