样式
This commit is contained in:
@@ -167,119 +167,122 @@ const BasicSettings = () => {
|
||||
];
|
||||
|
||||
return (
|
||||
<div style={{ padding: 'clamp(12px, 1.5vw, 24px)', background: '#f5f7fa', minHeight: '100vh' }}>
|
||||
|
||||
<div style={{ padding: 'clamp(10px, 1.2vw, 20px)', background: '#f5f7fa', minHeight: '100vh' }}>
|
||||
<div style={{ marginBottom: 12, display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||
<Title level={4} style={{ margin: 0, fontSize: fontLarge }}>系统设置</Title>
|
||||
<Space split={<Divider type="vertical" />}>
|
||||
<Button type="text" size="small" icon={<SettingOutlined />} style={{ color: '#1677ff', fontWeight: 600 }}>基础设置</Button>
|
||||
<Button type="text" size="small" icon={<UserOutlined />}>用户与角色</Button>
|
||||
<Button type="text" size="small" icon={<NotificationOutlined />}>通知策略</Button>
|
||||
<Button type="text" size="small" icon={<ApiOutlined />}>设备接入</Button>
|
||||
<Button type="text" size="small" icon={<SafetyCertificateOutlined />}>数据与安全</Button>
|
||||
<Button type="text" size="small" icon={<ToolOutlined />}>系统维护</Button>
|
||||
</Space>
|
||||
</div>
|
||||
|
||||
{/* 顶部统计卡片 */}
|
||||
<Row gutter={[16, 16]} style={{ marginBottom: 24, flexWrap: 'wrap' }}>
|
||||
<Row gutter={[10, 10]} style={{ marginBottom: 12 }}>
|
||||
{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}
|
||||
<Col key={idx} xs={12} sm={8} md={4} style={{ flex: 1 }}>
|
||||
<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 } })}
|
||||
</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 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>}
|
||||
</div>
|
||||
</div>
|
||||
</Space>
|
||||
</div>
|
||||
</AntdCard>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Row gutter={12}>
|
||||
{/* 左侧 */}
|
||||
<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)' }}
|
||||
style={{ borderRadius: 10, marginBottom: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
>
|
||||
<Form form={form} layout="vertical">
|
||||
<Row gutter={24}>
|
||||
<Row gutter={16}>
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<Form.Item label="系统名称" name="systemName">
|
||||
<Input defaultValue="光伏电站智能监控与运维系统" />
|
||||
<Form.Item label="系统名称" name="systemName" style={{ marginBottom: 12 }}>
|
||||
<Input size="small" defaultValue="光伏电站智能监控与运维系统" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<Form.Item label="默认电站" name="defaultSite">
|
||||
<Select defaultValue="1MW 光伏电站">
|
||||
<Form.Item label="默认电站" name="defaultSite" style={{ marginBottom: 12 }}>
|
||||
<Select size="small" defaultValue="1MW 光伏电站">
|
||||
<Select.Option value="1MW">1MW 光伏电站</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<Form.Item label="默认语言" name="defaultLang">
|
||||
<Select defaultValue="zh">
|
||||
<Form.Item label="默认语言" name="defaultLang" style={{ marginBottom: 12 }}>
|
||||
<Select size="small" 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">
|
||||
<Form.Item label="时区" name="timezone" style={{ marginBottom: 12 }}>
|
||||
<Select size="small" 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">
|
||||
<Form.Item label="首页默认页面" name="defaultPage" style={{ marginBottom: 12 }}>
|
||||
<Select size="small" defaultValue="dashboard">
|
||||
<Select.Option value="dashboard">总览首页</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<Form.Item label="数据刷新频率" name="refreshRate">
|
||||
<Select defaultValue="5min">
|
||||
<Form.Item label="数据刷新频率" name="refreshRate" style={{ marginBottom: 12 }}>
|
||||
<Select size="small" defaultValue="5min">
|
||||
<Select.Option value="5min">5 分钟</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<Form.Item label="地图服务" name="mapService">
|
||||
<Select defaultValue="gaode">
|
||||
<Form.Item label="地图服务" name="mapService" style={{ marginBottom: 12 }}>
|
||||
<Select size="small" defaultValue="gaode">
|
||||
<Select.Option value="gaode">高德地图</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={24} md={16}>
|
||||
<div style={{ display: 'flex', gap: 'clamp(8px, 1vw, 24px)', marginTop: 8, flexWrap: 'wrap' }}>
|
||||
<div style={{ display: 'flex', gap: 'clamp(8px, 1vw, 20px)', marginTop: 4, flexWrap: 'wrap' }}>
|
||||
<Space>
|
||||
<span style={{ fontSize: fontNormal }}>工单自动编号</span>
|
||||
<Switch defaultChecked />
|
||||
<span style={{ fontSize: fontSmall }}>工单自动编号</span>
|
||||
<Switch size="small" defaultChecked />
|
||||
</Space>
|
||||
<Space>
|
||||
<span style={{ fontSize: fontNormal }}>AI建议自动生成</span>
|
||||
<Switch defaultChecked />
|
||||
<span style={{ fontSize: fontSmall }}>AI建议自动生成</span>
|
||||
<Switch size="small" defaultChecked />
|
||||
</Space>
|
||||
<Space>
|
||||
<span style={{ fontSize: fontNormal }}>移动端同步</span>
|
||||
<Switch defaultChecked />
|
||||
<span style={{ fontSize: fontSmall }}>移动端同步</span>
|
||||
<Switch size="small" defaultChecked />
|
||||
</Space>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
<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 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>
|
||||
</div>
|
||||
</Form>
|
||||
</AntdCard>
|
||||
@@ -288,38 +291,39 @@ const BasicSettings = () => {
|
||||
<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)' }}
|
||||
style={{ borderRadius: 10, marginBottom: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
>
|
||||
<Row gutter={[16, 16]} style={{ marginBottom: 24 }}>
|
||||
<Row gutter={[12, 12]} style={{ marginBottom: 16 }}>
|
||||
{[
|
||||
{ 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: '已启用' },
|
||||
{ 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: '已启用' },
|
||||
].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 }}>
|
||||
<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 }}>
|
||||
{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 style={{ fontSize: 10, color: '#8c8c8c' }}>{item.label}</div>
|
||||
<div style={{ fontSize: 10, color: '#52c41a' }}>{item.status}</div>
|
||||
</div>
|
||||
<Switch size="small" defaultChecked />
|
||||
</div>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
<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>
|
||||
<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>
|
||||
<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" />
|
||||
<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 }} />
|
||||
<Switch size="small" />
|
||||
</Space>
|
||||
</Col>
|
||||
@@ -328,20 +332,22 @@ const BasicSettings = () => {
|
||||
|
||||
{/* 用户与权限预览 */}
|
||||
<AntdCard
|
||||
title={<Space><Users size={18} style={{ color: '#1677ff' }} /><b>用户与权限预览</b></Space>}
|
||||
title={<Space><Users size={16} style={{ color: '#1677ff' }} /><b>用户与权限预览</b></Space>}
|
||||
bordered={false}
|
||||
style={{ borderRadius: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.05)', marginBottom: 16 }}
|
||||
style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)', marginBottom: 0 }}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
>
|
||||
<Table
|
||||
size="small"
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{ size: 'small', total: 4, pageSize: 4, showTotal: (total) => `共 ${total} 条` }}
|
||||
columns={[
|
||||
{ title: '用户名', dataIndex: 'name', key: 'name', fixed: 'left' },
|
||||
{ title: '用户名', dataIndex: 'name', key: 'name', fixed: 'left', width: 80 },
|
||||
{
|
||||
title: '角色',
|
||||
dataIndex: 'role',
|
||||
key: 'role',
|
||||
width: 100,
|
||||
render: (role) => {
|
||||
const config: any = {
|
||||
'超级管理员': { color: '#1677ff', bg: '#e6f4ff' },
|
||||
@@ -350,23 +356,24 @@ const BasicSettings = () => {
|
||||
'数据分析师': { 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>;
|
||||
return <Tag bordered={false} style={{ color: s.color, background: s.bg, fontSize: 10, margin: 0 }}>{role}</Tag>;
|
||||
}
|
||||
},
|
||||
{ title: '手机号', dataIndex: 'phone', key: 'phone' },
|
||||
{ title: '邮箱', dataIndex: 'email', key: 'email' },
|
||||
{ title: '手机号', dataIndex: 'phone', key: 'phone', width: 110 },
|
||||
{ title: '邮箱', dataIndex: 'email', key: 'email', ellipsis: true },
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
width: 70,
|
||||
render: (status) => (
|
||||
<Space size={4}>
|
||||
<div style={{ width: 6, height: 6, borderRadius: '50%', background: status === '在线' ? '#52c41a' : '#bfbfbf' }} />
|
||||
<span style={{ fontSize: fontSmall }}>{status}</span>
|
||||
<span style={{ fontSize: 10 }}>{status}</span>
|
||||
</Space>
|
||||
)
|
||||
},
|
||||
{ title: '操作', key: 'action', render: () => <Button type="link" size="small">查看</Button>, fixed: 'right' },
|
||||
{ title: '操作', key: 'action', width: 60, render: () => <Button type="link" size="small" style={{ padding: 0, fontSize: 11 }}>查看</Button>, fixed: 'right' },
|
||||
]}
|
||||
dataSource={[
|
||||
{ name: '张运维', role: '超级管理员', phone: '138****0001', email: 'zhangyw@pvsmart.com', status: '在线' },
|
||||
@@ -382,26 +389,26 @@ const BasicSettings = () => {
|
||||
<Col xs={24} xl={7}>
|
||||
{/* 角色权限概览 */}
|
||||
<AntdCard
|
||||
title={<Space><Users size={18} style={{ color: '#1677ff' }} /><b>角色权限概览</b></Space>}
|
||||
title={<Space><Users size={16} 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' }}
|
||||
style={{ borderRadius: 10, marginBottom: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '10px' }}
|
||||
>
|
||||
<Row gutter={[12, 12]}>
|
||||
<Row gutter={[8, 8]}>
|
||||
{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 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 }} />
|
||||
</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 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}
|
||||
</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>
|
||||
<span key={tidx} style={{ fontSize: 8, padding: '0 4px', background: '#fff', color: role.color, borderRadius: 2, border: `1px solid ${role.color}20` }}>{tag}</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
@@ -413,34 +420,32 @@ const BasicSettings = () => {
|
||||
{/* 设备接入状态 */}
|
||||
<AntdCard
|
||||
title={<Space><ApiOutlined style={{ color: '#1677ff' }} /><b>设备接入状态</b></Space>}
|
||||
extra={<Button type="link" size="small">查看详情 <RightOutlined /></Button>}
|
||||
extra={<Button type="link" size="small" style={{ fontSize: 11, padding: 0 }}>详情 <RightOutlined style={{ fontSize: 9 }} /></Button>}
|
||||
bordered={false}
|
||||
style={{ borderRadius: 12, marginBottom: 16, boxShadow: '0 2px 8px rgba(0,0,0,0.05)' }}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
style={{ borderRadius: 10, marginBottom: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
>
|
||||
<div style={{ display: 'flex', gap: 20 }}>
|
||||
<div style={{ flex: '0 0 100px' }}>
|
||||
<div style={{ display: 'flex', gap: 12 }}>
|
||||
<div style={{ flex: '0 0 90px' }}>
|
||||
{deviceStatuses.map((item, idx) => (
|
||||
<div key={idx} style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 6 }}>
|
||||
<div key={idx} style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 4 }}>
|
||||
<Space size={4}>
|
||||
<div style={{ width: 6, height: 6, borderRadius: '50%', background: '#52c41a' }} />
|
||||
<span style={{ fontSize: 11, color: '#595959' }}>{item.name}</span>
|
||||
<div style={{ width: 5, height: 5, borderRadius: '50%', background: '#52c41a' }} />
|
||||
<span style={{ fontSize: 10, color: '#595959' }}>{item.name}</span>
|
||||
</Space>
|
||||
<span style={{ fontSize: 11, fontWeight: 500 }}>{item.count}</span>
|
||||
<span style={{ fontSize: 10, fontWeight: 500 }}>{item.count}</span>
|
||||
</div>
|
||||
))}
|
||||
</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 }}>
|
||||
<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 }}>
|
||||
<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">
|
||||
<g stroke="#1677ff30" strokeWidth="0.8" strokeDasharray="3 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" />
|
||||
@@ -448,26 +453,23 @@ const BasicSettings = () => {
|
||||
<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" />
|
||||
|
||||
{/* 周边子节点 */}
|
||||
<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" />
|
||||
{[
|
||||
{ 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: '接口' },
|
||||
{ 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: '接口' },
|
||||
].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">
|
||||
<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">
|
||||
<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>
|
||||
<text x={node.x} y={node.y + 16} textAnchor="middle" style={{ fontSize: 7, fill: '#8c8c8c' }}>{node.label}</text>
|
||||
</g>
|
||||
))}
|
||||
</svg>
|
||||
@@ -477,28 +479,28 @@ const BasicSettings = () => {
|
||||
|
||||
{/* 数据与安全 */}
|
||||
<AntdCard
|
||||
title={<Space><Shield size={18} style={{ color: '#1677ff' }} /><b>数据与安全</b></Space>}
|
||||
title={<Space><Shield size={16} 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' }}
|
||||
style={{ borderRadius: 10, marginBottom: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(140px, 1fr))', gap: '16px 24px' }}>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(120px, 1fr))', gap: '10px 16px' }}>
|
||||
{[
|
||||
{ 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' },
|
||||
{ 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' },
|
||||
].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}
|
||||
<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}
|
||||
</div>
|
||||
<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 style={{ fontSize: 9, color: '#8c8c8c' }}>{item.label}</div>
|
||||
<div style={{ fontSize: 10, fontWeight: 500, color: item.color || '#262626' }}>{item.value}</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
@@ -507,37 +509,40 @@ const BasicSettings = () => {
|
||||
|
||||
{/* 系统维护 */}
|
||||
<AntdCard
|
||||
title={<Space><Wrench size={18} style={{ color: '#1677ff' }} /><b>系统维护</b></Space>}
|
||||
extra={<Button type="link" size="small" danger style={{ fontSize: fontSmall }}>操作需管理员权限</Button>}
|
||||
title={<Space><Wrench size={16} style={{ color: '#1677ff' }} /><b>系统维护</b></Space>}
|
||||
extra={<Button type="link" size="small" danger style={{ fontSize: 10, padding: 0 }}>管理权限</Button>}
|
||||
bordered={false}
|
||||
style={{ borderRadius: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.05)' }}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
>
|
||||
<Row gutter={[12, 12]}>
|
||||
<Row gutter={[8, 8]}>
|
||||
{[
|
||||
{ label: '清理缓存', icon: <DeleteOutlined />, color: '#1677ff' },
|
||||
{ label: '重启服务', icon: <RefreshCw size={20} />, color: '#1677ff' },
|
||||
{ label: '重启服务', icon: <RefreshCw size={16} />, color: '#1677ff' },
|
||||
{ label: '备份下载', icon: <DownloadOutlined />, color: '#1677ff' },
|
||||
{ label: '日志导出', icon: <FileTextOutlined />, color: '#1677ff' },
|
||||
].map((btn, idx) => (
|
||||
<Col xs={12} sm={6} key={idx}>
|
||||
<Button
|
||||
size="small"
|
||||
style={{
|
||||
width: '100%',
|
||||
height: 'clamp(56px, 5vw, 64px)',
|
||||
height: 52,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
borderRadius: 10,
|
||||
gap: 4,
|
||||
borderRadius: 8,
|
||||
gap: 2,
|
||||
border: '1px solid #f0f0f0',
|
||||
background: '#fff',
|
||||
padding: '4px'
|
||||
padding: '2px'
|
||||
}}
|
||||
>
|
||||
<div style={{ color: btn.color, fontSize: 'clamp(16px, 1.2vw, 20px)' }}>{btn.icon}</div>
|
||||
<div style={{ fontSize: fontSmall, color: '#595959' }}>{btn.label}</div>
|
||||
<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>
|
||||
</Button>
|
||||
</Col>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user