diff --git a/src/components/SystemSetting/DeviceManagement.tsx b/src/components/SystemSetting/DeviceManagement.tsx
new file mode 100644
index 0000000..546a50b
--- /dev/null
+++ b/src/components/SystemSetting/DeviceManagement.tsx
@@ -0,0 +1,183 @@
+import React, { useState } from 'react';
+import {
+ Table,
+ Input,
+ Button,
+ Form,
+ Select,
+ Space,
+ Tag,
+ message,
+ Modal,
+ Tabs,
+} from 'antd';
+import {
+ SearchOutlined,
+ ReloadOutlined,
+ PlusOutlined,
+ EditOutlined,
+ DeleteOutlined,
+} from '@ant-design/icons';
+
+// 模拟数据
+const allDeviceList = [
+ { id: 1, code: 'CAM-01', name: '摄像头 CAM-01', type: 'CAMERA', online: 'ONLINE', status: 'NORMAL' },
+ { id: 2, code: 'CAM-02', name: '摄像头 CAM-02', type: 'CAMERA', online: 'OFFLINE', status: 'FAULT' },
+ { id: 3, code: 'CAM-03', name: '摄像头 CAM-03', type: 'CAMERA', online: 'ONLINE', status: 'NORMAL' },
+ { id: 4, code: 'CLEAN-01', name: '清洗机器人 CLEAN-01', type: 'CLEANING_DEVICE', online: 'ONLINE', status: 'IDLE' },
+ { id: 5, code: 'CMB-A01', name: '汇流箱 CMB-A01', type: 'COMBINER_BOX', online: 'ONLINE', status: 'WARNING' },
+ { id: 6, code: 'CMB-A02', name: '汇流箱 CMB-A02', type: 'COMBINER_BOX', online: 'ONLINE', status: 'NORMAL' },
+ { id: 7, code: 'INV-A01', name: '逆变器 INV-A01', type: 'INVERTER', online: 'ONLINE', status: 'NORMAL' },
+ { id: 8, code: 'INV-A02', name: '逆变器 INV-A02', type: 'INVERTER', online: 'ONLINE', status: 'WARNING' },
+ { id: 9, code: 'INV-B01', name: '逆变器 INV-B01', type: 'INVERTER', online: 'ONLINE', status: 'NORMAL' },
+ { id: 10, code: 'METER-01', name: '电表 METER-01', type: 'METER', online: 'ONLINE', status: 'NORMAL' },
+ { id: 11, code: 'ROBOT-01', name: '运维机器人 ROBOT-01', type: 'ROBOT', online: 'ONLINE', status: 'IDLE' },
+ { id: 12, code: 'DRONE-01', name: '无人机 DRONE-01', type: 'DRONE', online: 'OFFLINE', status: 'FAULT' },
+ { id: 13, code: 'WEATHER-01', name: '气象站 WEATHER-01', type: 'WEATHER_STATION', online: 'ONLINE', status: 'NORMAL' },
+];
+
+// Tab 配置
+const tabs = [
+ { key: 'all', label: '设备管理', filter: () => true },
+ { key: 'camera', label: '摄像头管理', filter: (item) => item.type === 'CAMERA' },
+ { key: 'smart', label: '智能装备', filter: (item) => ['CLEANING_DEVICE', 'ROBOT', 'DRONE'].includes(item.type) },
+];
+
+export default function DeviceManagementPage() {
+ const [activeTab, setActiveTab] = useState('all');
+ const [form] = Form.useForm();
+ const [loading, setLoading] = useState(false);
+ const [deviceList, setDeviceList] = useState(allDeviceList);
+
+ // 根据 Tab 过滤数据
+ const filteredByTab = deviceList.filter(tabs.find(t => t.key === activeTab).filter);
+
+ // 表格列定义
+ const columns = [
+ { title: '设备编码', dataIndex: 'code', key: 'code' },
+ { title: '设备名称', dataIndex: 'name', key: 'name' },
+ { title: '类型', dataIndex: 'type', key: 'type' },
+ {
+ title: '在线',
+ dataIndex: 'online',
+ key: 'online',
+ render: (text) => (
+
{text}
+ ),
+ },
+ {
+ title: '运行',
+ dataIndex: 'status',
+ key: 'status',
+ render: (text) => {
+ const colorMap = {
+ NORMAL: 'green',
+ FAULT: 'red',
+ WARNING: 'orange',
+ IDLE: 'blue',
+ };
+ return
{text};
+ },
+ },
+ {
+ title: '操作',
+ key: 'action',
+ render: (_, record) => (
+
+ } onClick={() => handleEdit(record)}>编辑
+ } onClick={() => handleDelete(record)}>删除
+
+ ),
+ },
+ ];
+
+ // 查询
+ const handleSearch = () => {
+ form.validateFields().then(values => {
+ const keyword = values.keyword?.toLowerCase() || '';
+ setLoading(true);
+ setTimeout(() => {
+ const filtered = allDeviceList.filter(item =>
+ item.name.toLowerCase().includes(keyword) || item.code.toLowerCase().includes(keyword)
+ );
+ setDeviceList(filtered);
+ setLoading(false);
+ }, 300);
+ });
+ };
+
+ // 重置
+ const handleReset = () => {
+ form.resetFields();
+ setDeviceList(allDeviceList);
+ };
+
+ // 新增
+ const handleAdd = () => {
+ message.info('打开新增设备弹窗');
+ };
+
+ // 编辑
+ const handleEdit = (record) => {
+ message.info(`编辑设备:${record.name}`);
+ };
+
+ // 删除
+ const handleDelete = (record) => {
+ Modal.confirm({
+ title: '确认删除',
+ content: `确定要删除设备 ${record.name} 吗?`,
+ onOk: () => {
+ message.success(`设备 ${record.name} 已删除`);
+ setDeviceList(prev => prev.filter(item => item.id !== record.id));
+ },
+ });
+ };
+
+ return (
+
+
+
+
+
+
+
+ {/* 筛选栏 */}
+
+
+
+
+
+ } onClick={handleSearch}>查询
+
+
+ } onClick={handleReset}>重置
+
+
+ } onClick={handleAdd}>新增
+
+
+
+
+ {/* 表格 */}
+
`共 ${total} 条`,
+ }}
+ />
+
+ );
+}
diff --git a/src/pages/ReportCenter.tsx b/src/pages/ReportCenter.tsx
index fc45678..68bd6d3 100644
--- a/src/pages/ReportCenter.tsx
+++ b/src/pages/ReportCenter.tsx
@@ -129,10 +129,10 @@ export default function ReportCenterPage() {
value={overviewData.powerToday}
precision={1}
suffix="kWh"
- valueStyle={{ color: '#52c41a', fontSize: 28, fontWeight: 700 }}
+ valueStyle={{ color: '#52c41a', fontSize: 24, fontWeight: 700 }}
prefix={}
/>
- 遥测与 latest 聚合
+ 遥测与 latest 聚合
@@ -150,10 +150,10 @@ export default function ReportCenterPage() {
value={overviewData.currentPower}
precision={1}
suffix="kW"
- valueStyle={{ color: '#1890ff', fontSize: 28, fontWeight: 700 }}
+ valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 700 }}
prefix={}
/>
- 实时功率汇总
+ 实时功率汇总
@@ -170,10 +170,10 @@ export default function ReportCenterPage() {
title="当前告警"
value={overviewData.currentAlarm}
suffix="条"
- valueStyle={{ color: '#ff4d4f', fontSize: 28, fontWeight: 700 }}
+ valueStyle={{ color: '#ff4d4f', fontSize: 24, fontWeight: 700 }}
prefix={}
/>
- 累计 5 条
+ 累计 5 条
@@ -190,10 +190,10 @@ export default function ReportCenterPage() {
title="处理中工单"
value={overviewData.processingOrder}
suffix="单"
- valueStyle={{ color: '#faad14', fontSize: 28, fontWeight: 700 }}
+ valueStyle={{ color: '#faad14', fontSize: 24, fontWeight: 700 }}
prefix={}
/>
- 全部 3 单
+ 全部 3 单
@@ -211,10 +211,10 @@ export default function ReportCenterPage() {
value={overviewData.deviceOnlineRate}
precision={1}
suffix="%"
- valueStyle={{ color: '#52c41a', fontSize: 28, fontWeight: 700 }}
+ valueStyle={{ color: '#52c41a', fontSize: 24, fontWeight: 700 }}
prefix={}
/>
- 来自设备主数据
+ 来自设备主数据
@@ -231,10 +231,10 @@ export default function ReportCenterPage() {
title="已生成报表"
value={overviewData.generatedReport}
suffix="份"
- valueStyle={{ color: '#722ed1', fontSize: 28, fontWeight: 700 }}
+ valueStyle={{ color: '#722ed1', fontSize: 24, fontWeight: 700 }}
prefix={}
/>
- SUCCESS 文件记录
+ SUCCESS 文件记录
diff --git a/src/pages/SystemSetting.tsx b/src/pages/SystemSetting.tsx
index 9f35e2c..bd8aee9 100644
--- a/src/pages/SystemSetting.tsx
+++ b/src/pages/SystemSetting.tsx
@@ -18,6 +18,8 @@ import StationManage from '../components/SystemSetting/StationManage';
import { getMenuList } from '../api/mune';
import DeviceAccessPage from '../components/SystemSetting/DeviceAccessPage';
import OnlineUserPage from '../components/SystemSetting/OnlineUser';
+import DeviceManagementPage from '../components/SystemSetting/DeviceManagement';
+import BasicSettings from '../components/SystemSetting/BasicSettings';
const { Header, Content } = Layout;
const { Text } = Typography;
@@ -25,56 +27,7 @@ const { Option } = Select;
const AntdCard = Card as any;
// 基础设置
-const BasicSettings = () => {
- const [form] = Form.useForm();
- const handleSave = () => { message.success('设置已保存'); };
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 管理员 },
- { title: '手机号', dataIndex: 'phone' },
- { title: '邮箱', dataIndex: 'email' },
- { title: '状态', render: () => ● 在线 },
- ]} dataSource={[
- { name: '张运维', phone: '138****0001', email: 'zhangyw@pvsrmart.com' },
- { name: '李工程师', phone: '139****0002', email: 'li.gongcheng@pvsrmart.com' },
- ]} />
-
-
- );
-};
// 右侧面板
const RightPanel = () => (
@@ -160,6 +113,9 @@ export default function SystemSettings() {
if (item.path === '/systemSetting/monitor') {
return { key: 'monitor', label: '系统监控', icon: };
}
+ if (item.path === '/systemSetting/devices') {
+ return { key: 'devices', label: '设备管理', icon: };
+ }
return null;
}).filter(Boolean);
@@ -172,7 +128,6 @@ export default function SystemSettings() {
}
});
}, []);
- const BasicSettingsPage = () => 基础设置页面
;
const NoticePage = () => 通知策略页面
;
const DataSafetyPage = () => 数据与安全页面
;
const SystemMaintenancePage = () => 系统维护页面
;
@@ -180,7 +135,7 @@ export default function SystemSettings() {
const renderTabContent = () => {
switch (activeTab) {
case 'basic':
- return ;
+ return ;
case 'user-role':
return ;
case 'menu':
@@ -199,6 +154,8 @@ export default function SystemSettings() {
return ;
case 'monitor':
return ;
+ case 'devices':
+ return ;
default:
return ;
}