import React, { useState } from 'react';
import {
Layout, Menu, Card, Row, Col, Button, Form, Input, Select, Switch, Tag, Space, Typography, Statistic, message, Table, Divider
} from 'antd';
import {
SettingOutlined, UserOutlined, BellOutlined, LinkOutlined, SafetyOutlined, SyncOutlined,
CloudOutlined, TeamOutlined, FileTextOutlined, DatabaseOutlined, CalendarOutlined,
CheckCircleOutlined, CloseCircleOutlined, ReloadOutlined, DownloadOutlined, DeleteOutlined,
KeyOutlined,
AppstoreOutlined,
BankOutlined
} from '@ant-design/icons';
import UserRolePage from './UserPage';
import MenuList from './MenuList';
import Organization from './Organization';
import StationManage from './StationManage';
const { Header, Content } = Layout;
const { Title, Text } = Typography;
const { Option } = Select;
const AntdCard = Card as any;
// 子页面组件,你可以替换成自己的
const BasicSettings = () => {
const [form] = Form.useForm();
const handleSave = () => {
message.success('设置已保存');
};
return (
{/* 顶部概览卡片 */}
{/* 基础配置 */}
{/* 通知与告警策略 */}
{/* 用户与权限预览 */}
{t} },
{ title: '手机号', dataIndex: 'phone' },
{ title: '邮箱', dataIndex: 'email' },
{ title: '状态', dataIndex: 'status', render: () => ● 在线 },
{ title: '操作', render: () => }
]}
dataSource={[
{ name: '张运维', role: '超级管理员', phone: '138****0001', email: 'zhangyw@pvsrmart.com' },
{ name: '李工程师', role: '运维工程师', phone: '139****0002', email: 'li.gongcheng@pvsrmart.com' },
{ name: '王班长', role: '巡检主管', phone: '137****0003', email: 'wang.banzhang@pvsrmart.com' },
{ name: '赵分析师', role: '数据分析师', phone: '136****0004', email: 'zhao.fx@pvsrmart.com' },
]}
/>
);
};
// 右侧面板组件
const RightPanel = () => {
return (
{/* 角色权限概览 */}
用户2人 | 权限28项
全部权限
系统管理
用户5人 | 权限18项
设备管理
工单管理
用户8人 | 权限12项
巡检管理
告警处理
用户3人 | 权限15项
数据分析
报表查看
{/* 设备接入状态 */}
查看详情 }>
逆变器
5 / 5 ● 正常
汇流箱
20 / 20 ● 正常
气象站
1 / 1 ● 正常
摄像头
12 / 12 ● 正常
无人机
2 / 2 ● 正常
机器人
5 / 5 ● 正常
API接口
正常 ● 正常
Modbus
正常 ● 正常
{/* 这里可以放拓扑图,先用占位 */}
{/* 数据与安全 */}
数据保留
3年
每日自动备份
02:00
最近备份时间
2025-05-24 02:00
登录审计
已开启
API密钥管理
正常
SSL证书
有效期至 2026-12-31
双因素认证
已开启
{/* 系统维护 */}
操作需管理员权限}>
}>清理缓存
}>重启服务
}>备份下载
}>日志导出
);
};
// 主页面组件
export default function SystemSettings() {
const [activeTab, setActiveTab] = useState('basic');
const tabItems = [
{ key: 'basic', label: '基础设置', icon: },
{ key: 'user-role', label: '用户与角色', icon: },
{ key: 'menu', label: '菜单管理', icon: },
{ key: 'org', label: '组织管理', icon: }, //
{ key: 'station', label: '场站管理', icon: },
{ key: 'notification', label: '通知策略', icon: },
{ key: 'device', label: '设备接入', icon: },
{ key: 'security', label: '数据与安全', icon: },
{ key: 'maintenance', label: '系统维护', icon: },
];
const renderTabContent = () => {
switch (activeTab) {
case 'basic':
return (
);
case 'user-role':
return ;
case 'menu':
return ; // 菜单管理
case 'org':
return ; // 组织管理
case 'station':
return ; // 场站管理
case 'notification':
return 通知策略页面
;
case 'device':
return 设备接入页面
;
case 'security':
return 数据与安全页面
;
case 'maintenance':
return 系统维护页面
;
default:
return null;
}
};
return (
{/* 固定在当前组件内部顶部,不随滚动 */}
{/* 内容区域可滚动 */}
{renderTabContent()}
);
}