2026-05-08 15:53:27 +08:00
|
|
|
import React, { useState } from 'react';
|
|
|
|
|
import {
|
|
|
|
|
Form,
|
|
|
|
|
Input,
|
|
|
|
|
Select,
|
|
|
|
|
Switch,
|
|
|
|
|
Button,
|
|
|
|
|
Row,
|
|
|
|
|
Col,
|
|
|
|
|
Card as AntdCard,
|
|
|
|
|
Tag,
|
|
|
|
|
Table,
|
|
|
|
|
message,
|
|
|
|
|
Typography,
|
|
|
|
|
Space,
|
2026-05-14 12:44:18 +08:00
|
|
|
TimePicker,
|
|
|
|
|
Divider,
|
2026-05-08 15:53:27 +08:00
|
|
|
} from 'antd';
|
|
|
|
|
import {
|
|
|
|
|
CloudOutlined,
|
|
|
|
|
TeamOutlined,
|
|
|
|
|
BellOutlined,
|
|
|
|
|
DatabaseOutlined,
|
|
|
|
|
CalendarOutlined,
|
|
|
|
|
CheckCircleOutlined,
|
|
|
|
|
DownloadOutlined,
|
|
|
|
|
FileTextOutlined,
|
|
|
|
|
DeleteOutlined,
|
|
|
|
|
RestOutlined,
|
2026-05-14 12:44:18 +08:00
|
|
|
SettingOutlined,
|
|
|
|
|
UserOutlined,
|
|
|
|
|
NotificationOutlined,
|
|
|
|
|
ApiOutlined,
|
|
|
|
|
SafetyCertificateOutlined,
|
|
|
|
|
ToolOutlined,
|
|
|
|
|
RightOutlined,
|
2026-05-08 15:53:27 +08:00
|
|
|
} from '@ant-design/icons';
|
2026-05-14 12:44:18 +08:00
|
|
|
import {
|
|
|
|
|
Smartphone,
|
|
|
|
|
Mail,
|
|
|
|
|
Send,
|
|
|
|
|
MessageSquare,
|
|
|
|
|
ShieldCheck,
|
|
|
|
|
Users,
|
|
|
|
|
LineChart,
|
|
|
|
|
Wrench,
|
|
|
|
|
Cpu,
|
|
|
|
|
Camera,
|
|
|
|
|
Wind,
|
|
|
|
|
Box,
|
|
|
|
|
Activity,
|
|
|
|
|
Zap,
|
|
|
|
|
RefreshCw,
|
|
|
|
|
Shield,
|
|
|
|
|
Key,
|
|
|
|
|
Lock,
|
|
|
|
|
} from 'lucide-react';
|
|
|
|
|
import dayjs from 'dayjs';
|
2026-05-08 15:53:27 +08:00
|
|
|
|
2026-05-14 12:44:18 +08:00
|
|
|
const { Text, Title } = Typography;
|
2026-05-08 15:53:27 +08:00
|
|
|
|
|
|
|
|
const BasicSettings = () => {
|
|
|
|
|
const [form] = Form.useForm();
|
2026-05-14 12:44:18 +08:00
|
|
|
|
|
|
|
|
// 响应式字体大小
|
|
|
|
|
const fontNormal = 'clamp(12px, 0.75vw, 13px)';
|
|
|
|
|
const fontSmall = 'clamp(11px, 0.7vw, 12px)';
|
|
|
|
|
const fontTitle = 'clamp(14px, 0.85vw, 16px)';
|
|
|
|
|
const fontLarge = 'clamp(18px, 1.1vw, 22px)';
|
|
|
|
|
|
2026-05-08 15:53:27 +08:00
|
|
|
const handleSave = () => {
|
|
|
|
|
message.success('设置已保存');
|
|
|
|
|
};
|
|
|
|
|
|
2026-05-14 12:44:18 +08:00
|
|
|
// 顶部统计卡片数据
|
2026-05-14 09:37:15 +08:00
|
|
|
const topCards = [
|
|
|
|
|
{
|
|
|
|
|
title: '当前版本',
|
|
|
|
|
value: 'v2.8.1',
|
|
|
|
|
tag: '最新版',
|
|
|
|
|
tagColor: 'blue',
|
2026-05-14 12:44:18 +08:00
|
|
|
icon: <Cpu size={24} color="#1677ff" />,
|
|
|
|
|
bg: 'linear-gradient(135deg, #e6f4ff 0%, #bae0ff 100%)'
|
2026-05-14 09:37:15 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '在线用户',
|
|
|
|
|
value: '12',
|
|
|
|
|
trend: '↑ 2',
|
|
|
|
|
trendColor: '#52c41a',
|
2026-05-14 12:44:18 +08:00
|
|
|
icon: <Users size={24} color="#52c41a" />,
|
|
|
|
|
bg: 'linear-gradient(135deg, #f6ffed 0%, #d9f7be 100%)'
|
2026-05-14 09:37:15 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '告警通道',
|
|
|
|
|
value: '3 / 4',
|
|
|
|
|
trend: '正常',
|
|
|
|
|
trendColor: '#52c41a',
|
2026-05-14 12:44:18 +08:00
|
|
|
icon: <BellOutlined style={{ fontSize: 24, color: '#ff4d4f' }} />,
|
|
|
|
|
bg: 'linear-gradient(135deg, #fff2f0 0%, #ffccc7 100%)'
|
2026-05-14 09:37:15 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '数据备份状态',
|
|
|
|
|
value: '正常',
|
|
|
|
|
trend: '●',
|
|
|
|
|
trendColor: '#52c41a',
|
2026-05-14 12:44:18 +08:00
|
|
|
icon: <DatabaseOutlined style={{ fontSize: 24, color: '#13c2c2' }} />,
|
|
|
|
|
bg: 'linear-gradient(135deg, #e6fffb 0%, #b5f5ec 100%)'
|
2026-05-14 09:37:15 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '最近更新',
|
|
|
|
|
value: '2025-05-20',
|
2026-05-14 12:44:18 +08:00
|
|
|
icon: <CalendarOutlined style={{ fontSize: 24, color: '#722ed1' }} />,
|
|
|
|
|
bg: 'linear-gradient(135deg, #f9f0ff 0%, #efdbff 100%)'
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// 角色权限概览
|
|
|
|
|
const roleOverview = [
|
|
|
|
|
{
|
|
|
|
|
title: '超级管理员',
|
|
|
|
|
users: 2,
|
|
|
|
|
perms: 28,
|
|
|
|
|
tags: ['全部权限', '系统管理'],
|
|
|
|
|
color: '#1677ff',
|
|
|
|
|
bg: '#e6f4ff',
|
|
|
|
|
icon: <ShieldCheck size={20} color="#1677ff" />
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '运维工程师',
|
|
|
|
|
users: 5,
|
|
|
|
|
perms: 18,
|
|
|
|
|
tags: ['设备管理', '工单管理'],
|
|
|
|
|
color: '#52c41a',
|
|
|
|
|
bg: '#f6ffed',
|
|
|
|
|
icon: <Wrench size={20} color="#52c41a" />
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '巡检主管',
|
|
|
|
|
users: 8,
|
|
|
|
|
perms: 12,
|
|
|
|
|
tags: ['巡检管理', '告警处理'],
|
|
|
|
|
color: '#fa8c16',
|
|
|
|
|
bg: '#fff7e6',
|
|
|
|
|
icon: <Users size={20} color="#fa8c16" />
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '数据分析师',
|
|
|
|
|
users: 3,
|
|
|
|
|
perms: 15,
|
|
|
|
|
tags: ['数据分析', '报表查看'],
|
2026-05-14 09:37:15 +08:00
|
|
|
color: '#722ed1',
|
2026-05-14 12:44:18 +08:00
|
|
|
bg: '#f9f0ff',
|
|
|
|
|
icon: <LineChart size={20} color="#722ed1" />
|
2026-05-14 09:37:15 +08:00
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
2026-05-14 12:44:18 +08:00
|
|
|
// 设备状态
|
|
|
|
|
const deviceStatuses = [
|
|
|
|
|
{ name: '逆变器', count: '5/5', status: '正常' },
|
|
|
|
|
{ name: '汇流箱', count: '20/20', status: '正常' },
|
|
|
|
|
{ name: '气象站', count: '1/1', status: '正常' },
|
|
|
|
|
{ name: '摄像头', count: '12/12', status: '正常' },
|
|
|
|
|
{ name: '无人机', count: '2/2', status: '正常' },
|
|
|
|
|
{ name: '机器人', count: '5/5', status: '正常' },
|
|
|
|
|
{ name: 'API接口', count: '正常', status: '正常' },
|
|
|
|
|
{ name: 'Modbus', count: '正常', status: '正常' },
|
|
|
|
|
];
|
|
|
|
|
|
2026-05-08 15:53:27 +08:00
|
|
|
return (
|
2026-05-14 12:44:18 +08:00
|
|
|
<div style={{ padding: 'clamp(12px, 1.5vw, 24px)', background: '#f5f7fa', minHeight: '100vh' }}>
|
|
|
|
|
|
2026-05-14 09:37:15 +08:00
|
|
|
|
2026-05-14 12:44:18 +08:00
|
|
|
{/* 顶部统计卡片 */}
|
2026-05-14 09:37:15 +08:00
|
|
|
<Row gutter={[16, 16]} style={{ marginBottom: 24, flexWrap: 'wrap' }}>
|
|
|
|
|
{topCards.map((item, idx) => (
|
|
|
|
|
<Col key={idx} style={{ minWidth: '160px', flex: '1 0 auto' }}>
|
|
|
|
|
<AntdCard
|
|
|
|
|
size="small"
|
|
|
|
|
style={{ borderRadius: 8, width: '100%' }}
|
|
|
|
|
bodyStyle={{ padding: '12px' }}
|
|
|
|
|
>
|
|
|
|
|
<Space>
|
|
|
|
|
<div style={{ background: item.bg, borderRadius: 8, padding: 8 }}>
|
|
|
|
|
{item.icon}
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<div style={{ fontSize: 13, color: '#666' }}>{item.title}</div>
|
|
|
|
|
<div style={{ fontWeight: 600, display: 'flex', alignItems: 'center', gap: 6 }}>
|
|
|
|
|
{item.value}
|
|
|
|
|
{item.tag && <Tag color={item.tagColor} style={{ margin: 0 }}>{item.tag}</Tag>}
|
|
|
|
|
{item.trend && (
|
|
|
|
|
<span style={{ color: item.trendColor, fontSize: 12 }}>
|
|
|
|
|
{item.trend}
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Space>
|
|
|
|
|
</AntdCard>
|
|
|
|
|
</Col>
|
|
|
|
|
))}
|
2026-05-08 15:53:27 +08:00
|
|
|
</Row>
|
|
|
|
|
|
2026-05-14 09:37:15 +08:00
|
|
|
<Row gutter={16}>
|
2026-05-14 12:44:18 +08:00
|
|
|
{/* 左侧 */}
|
|
|
|
|
<Col xs={24} xl={17}>
|
|
|
|
|
{/* 基础配置 */}
|
|
|
|
|
<AntdCard
|
|
|
|
|
title={<Space><SettingOutlined style={{ color: '#1677ff' }} /><b>基础配置</b></Space>}
|
|
|
|
|
bordered={false}
|
|
|
|
|
style={{ borderRadius: 12, marginBottom: 16, boxShadow: '0 2px 8px rgba(0,0,0,0.05)' }}
|
|
|
|
|
>
|
2026-05-14 09:37:15 +08:00
|
|
|
<Form form={form} layout="vertical">
|
2026-05-14 12:44:18 +08:00
|
|
|
<Row gutter={24}>
|
|
|
|
|
<Col xs={24} sm={12} md={8}>
|
2026-05-14 09:37:15 +08:00
|
|
|
<Form.Item label="系统名称" name="systemName">
|
2026-05-14 12:44:18 +08:00
|
|
|
<Input defaultValue="光伏电站智能监控与运维系统" />
|
2026-05-14 09:37:15 +08:00
|
|
|
</Form.Item>
|
2026-05-09 09:19:05 +08:00
|
|
|
</Col>
|
2026-05-14 12:44:18 +08:00
|
|
|
<Col xs={24} sm={12} md={8}>
|
2026-05-14 09:37:15 +08:00
|
|
|
<Form.Item label="默认电站" name="defaultSite">
|
|
|
|
|
<Select defaultValue="1MW 光伏电站">
|
|
|
|
|
<Select.Option value="1MW">1MW 光伏电站</Select.Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
2026-05-08 15:53:27 +08:00
|
|
|
</Col>
|
2026-05-14 12:44:18 +08:00
|
|
|
<Col xs={24} sm={12} md={8}>
|
|
|
|
|
<Form.Item label="默认语言" name="defaultLang">
|
|
|
|
|
<Select defaultValue="zh">
|
|
|
|
|
<Select.Option value="zh">中文</Select.Option>
|
|
|
|
|
<Select.Option value="en">English</Select.Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}>
|
|
|
|
|
<Form.Item label="时区" name="timezone">
|
|
|
|
|
<Select defaultValue="UTC+08:00">
|
|
|
|
|
<Select.Option value="8">UTC+08:00</Select.Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}>
|
|
|
|
|
<Form.Item label="首页默认页面" name="defaultPage">
|
|
|
|
|
<Select defaultValue="dashboard">
|
|
|
|
|
<Select.Option value="dashboard">总览首页</Select.Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}>
|
2026-05-14 09:37:15 +08:00
|
|
|
<Form.Item label="数据刷新频率" name="refreshRate">
|
2026-05-14 12:44:18 +08:00
|
|
|
<Select defaultValue="5min">
|
|
|
|
|
<Select.Option value="5min">5 分钟</Select.Option>
|
2026-05-14 09:37:15 +08:00
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
2026-05-08 15:53:27 +08:00
|
|
|
</Col>
|
2026-05-14 12:44:18 +08:00
|
|
|
<Col xs={24} sm={12} md={8}>
|
2026-05-14 09:37:15 +08:00
|
|
|
<Form.Item label="地图服务" name="mapService">
|
2026-05-14 12:44:18 +08:00
|
|
|
<Select defaultValue="gaode">
|
|
|
|
|
<Select.Option value="gaode">高德地图</Select.Option>
|
2026-05-14 09:37:15 +08:00
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
2026-05-08 15:53:27 +08:00
|
|
|
</Col>
|
2026-05-14 12:44:18 +08:00
|
|
|
<Col xs={24} md={16}>
|
|
|
|
|
<div style={{ display: 'flex', gap: 'clamp(8px, 1vw, 24px)', marginTop: 8, flexWrap: 'wrap' }}>
|
|
|
|
|
<Space>
|
|
|
|
|
<span style={{ fontSize: fontNormal }}>工单自动编号</span>
|
|
|
|
|
<Switch defaultChecked />
|
|
|
|
|
</Space>
|
|
|
|
|
<Space>
|
|
|
|
|
<span style={{ fontSize: fontNormal }}>AI建议自动生成</span>
|
|
|
|
|
<Switch defaultChecked />
|
|
|
|
|
</Space>
|
|
|
|
|
<Space>
|
|
|
|
|
<span style={{ fontSize: fontNormal }}>移动端同步</span>
|
|
|
|
|
<Switch defaultChecked />
|
|
|
|
|
</Space>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
2026-05-08 15:53:27 +08:00
|
|
|
</Row>
|
2026-05-14 12:44:18 +08:00
|
|
|
<div style={{ marginTop: 16 }}>
|
|
|
|
|
<Button type="primary" onClick={handleSave} style={{ width: 120, borderRadius: 6, height: 36 }}>保存设置</Button>
|
|
|
|
|
<Button style={{ marginLeft: 12, borderRadius: 6, height: 36 }}>恢复默认</Button>
|
|
|
|
|
</div>
|
2026-05-14 09:37:15 +08:00
|
|
|
</Form>
|
|
|
|
|
</AntdCard>
|
2026-05-08 15:53:27 +08:00
|
|
|
|
2026-05-14 09:37:15 +08:00
|
|
|
{/* 通知与告警策略 */}
|
2026-05-14 12:44:18 +08:00
|
|
|
<AntdCard
|
|
|
|
|
title={<Space><BellOutlined style={{ color: '#1677ff' }} /><b>通知与告警策略</b></Space>}
|
|
|
|
|
bordered={false}
|
|
|
|
|
style={{ borderRadius: 12, marginBottom: 16, boxShadow: '0 2px 8px rgba(0,0,0,0.05)' }}
|
|
|
|
|
>
|
|
|
|
|
<Row gutter={[16, 16]} style={{ marginBottom: 24 }}>
|
|
|
|
|
{[
|
|
|
|
|
{ label: '短信', icon: <Smartphone size={18} />, color: '#52c41a', status: '已启用' },
|
|
|
|
|
{ label: '邮件', icon: <Mail size={18} />, color: '#1677ff', status: '已启用' },
|
|
|
|
|
{ label: 'Telegram', icon: <Send size={18} />, color: '#13c2c2', status: '已启用' },
|
|
|
|
|
{ label: '系统通知', icon: <BellOutlined />, color: '#fa8c16', status: '已启用' },
|
|
|
|
|
].map((item, idx) => (
|
|
|
|
|
<Col xs={24} sm={12} lg={6} key={idx}>
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', padding: '12px 16px', background: '#f8fafc', borderRadius: 10, border: '1px solid #f1f5f9' }}>
|
|
|
|
|
<div style={{ width: 36, height: 36, borderRadius: '50%', background: '#fff', display: 'flex', alignItems: 'center', justifyContent: 'center', boxShadow: '0 2px 4px rgba(0,0,0,0.05)', marginRight: 12 }}>
|
|
|
|
|
{React.cloneElement(item.icon as React.ReactElement, { style: { color: item.color } })}
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ flex: 1 }}>
|
|
|
|
|
<div style={{ fontSize: fontSmall, color: '#8c8c8c' }}>{item.label}</div>
|
|
|
|
|
<div style={{ fontSize: fontSmall, color: '#52c41a' }}>{item.status}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<Switch size="small" defaultChecked />
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
))}
|
2026-05-14 09:37:15 +08:00
|
|
|
</Row>
|
2026-05-14 12:44:18 +08:00
|
|
|
<Row gutter={[32, 16]}>
|
|
|
|
|
<Col xs={24} sm={12} md={8}><Space><span>严重告警立即通知</span><Switch size="small" defaultChecked /></Space></Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}><Space><span>发电下降超过 15%</span><Switch size="small" defaultChecked /></Space></Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}><Space><span>通信中断通知</span><Switch size="small" defaultChecked /></Space></Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}><Space><span>每日汇总推送</span><Switch size="small" defaultChecked /></Space></Col>
|
|
|
|
|
<Col xs={24} md={16}>
|
|
|
|
|
<Space size="middle" style={{ flexWrap: 'wrap' }}>
|
|
|
|
|
<span>夜间免打扰</span>
|
|
|
|
|
<TimePicker.RangePicker size="small" defaultValue={[dayjs('23:00', 'HH:mm'), dayjs('07:00', 'HH:mm')]} format="HH:mm" />
|
|
|
|
|
<Switch size="small" />
|
|
|
|
|
</Space>
|
2026-05-14 09:37:15 +08:00
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</AntdCard>
|
|
|
|
|
|
|
|
|
|
{/* 用户与权限预览 */}
|
2026-05-14 12:44:18 +08:00
|
|
|
<AntdCard
|
|
|
|
|
title={<Space><Users size={18} style={{ color: '#1677ff' }} /><b>用户与权限预览</b></Space>}
|
|
|
|
|
bordered={false}
|
|
|
|
|
style={{ borderRadius: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.05)', marginBottom: 16 }}
|
|
|
|
|
>
|
2026-05-14 09:37:15 +08:00
|
|
|
<Table
|
|
|
|
|
size="small"
|
2026-05-14 12:44:18 +08:00
|
|
|
scroll={{ x: 'max-content' }}
|
|
|
|
|
pagination={{ size: 'small', total: 4, pageSize: 4, showTotal: (total) => `共 ${total} 条` }}
|
2026-05-14 09:37:15 +08:00
|
|
|
columns={[
|
2026-05-14 12:44:18 +08:00
|
|
|
{ title: '用户名', dataIndex: 'name', key: 'name', fixed: 'left' },
|
|
|
|
|
{
|
|
|
|
|
title: '角色',
|
|
|
|
|
dataIndex: 'role',
|
|
|
|
|
key: 'role',
|
|
|
|
|
render: (role) => {
|
|
|
|
|
const config: any = {
|
|
|
|
|
'超级管理员': { color: '#1677ff', bg: '#e6f4ff' },
|
|
|
|
|
'运维工程师': { color: '#52c41a', bg: '#f6ffed' },
|
|
|
|
|
'巡检主管': { color: '#fa8c16', bg: '#fff7e6' },
|
|
|
|
|
'数据分析师': { color: '#722ed1', bg: '#f9f0ff' },
|
|
|
|
|
};
|
|
|
|
|
const s = config[role] || { color: '#8c8c8c', bg: '#f5f5f5' };
|
|
|
|
|
return <Tag bordered={false} style={{ color: s.color, background: s.bg, fontSize: fontSmall }}>{role}</Tag>;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{ title: '手机号', dataIndex: 'phone', key: 'phone' },
|
|
|
|
|
{ title: '邮箱', dataIndex: 'email', key: 'email' },
|
|
|
|
|
{
|
|
|
|
|
title: '状态',
|
|
|
|
|
dataIndex: 'status',
|
|
|
|
|
key: 'status',
|
|
|
|
|
render: (status) => (
|
|
|
|
|
<Space size={4}>
|
|
|
|
|
<div style={{ width: 6, height: 6, borderRadius: '50%', background: status === '在线' ? '#52c41a' : '#bfbfbf' }} />
|
|
|
|
|
<span style={{ fontSize: fontSmall }}>{status}</span>
|
|
|
|
|
</Space>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
{ title: '操作', key: 'action', render: () => <Button type="link" size="small">查看</Button>, fixed: 'right' },
|
2026-05-14 09:37:15 +08:00
|
|
|
]}
|
|
|
|
|
dataSource={[
|
2026-05-14 12:44:18 +08:00
|
|
|
{ name: '张运维', role: '超级管理员', phone: '138****0001', email: 'zhangyw@pvsmart.com', status: '在线' },
|
|
|
|
|
{ name: '李工程师', role: '运维工程师', phone: '139****0002', email: 'li.gongcheng@pvsmart.com', status: '在线' },
|
|
|
|
|
{ name: '王班长', role: '巡检主管', phone: '137****0003', email: 'wang.banzhang@pvsmart.com', status: '在线' },
|
|
|
|
|
{ name: '赵分析师', role: '数据分析师', phone: '136****0004', email: 'zhao.fx@pvsmart.com', status: '在线' },
|
2026-05-14 09:37:15 +08:00
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
</AntdCard>
|
2026-05-14 12:44:18 +08:00
|
|
|
</Col>
|
2026-05-09 09:19:05 +08:00
|
|
|
|
2026-05-14 12:44:18 +08:00
|
|
|
{/* 右侧 */}
|
|
|
|
|
<Col xs={24} xl={7}>
|
|
|
|
|
{/* 角色权限概览 */}
|
|
|
|
|
<AntdCard
|
|
|
|
|
title={<Space><Users size={18} style={{ color: '#1677ff' }} /><b>角色权限概览</b></Space>}
|
|
|
|
|
bordered={false}
|
|
|
|
|
style={{ borderRadius: 12, marginBottom: 16, boxShadow: '0 2px 8px rgba(0,0,0,0.05)' }}
|
|
|
|
|
bodyStyle={{ padding: '12px' }}
|
|
|
|
|
>
|
|
|
|
|
<Row gutter={[12, 12]}>
|
|
|
|
|
{roleOverview.map((role, idx) => (
|
|
|
|
|
<Col xs={24} sm={12} key={idx}>
|
|
|
|
|
<div style={{ background: role.bg, borderRadius: 10, padding: 10, height: '100%' }}>
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 8 }}>
|
|
|
|
|
{role.icon}
|
|
|
|
|
<RightOutlined style={{ fontSize: 10, color: role.color }} />
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ fontWeight: 600, fontSize: fontSmall, color: role.color, marginBottom: 4 }}>{role.title}</div>
|
|
|
|
|
<div style={{ fontSize: 10, color: '#8c8c8c', marginBottom: 8 }}>
|
|
|
|
|
用户 {role.users} 人 | 权限 {role.perms} 项
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ display: 'flex', gap: 4, flexWrap: 'wrap' }}>
|
|
|
|
|
{role.tags.map((tag, tidx) => (
|
|
|
|
|
<span key={tidx} style={{ fontSize: 9, padding: '1px 4px', background: '#fff', color: role.color, borderRadius: 2, border: `1px solid ${role.color}40` }}>{tag}</span>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
2026-05-08 15:53:27 +08:00
|
|
|
</div>
|
2026-05-14 09:37:15 +08:00
|
|
|
</Col>
|
2026-05-08 15:53:27 +08:00
|
|
|
))}
|
2026-05-14 09:37:15 +08:00
|
|
|
</Row>
|
|
|
|
|
</AntdCard>
|
2026-05-08 15:53:27 +08:00
|
|
|
|
2026-05-14 09:37:15 +08:00
|
|
|
{/* 设备接入状态 */}
|
2026-05-14 12:44:18 +08:00
|
|
|
<AntdCard
|
|
|
|
|
title={<Space><ApiOutlined style={{ color: '#1677ff' }} /><b>设备接入状态</b></Space>}
|
|
|
|
|
extra={<Button type="link" size="small">查看详情 <RightOutlined /></Button>}
|
|
|
|
|
bordered={false}
|
|
|
|
|
style={{ borderRadius: 12, marginBottom: 16, boxShadow: '0 2px 8px rgba(0,0,0,0.05)' }}
|
|
|
|
|
bodyStyle={{ padding: '16px' }}
|
|
|
|
|
>
|
|
|
|
|
<div style={{ display: 'flex', gap: 20 }}>
|
|
|
|
|
<div style={{ flex: '0 0 100px' }}>
|
|
|
|
|
{deviceStatuses.map((item, idx) => (
|
|
|
|
|
<div key={idx} style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 6 }}>
|
|
|
|
|
<Space size={4}>
|
|
|
|
|
<div style={{ width: 6, height: 6, borderRadius: '50%', background: '#52c41a' }} />
|
|
|
|
|
<span style={{ fontSize: 11, color: '#595959' }}>{item.name}</span>
|
|
|
|
|
</Space>
|
|
|
|
|
<span style={{ fontSize: 11, fontWeight: 500 }}>{item.count}</span>
|
2026-05-14 09:37:15 +08:00
|
|
|
</div>
|
2026-05-14 12:44:18 +08:00
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ flex: 1, position: 'relative', height: 160, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgba(22, 119, 255, 0.02)', borderRadius: 12 }}>
|
|
|
|
|
{/* SVG 拓扑图:使用百分比和 viewBox 保证缩放比一致性 */}
|
|
|
|
|
<svg width="100%" height="100%" viewBox="0 0 200 160" style={{ maxWidth: 240 }}>
|
|
|
|
|
<defs>
|
|
|
|
|
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
|
|
|
|
|
<feGaussianBlur stdDeviation="3" result="blur" />
|
|
|
|
|
<feComposite in="SourceGraphic" in2="blur" operator="over" />
|
|
|
|
|
</filter>
|
|
|
|
|
</defs>
|
|
|
|
|
{/* 动态连线 */}
|
|
|
|
|
<g stroke="#1677ff40" strokeWidth="1" strokeDasharray="4 2">
|
|
|
|
|
<line x1="100" y1="80" x2="60" y2="40" />
|
|
|
|
|
<line x1="100" y1="80" x2="140" y2="40" />
|
|
|
|
|
<line x1="100" y1="80" x2="160" y2="80" />
|
|
|
|
|
<line x1="100" y1="80" x2="140" y2="120" />
|
|
|
|
|
<line x1="100" y1="80" x2="60" y2="120" />
|
|
|
|
|
<line x1="100" y1="80" x2="40" y2="80" />
|
|
|
|
|
</g>
|
|
|
|
|
{/* 中心核心节点 */}
|
|
|
|
|
<circle cx="100" cy="80" r="18" fill="#1677ff" filter="url(#glow)" />
|
|
|
|
|
<rect x="91" y="71" width="18" height="18" rx="3" fill="none" stroke="#fff" strokeWidth="1.5" />
|
|
|
|
|
<path d="M95 75h10M95 80h10M95 85h10" stroke="#fff" strokeWidth="1.2" />
|
2026-05-08 15:53:27 +08:00
|
|
|
|
2026-05-14 12:44:18 +08:00
|
|
|
{/* 周边子节点 */}
|
|
|
|
|
{[
|
|
|
|
|
{ x: 60, y: 40, icon: <Cpu size={12} />, label: '逆变器' },
|
|
|
|
|
{ x: 140, y: 40, icon: <Box size={12} />, label: '汇流箱' },
|
|
|
|
|
{ x: 160, y: 80, icon: <Wind size={12} />, label: '气象站' },
|
|
|
|
|
{ x: 140, y: 120, icon: <Camera size={12} />, label: '摄像头' },
|
|
|
|
|
{ x: 60, y: 120, icon: <Activity size={12} />, label: '机器人' },
|
|
|
|
|
{ x: 40, y: 80, icon: <Zap size={12} />, label: '接口' },
|
|
|
|
|
].map((node, i) => (
|
|
|
|
|
<g key={i}>
|
|
|
|
|
<circle cx={node.x} cy={node.y} r="12" fill="#fff" stroke="#e8e8e8" strokeWidth="1" />
|
|
|
|
|
<foreignObject x={node.x - 6} y={node.y - 6} width="12" height="12">
|
|
|
|
|
<div style={{ color: '#1677ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>{node.icon}</div>
|
|
|
|
|
</foreignObject>
|
|
|
|
|
<text x={node.x} y={node.y + 20} textAnchor="middle" style={{ fontSize: 8, fill: '#8c8c8c' }}>{node.label}</text>
|
|
|
|
|
</g>
|
|
|
|
|
))}
|
|
|
|
|
</svg>
|
2026-05-14 09:37:15 +08:00
|
|
|
</div>
|
2026-05-14 12:44:18 +08:00
|
|
|
</div>
|
2026-05-14 09:37:15 +08:00
|
|
|
</AntdCard>
|
|
|
|
|
|
2026-05-14 12:44:18 +08:00
|
|
|
{/* 数据与安全 */}
|
|
|
|
|
<AntdCard
|
|
|
|
|
title={<Space><Shield size={18} style={{ color: '#1677ff' }} /><b>数据与安全</b></Space>}
|
|
|
|
|
bordered={false}
|
|
|
|
|
style={{ borderRadius: 12, marginBottom: 16, boxShadow: '0 2px 8px rgba(0,0,0,0.05)' }}
|
|
|
|
|
bodyStyle={{ padding: '16px' }}
|
|
|
|
|
>
|
|
|
|
|
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(140px, 1fr))', gap: '16px 24px' }}>
|
|
|
|
|
{[
|
|
|
|
|
{ label: '数据保留', value: '3 年', icon: <DatabaseOutlined style={{ color: '#1677ff' }} /> },
|
|
|
|
|
{ label: '登录审计', value: '已开启', icon: <CheckCircleOutlined style={{ color: '#52c41a' }} />, color: '#52c41a' },
|
|
|
|
|
{ label: '每日自动备份', value: '02:00', icon: <RefreshCw size={14} color="#1677ff" /> },
|
|
|
|
|
{ label: 'API 密钥管理', value: '正常', icon: <Key size={14} color="#52c41a" />, color: '#52c41a' },
|
|
|
|
|
{ label: '最近备份时间', value: '2025-05-24 02:00', icon: <CalendarOutlined style={{ color: '#1677ff' }} />, isFull: true },
|
|
|
|
|
{ label: 'SSL 证书', value: '有效期至 2026-12-31', icon: <SafetyCertificateOutlined style={{ color: '#fa8c16' }} />, isFull: true },
|
|
|
|
|
{ label: '双因素认证', value: '已开启', icon: <Lock size={14} color="#52c41a" />, color: '#52c41a' },
|
|
|
|
|
].map((item, idx) => (
|
|
|
|
|
<div key={idx} style={{ gridColumn: item.isFull ? '1 / -1' : 'auto', display: 'flex', alignItems: 'center', gap: 8 }}>
|
|
|
|
|
<div style={{ width: 24, height: 24, borderRadius: 6, background: '#f8fafc', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
|
|
|
{item.icon}
|
2026-05-14 09:37:15 +08:00
|
|
|
</div>
|
2026-05-14 12:44:18 +08:00
|
|
|
<div style={{ flex: 1 }}>
|
|
|
|
|
<div style={{ fontSize: fontSmall, color: '#8c8c8c' }}>{item.label}</div>
|
|
|
|
|
<div style={{ fontSize: fontNormal, fontWeight: 500, color: item.color || '#262626' }}>{item.value}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-05-14 09:37:15 +08:00
|
|
|
))}
|
2026-05-14 12:44:18 +08:00
|
|
|
</div>
|
2026-05-14 09:37:15 +08:00
|
|
|
</AntdCard>
|
|
|
|
|
|
2026-05-14 12:44:18 +08:00
|
|
|
{/* 系统维护 */}
|
|
|
|
|
<AntdCard
|
|
|
|
|
title={<Space><Wrench size={18} style={{ color: '#1677ff' }} /><b>系统维护</b></Space>}
|
|
|
|
|
extra={<Button type="link" size="small" danger style={{ fontSize: fontSmall }}>操作需管理员权限</Button>}
|
|
|
|
|
bordered={false}
|
|
|
|
|
style={{ borderRadius: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.05)' }}
|
|
|
|
|
bodyStyle={{ padding: '16px' }}
|
|
|
|
|
>
|
|
|
|
|
<Row gutter={[12, 12]}>
|
|
|
|
|
{[
|
|
|
|
|
{ label: '清理缓存', icon: <DeleteOutlined />, color: '#1677ff' },
|
|
|
|
|
{ label: '重启服务', icon: <RefreshCw size={20} />, color: '#1677ff' },
|
|
|
|
|
{ label: '备份下载', icon: <DownloadOutlined />, color: '#1677ff' },
|
|
|
|
|
{ label: '日志导出', icon: <FileTextOutlined />, color: '#1677ff' },
|
|
|
|
|
].map((btn, idx) => (
|
|
|
|
|
<Col xs={12} sm={6} key={idx}>
|
|
|
|
|
<Button
|
|
|
|
|
style={{
|
|
|
|
|
width: '100%',
|
|
|
|
|
height: 'clamp(56px, 5vw, 64px)',
|
|
|
|
|
display: 'flex',
|
|
|
|
|
flexDirection: 'column',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center',
|
|
|
|
|
borderRadius: 10,
|
|
|
|
|
gap: 4,
|
|
|
|
|
border: '1px solid #f0f0f0',
|
|
|
|
|
background: '#fff',
|
|
|
|
|
padding: '4px'
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<div style={{ color: btn.color, fontSize: 'clamp(16px, 1.2vw, 20px)' }}>{btn.icon}</div>
|
|
|
|
|
<div style={{ fontSize: fontSmall, color: '#595959' }}>{btn.label}</div>
|
|
|
|
|
</Button>
|
2026-05-14 09:37:15 +08:00
|
|
|
</Col>
|
|
|
|
|
))}
|
|
|
|
|
</Row>
|
|
|
|
|
</AntdCard>
|
2026-05-08 15:53:27 +08:00
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default BasicSettings;
|
2026-05-14 12:44:18 +08:00
|
|
|
|