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-18 14:28:42 +08:00
|
|
|
EyeOutlined,
|
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-15 15:39:28 +08:00
|
|
|
<div className="normal-spacing" style={{ padding: '8px 0px', background: '#f5f7fa', minHeight: '100vh' }}>
|
2026-05-14 17:23:12 +08:00
|
|
|
|
2026-05-14 09:37:15 +08:00
|
|
|
|
2026-05-14 12:44:18 +08:00
|
|
|
{/* 顶部统计卡片 */}
|
2026-05-14 17:23:12 +08:00
|
|
|
<Row gutter={[8, 8]} style={{ marginBottom: 8 }}>
|
2026-05-14 09:37:15 +08:00
|
|
|
{topCards.map((item, idx) => (
|
2026-05-14 17:23:12 +08:00
|
|
|
<Col key={idx} style={{ minWidth: '168px', flex: '1 0 auto', maxWidth: "250px" }}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<AntdCard bordered={false} bodyStyle={{ padding: '12px 16px' }} style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}>
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
|
|
|
|
<div style={{ width: 40, height: 40, borderRadius: 10, background: item.bg, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
|
|
|
{React.cloneElement(item.icon as React.ReactElement, { size: 20, style: item.icon.props.style ? { ...item.icon.props.style, fontSize: 20 } : { fontSize: 20 } })}
|
2026-05-14 09:37:15 +08:00
|
|
|
</div>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ flex: 1 }}>
|
|
|
|
|
<div style={{ color: '#8c8c8c', fontSize: fontSmall, marginBottom: 2 }}>{item.title}</div>
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'baseline', gap: 6 }}>
|
|
|
|
|
<span style={{ fontSize: 'clamp(16px, 1vw, 20px)', fontWeight: 700, color: '#262626' }}>{item.value}</span>
|
|
|
|
|
{item.tag && <Tag color={item.tagColor} style={{ fontSize: 9, margin: 0, borderRadius: 4, padding: '0 4px' }}>{item.tag}</Tag>}
|
|
|
|
|
{item.trend && <span style={{ color: item.trendColor, fontSize: fontSmall, fontWeight: 600 }}>{item.trend}</span>}
|
2026-05-14 09:37:15 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-05-14 16:25:10 +08:00
|
|
|
</div>
|
2026-05-14 09:37:15 +08:00
|
|
|
</AntdCard>
|
|
|
|
|
</Col>
|
|
|
|
|
))}
|
2026-05-08 15:53:27 +08:00
|
|
|
</Row>
|
|
|
|
|
|
2026-05-14 17:23:12 +08:00
|
|
|
<Row gutter={[8, 8]}>
|
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}
|
2026-05-14 17:23:12 +08:00
|
|
|
style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
2026-05-14 16:25:10 +08:00
|
|
|
bodyStyle={{ padding: '16px' }}
|
2026-05-14 12:44:18 +08:00
|
|
|
>
|
2026-05-14 09:37:15 +08:00
|
|
|
<Form form={form} layout="vertical">
|
2026-05-14 16:25:10 +08:00
|
|
|
<Row gutter={16}>
|
2026-05-14 12:44:18 +08:00
|
|
|
<Col xs={24} sm={12} md={8}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<Form.Item label="系统名称" name="systemName" style={{ marginBottom: 12 }}>
|
|
|
|
|
<Input size="small" 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 16:25:10 +08:00
|
|
|
<Form.Item label="默认电站" name="defaultSite" style={{ marginBottom: 12 }}>
|
|
|
|
|
<Select size="small" defaultValue="1MW 光伏电站">
|
2026-05-14 09:37:15 +08:00
|
|
|
<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}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<Form.Item label="默认语言" name="defaultLang" style={{ marginBottom: 12 }}>
|
|
|
|
|
<Select size="small" defaultValue="zh">
|
2026-05-14 12:44:18 +08:00
|
|
|
<Select.Option value="zh">中文</Select.Option>
|
|
|
|
|
<Select.Option value="en">English</Select.Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<Form.Item label="时区" name="timezone" style={{ marginBottom: 12 }}>
|
|
|
|
|
<Select size="small" defaultValue="UTC+08:00">
|
2026-05-14 12:44:18 +08:00
|
|
|
<Select.Option value="8">UTC+08:00</Select.Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<Form.Item label="首页默认页面" name="defaultPage" style={{ marginBottom: 12 }}>
|
|
|
|
|
<Select size="small" defaultValue="dashboard">
|
2026-05-14 12:44:18 +08:00
|
|
|
<Select.Option value="dashboard">总览首页</Select.Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<Form.Item label="数据刷新频率" name="refreshRate" style={{ marginBottom: 12 }}>
|
|
|
|
|
<Select size="small" defaultValue="5min">
|
2026-05-14 12:44:18 +08:00
|
|
|
<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 16:25:10 +08:00
|
|
|
<Form.Item label="地图服务" name="mapService" style={{ marginBottom: 12 }}>
|
|
|
|
|
<Select size="small" defaultValue="gaode">
|
2026-05-14 12:44:18 +08:00
|
|
|
<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}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ display: 'flex', gap: 'clamp(8px, 1vw, 20px)', marginTop: 4, flexWrap: 'wrap' }}>
|
2026-05-14 12:44:18 +08:00
|
|
|
<Space>
|
2026-05-14 16:25:10 +08:00
|
|
|
<span style={{ fontSize: fontSmall }}>工单自动编号</span>
|
|
|
|
|
<Switch size="small" defaultChecked />
|
2026-05-14 12:44:18 +08:00
|
|
|
</Space>
|
|
|
|
|
<Space>
|
2026-05-14 16:25:10 +08:00
|
|
|
<span style={{ fontSize: fontSmall }}>AI建议自动生成</span>
|
|
|
|
|
<Switch size="small" defaultChecked />
|
2026-05-14 12:44:18 +08:00
|
|
|
</Space>
|
|
|
|
|
<Space>
|
2026-05-14 16:25:10 +08:00
|
|
|
<span style={{ fontSize: fontSmall }}>移动端同步</span>
|
|
|
|
|
<Switch size="small" defaultChecked />
|
2026-05-14 12:44:18 +08:00
|
|
|
</Space>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
2026-05-08 15:53:27 +08:00
|
|
|
</Row>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ marginTop: 12 }}>
|
|
|
|
|
<Button type="primary" size="small" onClick={handleSave} style={{ width: 100, borderRadius: 6 }}>保存设置</Button>
|
|
|
|
|
<Button size="small" style={{ marginLeft: 8, borderRadius: 6 }}>恢复默认</Button>
|
2026-05-14 12:44:18 +08:00
|
|
|
</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}
|
2026-05-14 17:23:12 +08:00
|
|
|
style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
2026-05-14 16:25:10 +08:00
|
|
|
bodyStyle={{ padding: '16px' }}
|
2026-05-14 12:44:18 +08:00
|
|
|
>
|
2026-05-14 17:23:12 +08:00
|
|
|
<Row gutter={[12, 12]} style={{ marginBottom: 8 }}>
|
2026-05-14 12:44:18 +08:00
|
|
|
{[
|
2026-05-14 16:25:10 +08:00
|
|
|
{ label: '短信', icon: <Smartphone size={16} />, color: '#52c41a', status: '已启用' },
|
|
|
|
|
{ label: '邮件', icon: <Mail size={16} />, color: '#1677ff', status: '已启用' },
|
|
|
|
|
{ label: 'Telegram', icon: <Send size={16} />, color: '#13c2c2', status: '已启用' },
|
|
|
|
|
{ label: '系统通知', icon: <BellOutlined style={{ fontSize: 16 }} />, color: '#fa8c16', status: '已启用' },
|
2026-05-14 12:44:18 +08:00
|
|
|
].map((item, idx) => (
|
|
|
|
|
<Col xs={24} sm={12} lg={6} key={idx}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ display: 'flex', alignItems: 'center', padding: '10px 12px', background: '#f8fafc', borderRadius: 8, border: '1px solid #f1f5f9' }}>
|
|
|
|
|
<div style={{ width: 32, height: 32, borderRadius: '50%', background: '#fff', display: 'flex', alignItems: 'center', justifyContent: 'center', boxShadow: '0 1px 4px rgba(0,0,0,0.04)', marginRight: 10 }}>
|
2026-05-14 12:44:18 +08:00
|
|
|
{React.cloneElement(item.icon as React.ReactElement, { style: { color: item.color } })}
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ flex: 1 }}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ fontSize: 10, color: '#8c8c8c' }}>{item.label}</div>
|
|
|
|
|
<div style={{ fontSize: 10, color: '#52c41a' }}>{item.status}</div>
|
2026-05-14 12:44:18 +08:00
|
|
|
</div>
|
|
|
|
|
<Switch size="small" defaultChecked />
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
))}
|
2026-05-14 09:37:15 +08:00
|
|
|
</Row>
|
2026-05-14 16:25:10 +08:00
|
|
|
<Row gutter={[24, 12]}>
|
|
|
|
|
<Col xs={24} sm={12} md={8}><Space size={8}><span style={{ fontSize: fontSmall }}>严重告警立即通知</span><Switch size="small" defaultChecked /></Space></Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}><Space size={8}><span style={{ fontSize: fontSmall }}>发电下降超过 15%</span><Switch size="small" defaultChecked /></Space></Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}><Space size={8}><span style={{ fontSize: fontSmall }}>通信中断通知</span><Switch size="small" defaultChecked /></Space></Col>
|
|
|
|
|
<Col xs={24} sm={12} md={8}><Space size={8}><span style={{ fontSize: fontSmall }}>每日汇总推送</span><Switch size="small" defaultChecked /></Space></Col>
|
2026-05-14 12:44:18 +08:00
|
|
|
<Col xs={24} md={16}>
|
|
|
|
|
<Space size="middle" style={{ flexWrap: 'wrap' }}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<span style={{ fontSize: fontSmall }}>夜间免打扰</span>
|
|
|
|
|
<TimePicker.RangePicker size="small" defaultValue={[dayjs('23:00', 'HH:mm'), dayjs('07:00', 'HH:mm')]} format="HH:mm" style={{ width: 140 }} />
|
2026-05-14 12:44:18 +08:00
|
|
|
<Switch size="small" />
|
|
|
|
|
</Space>
|
2026-05-14 09:37:15 +08:00
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</AntdCard>
|
|
|
|
|
|
|
|
|
|
{/* 用户与权限预览 */}
|
2026-05-14 12:44:18 +08:00
|
|
|
<AntdCard
|
2026-05-14 16:25:10 +08:00
|
|
|
title={<Space><Users size={16} style={{ color: '#1677ff' }} /><b>用户与权限预览</b></Space>}
|
2026-05-14 12:44:18 +08:00
|
|
|
bordered={false}
|
2026-05-14 16:25:10 +08:00
|
|
|
style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)', marginBottom: 0 }}
|
|
|
|
|
bodyStyle={{ padding: '12px' }}
|
2026-05-14 12:44:18 +08:00
|
|
|
>
|
2026-05-14 09:37:15 +08:00
|
|
|
<Table
|
|
|
|
|
size="small"
|
2026-05-14 12:44:18 +08:00
|
|
|
scroll={{ x: 'max-content' }}
|
2026-05-14 17:23:12 +08:00
|
|
|
rowStyle={{ height: '32px', padding: 0 }}
|
|
|
|
|
empty={false}
|
|
|
|
|
|
|
|
|
|
|
2026-05-14 12:44:18 +08:00
|
|
|
pagination={{ size: 'small', total: 4, pageSize: 4, showTotal: (total) => `共 ${total} 条` }}
|
2026-05-14 09:37:15 +08:00
|
|
|
columns={[
|
2026-05-14 16:25:10 +08:00
|
|
|
{ title: '用户名', dataIndex: 'name', key: 'name', fixed: 'left', width: 80 },
|
2026-05-14 12:44:18 +08:00
|
|
|
{
|
|
|
|
|
title: '角色',
|
|
|
|
|
dataIndex: 'role',
|
|
|
|
|
key: 'role',
|
2026-05-14 16:25:10 +08:00
|
|
|
width: 100,
|
2026-05-14 12:44:18 +08:00
|
|
|
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' };
|
2026-05-14 16:25:10 +08:00
|
|
|
return <Tag bordered={false} style={{ color: s.color, background: s.bg, fontSize: 10, margin: 0 }}>{role}</Tag>;
|
2026-05-14 12:44:18 +08:00
|
|
|
}
|
|
|
|
|
},
|
2026-05-14 16:25:10 +08:00
|
|
|
{ title: '手机号', dataIndex: 'phone', key: 'phone', width: 110 },
|
|
|
|
|
{ title: '邮箱', dataIndex: 'email', key: 'email', ellipsis: true },
|
2026-05-14 12:44:18 +08:00
|
|
|
{
|
|
|
|
|
title: '状态',
|
|
|
|
|
dataIndex: 'status',
|
|
|
|
|
key: 'status',
|
2026-05-14 16:25:10 +08:00
|
|
|
width: 70,
|
2026-05-14 12:44:18 +08:00
|
|
|
render: (status) => (
|
|
|
|
|
<Space size={4}>
|
|
|
|
|
<div style={{ width: 6, height: 6, borderRadius: '50%', background: status === '在线' ? '#52c41a' : '#bfbfbf' }} />
|
2026-05-14 16:25:10 +08:00
|
|
|
<span style={{ fontSize: 10 }}>{status}</span>
|
2026-05-14 12:44:18 +08:00
|
|
|
</Space>
|
|
|
|
|
)
|
|
|
|
|
},
|
2026-05-18 14:28:42 +08:00
|
|
|
{
|
|
|
|
|
title: '操作', key: 'action', width: 60, render: () => <Button
|
|
|
|
|
type="link"
|
|
|
|
|
size="small"
|
|
|
|
|
icon={<EyeOutlined />}
|
|
|
|
|
style={{ padding: 0, fontSize: 11 }}
|
|
|
|
|
>
|
|
|
|
|
查看
|
|
|
|
|
</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
|
2026-05-14 16:25:10 +08:00
|
|
|
title={<Space><Users size={16} style={{ color: '#1677ff' }} /><b>角色权限概览</b></Space>}
|
2026-05-14 12:44:18 +08:00
|
|
|
bordered={false}
|
2026-05-14 17:23:12 +08:00
|
|
|
style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
2026-05-14 16:25:10 +08:00
|
|
|
bodyStyle={{ padding: '10px' }}
|
2026-05-14 12:44:18 +08:00
|
|
|
>
|
2026-05-14 16:25:10 +08:00
|
|
|
<Row gutter={[8, 8]}>
|
2026-05-14 12:44:18 +08:00
|
|
|
{roleOverview.map((role, idx) => (
|
|
|
|
|
<Col xs={24} sm={12} key={idx}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ background: role.bg, borderRadius: 8, padding: 8, height: '100%' }}>
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 4 }}>
|
|
|
|
|
{React.cloneElement(role.icon as React.ReactElement, { size: 16 })}
|
|
|
|
|
<RightOutlined style={{ fontSize: 9, color: role.color }} />
|
2026-05-14 12:44:18 +08:00
|
|
|
</div>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ fontWeight: 600, fontSize: 11, color: role.color, marginBottom: 2 }}>{role.title}</div>
|
|
|
|
|
<div style={{ fontSize: 9, color: '#8c8c8c', marginBottom: 6 }}>
|
|
|
|
|
用户 {role.users} | 权限 {role.perms}
|
2026-05-14 12:44:18 +08:00
|
|
|
</div>
|
|
|
|
|
<div style={{ display: 'flex', gap: 4, flexWrap: 'wrap' }}>
|
|
|
|
|
{role.tags.map((tag, tidx) => (
|
2026-05-14 16:25:10 +08:00
|
|
|
<span key={tidx} style={{ fontSize: 8, padding: '0 4px', background: '#fff', color: role.color, borderRadius: 2, border: `1px solid ${role.color}20` }}>{tag}</span>
|
2026-05-14 12:44:18 +08:00
|
|
|
))}
|
|
|
|
|
</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>}
|
2026-05-14 16:25:10 +08:00
|
|
|
extra={<Button type="link" size="small" style={{ fontSize: 11, padding: 0 }}>详情 <RightOutlined style={{ fontSize: 9 }} /></Button>}
|
2026-05-14 12:44:18 +08:00
|
|
|
bordered={false}
|
2026-05-14 17:23:12 +08:00
|
|
|
style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
2026-05-14 16:25:10 +08:00
|
|
|
bodyStyle={{ padding: '12px' }}
|
2026-05-14 12:44:18 +08:00
|
|
|
>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ display: 'flex', gap: 12 }}>
|
|
|
|
|
<div style={{ flex: '0 0 90px' }}>
|
2026-05-14 12:44:18 +08:00
|
|
|
{deviceStatuses.map((item, idx) => (
|
2026-05-14 16:25:10 +08:00
|
|
|
<div key={idx} style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 4 }}>
|
2026-05-14 12:44:18 +08:00
|
|
|
<Space size={4}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ width: 5, height: 5, borderRadius: '50%', background: '#52c41a' }} />
|
|
|
|
|
<span style={{ fontSize: 10, color: '#595959' }}>{item.name}</span>
|
2026-05-14 12:44:18 +08:00
|
|
|
</Space>
|
2026-05-14 16:25:10 +08:00
|
|
|
<span style={{ fontSize: 10, fontWeight: 500 }}>{item.count}</span>
|
2026-05-14 09:37:15 +08:00
|
|
|
</div>
|
2026-05-14 12:44:18 +08:00
|
|
|
))}
|
|
|
|
|
</div>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ flex: 1, position: 'relative', height: 130, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgba(22, 119, 255, 0.02)', borderRadius: 10 }}>
|
|
|
|
|
<svg width="100%" height="100%" viewBox="0 0 200 160" style={{ maxWidth: 180 }}>
|
2026-05-14 12:44:18 +08:00
|
|
|
<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>
|
2026-05-14 16:25:10 +08:00
|
|
|
<g stroke="#1677ff30" strokeWidth="0.8" strokeDasharray="3 2">
|
2026-05-14 12:44:18 +08:00
|
|
|
<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>
|
2026-05-14 16:25:10 +08:00
|
|
|
<circle cx="100" cy="80" r="14" fill="#1677ff" filter="url(#glow)" />
|
|
|
|
|
<rect x="93" y="73" width="14" height="14" rx="2" fill="none" stroke="#fff" strokeWidth="1.2" />
|
|
|
|
|
<path d="M96 76h8M96 80h8M96 84h8" stroke="#fff" strokeWidth="0.8" />
|
2026-05-14 12:44:18 +08:00
|
|
|
{[
|
2026-05-14 16:25:10 +08:00
|
|
|
{ x: 60, y: 40, icon: <Cpu size={10} />, label: '逆变器' },
|
|
|
|
|
{ x: 140, y: 40, icon: <Box size={10} />, label: '汇流箱' },
|
|
|
|
|
{ x: 160, y: 80, icon: <Wind size={10} />, label: '气象站' },
|
|
|
|
|
{ x: 140, y: 120, icon: <Camera size={10} />, label: '摄像头' },
|
|
|
|
|
{ x: 60, y: 120, icon: <Activity size={10} />, label: '机器人' },
|
|
|
|
|
{ x: 40, y: 80, icon: <Zap size={10} />, label: '接口' },
|
2026-05-14 12:44:18 +08:00
|
|
|
].map((node, i) => (
|
|
|
|
|
<g key={i}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<circle cx={node.x} cy={node.y} r="10" fill="#fff" stroke="#e8e8e8" strokeWidth="0.8" />
|
|
|
|
|
<foreignObject x={node.x - 5} y={node.y - 5} width="10" height="10">
|
2026-05-14 12:44:18 +08:00
|
|
|
<div style={{ color: '#1677ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>{node.icon}</div>
|
|
|
|
|
</foreignObject>
|
2026-05-14 16:25:10 +08:00
|
|
|
<text x={node.x} y={node.y + 16} textAnchor="middle" style={{ fontSize: 7, fill: '#8c8c8c' }}>{node.label}</text>
|
2026-05-14 12:44:18 +08:00
|
|
|
</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
|
2026-05-14 16:25:10 +08:00
|
|
|
title={<Space><Shield size={16} style={{ color: '#1677ff' }} /><b>数据与安全</b></Space>}
|
2026-05-14 12:44:18 +08:00
|
|
|
bordered={false}
|
2026-05-14 17:23:12 +08:00
|
|
|
style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
2026-05-14 16:25:10 +08:00
|
|
|
bodyStyle={{ padding: '12px' }}
|
2026-05-14 12:44:18 +08:00
|
|
|
>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(120px, 1fr))', gap: '10px 16px' }}>
|
2026-05-14 12:44:18 +08:00
|
|
|
{[
|
|
|
|
|
{ label: '数据保留', value: '3 年', icon: <DatabaseOutlined style={{ color: '#1677ff' }} /> },
|
|
|
|
|
{ label: '登录审计', value: '已开启', icon: <CheckCircleOutlined style={{ color: '#52c41a' }} />, color: '#52c41a' },
|
2026-05-14 16:25:10 +08:00
|
|
|
{ label: '自动备份', value: '02:00', icon: <RefreshCw size={12} color="#1677ff" /> },
|
|
|
|
|
{ label: 'API 密钥', value: '正常', icon: <Key size={12} color="#52c41a" />, color: '#52c41a' },
|
|
|
|
|
{ label: '最近备份', value: '2025-05-24 02:00', icon: <CalendarOutlined style={{ color: '#1677ff' }} /> },
|
|
|
|
|
{ label: 'SSL 证书', value: '有效期至 2026-12-31', icon: <SafetyCertificateOutlined style={{ color: '#fa8c16' }} /> },
|
|
|
|
|
{ label: '双因素认证', value: '已开启', icon: <Lock size={12} color="#52c41a" />, color: '#52c41a' },
|
2026-05-14 12:44:18 +08:00
|
|
|
].map((item, idx) => (
|
2026-05-14 16:25:10 +08:00
|
|
|
<div key={idx} style={{ gridColumn: item.isFull ? '1 / -1' : 'auto', display: 'flex', alignItems: 'center', gap: 6 }}>
|
|
|
|
|
<div style={{ width: 20, height: 20, borderRadius: 5, background: '#f8fafc', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
|
|
|
{React.isValidElement(item.icon) ? React.cloneElement(item.icon as React.ReactElement, { size: 12, style: { ...item.icon.props.style, fontSize: 12 } }) : item.icon}
|
2026-05-14 09:37:15 +08:00
|
|
|
</div>
|
2026-05-14 12:44:18 +08:00
|
|
|
<div style={{ flex: 1 }}>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ fontSize: 9, color: '#8c8c8c' }}>{item.label}</div>
|
|
|
|
|
<div style={{ fontSize: 10, fontWeight: 500, color: item.color || '#262626' }}>{item.value}</div>
|
2026-05-14 12:44:18 +08:00
|
|
|
</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
|
2026-05-14 16:25:10 +08:00
|
|
|
title={<Space><Wrench size={16} style={{ color: '#1677ff' }} /><b>系统维护</b></Space>}
|
|
|
|
|
extra={<Button type="link" size="small" danger style={{ fontSize: 10, padding: 0 }}>管理权限</Button>}
|
2026-05-14 12:44:18 +08:00
|
|
|
bordered={false}
|
2026-05-14 16:25:10 +08:00
|
|
|
style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
|
|
|
|
bodyStyle={{ padding: '12px' }}
|
2026-05-14 12:44:18 +08:00
|
|
|
>
|
2026-05-14 16:25:10 +08:00
|
|
|
<Row gutter={[8, 8]}>
|
2026-05-14 12:44:18 +08:00
|
|
|
{[
|
|
|
|
|
{ label: '清理缓存', icon: <DeleteOutlined />, color: '#1677ff' },
|
2026-05-14 16:25:10 +08:00
|
|
|
{ label: '重启服务', icon: <RefreshCw size={16} />, color: '#1677ff' },
|
2026-05-14 12:44:18 +08:00
|
|
|
{ label: '备份下载', icon: <DownloadOutlined />, color: '#1677ff' },
|
|
|
|
|
{ label: '日志导出', icon: <FileTextOutlined />, color: '#1677ff' },
|
|
|
|
|
].map((btn, idx) => (
|
|
|
|
|
<Col xs={12} sm={6} key={idx}>
|
|
|
|
|
<Button
|
2026-05-14 16:25:10 +08:00
|
|
|
size="small"
|
2026-05-14 12:44:18 +08:00
|
|
|
style={{
|
|
|
|
|
width: '100%',
|
2026-05-14 16:25:10 +08:00
|
|
|
height: 52,
|
2026-05-14 12:44:18 +08:00
|
|
|
display: 'flex',
|
|
|
|
|
flexDirection: 'column',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center',
|
2026-05-14 16:25:10 +08:00
|
|
|
borderRadius: 8,
|
|
|
|
|
gap: 2,
|
2026-05-14 12:44:18 +08:00
|
|
|
border: '1px solid #f0f0f0',
|
|
|
|
|
background: '#fff',
|
2026-05-14 16:25:10 +08:00
|
|
|
padding: '2px'
|
2026-05-14 12:44:18 +08:00
|
|
|
}}
|
|
|
|
|
>
|
2026-05-14 16:25:10 +08:00
|
|
|
<div style={{ color: btn.color, fontSize: 16 }}>
|
|
|
|
|
{React.isValidElement(btn.icon) ? React.cloneElement(btn.icon as React.ReactElement, { size: 16, style: { fontSize: 16 } }) : btn.icon}
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ fontSize: 10, color: '#595959' }}>{btn.label}</div>
|
2026-05-14 12:44:18 +08:00
|
|
|
</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
|
|
|
|