diff --git a/src/components/SystemSetting/BasicSettings.tsx b/src/components/SystemSetting/BasicSettings.tsx index 9fed3e0..ca0915a 100644 --- a/src/components/SystemSetting/BasicSettings.tsx +++ b/src/components/SystemSetting/BasicSettings.tsx @@ -167,119 +167,122 @@ const BasicSettings = () => { ]; return ( -
- +
+
+ 系统设置 + }> + + + + + + + +
{/* 顶部统计卡片 */} - + {topCards.map((item, idx) => ( - - - -
- {item.icon} + + +
+
+ {React.cloneElement(item.icon as React.ReactElement, { size: 20, style: item.icon.props.style ? { ...item.icon.props.style, fontSize: 20 } : { fontSize: 20 } })}
-
-
{item.title}
-
- {item.value} - {item.tag && {item.tag}} - {item.trend && ( - - {item.trend} - - )} +
+
{item.title}
+
+ {item.value} + {item.tag && {item.tag}} + {item.trend && {item.trend}}
- +
))} - + {/* 左侧 */} {/* 基础配置 */} 基础配置} 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' }} >
- + - - + + - - 1MW 光伏电站 - - 中文 English - - UTC+08:00 - - 总览首页 - - 5 分钟 - - 高德地图 -
+
- 工单自动编号 - + 工单自动编号 + - AI建议自动生成 - + AI建议自动生成 + - 移动端同步 - + 移动端同步 +
-
- - +
+ +
@@ -288,38 +291,39 @@ const BasicSettings = () => { 通知与告警策略} 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' }} > - + {[ - { label: '短信', icon: , color: '#52c41a', status: '已启用' }, - { label: '邮件', icon: , color: '#1677ff', status: '已启用' }, - { label: 'Telegram', icon: , color: '#13c2c2', status: '已启用' }, - { label: '系统通知', icon: , color: '#fa8c16', status: '已启用' }, + { label: '短信', icon: , color: '#52c41a', status: '已启用' }, + { label: '邮件', icon: , color: '#1677ff', status: '已启用' }, + { label: 'Telegram', icon: , color: '#13c2c2', status: '已启用' }, + { label: '系统通知', icon: , color: '#fa8c16', status: '已启用' }, ].map((item, idx) => ( -
-
+
+
{React.cloneElement(item.icon as React.ReactElement, { style: { color: item.color } })}
-
{item.label}
-
{item.status}
+
{item.label}
+
{item.status}
))} - - 严重告警立即通知 - 发电下降超过 15% - 通信中断通知 - 每日汇总推送 + + 严重告警立即通知 + 发电下降超过 15% + 通信中断通知 + 每日汇总推送 - 夜间免打扰 - + 夜间免打扰 + @@ -328,20 +332,22 @@ const BasicSettings = () => { {/* 用户与权限预览 */} 用户与权限预览} + title={用户与权限预览} 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' }} > `共 ${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 {role}; + return {role}; } }, - { 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) => (
- {status} + {status} ) }, - { title: '操作', key: 'action', render: () => , fixed: 'right' }, + { title: '操作', key: 'action', width: 60, render: () => , fixed: 'right' }, ]} dataSource={[ { name: '张运维', role: '超级管理员', phone: '138****0001', email: 'zhangyw@pvsmart.com', status: '在线' }, @@ -382,26 +389,26 @@ const BasicSettings = () => {
{/* 角色权限概览 */} 角色权限概览} + title={角色权限概览} 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' }} > - + {roleOverview.map((role, idx) => ( -
-
- {role.icon} - +
+
+ {React.cloneElement(role.icon as React.ReactElement, { size: 16 })} +
-
{role.title}
-
- 用户 {role.users} 人 | 权限 {role.perms} 项 +
{role.title}
+
+ 用户 {role.users} | 权限 {role.perms}
{role.tags.map((tag, tidx) => ( - {tag} + {tag} ))}
@@ -413,34 +420,32 @@ const BasicSettings = () => { {/* 设备接入状态 */} 设备接入状态} - extra={} + extra={} 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' }} > -
-
+
+
{deviceStatuses.map((item, idx) => ( -
+
-
- {item.name} +
+ {item.name} - {item.count} + {item.count}
))}
-
- {/* SVG 拓扑图:使用百分比和 viewBox 保证缩放比一致性 */} - +
+ - {/* 动态连线 */} - + @@ -448,26 +453,23 @@ const BasicSettings = () => { - {/* 中心核心节点 */} - - - - - {/* 周边子节点 */} + + + {[ - { x: 60, y: 40, icon: , label: '逆变器' }, - { x: 140, y: 40, icon: , label: '汇流箱' }, - { x: 160, y: 80, icon: , label: '气象站' }, - { x: 140, y: 120, icon: , label: '摄像头' }, - { x: 60, y: 120, icon: , label: '机器人' }, - { x: 40, y: 80, icon: , label: '接口' }, + { x: 60, y: 40, icon: , label: '逆变器' }, + { x: 140, y: 40, icon: , label: '汇流箱' }, + { x: 160, y: 80, icon: , label: '气象站' }, + { x: 140, y: 120, icon: , label: '摄像头' }, + { x: 60, y: 120, icon: , label: '机器人' }, + { x: 40, y: 80, icon: , label: '接口' }, ].map((node, i) => ( - - + +
{node.icon}
- {node.label} + {node.label} ))} @@ -477,28 +479,28 @@ const BasicSettings = () => { {/* 数据与安全 */} 数据与安全} + title={数据与安全} 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' }} > -
+
{[ { label: '数据保留', value: '3 年', icon: }, { label: '登录审计', value: '已开启', icon: , color: '#52c41a' }, - { label: '每日自动备份', value: '02:00', icon: }, - { label: 'API 密钥管理', value: '正常', icon: , color: '#52c41a' }, - { label: '最近备份时间', value: '2025-05-24 02:00', icon: , isFull: true }, - { label: 'SSL 证书', value: '有效期至 2026-12-31', icon: , isFull: true }, - { label: '双因素认证', value: '已开启', icon: , color: '#52c41a' }, + { label: '自动备份', value: '02:00', icon: }, + { label: 'API 密钥', value: '正常', icon: , color: '#52c41a' }, + { label: '最近备份', value: '2025-05-24 02:00', icon: }, + { label: 'SSL 证书', value: '有效期至 2026-12-31', icon: }, + { label: '双因素认证', value: '已开启', icon: , color: '#52c41a' }, ].map((item, idx) => ( -
-
- {item.icon} +
+
+ {React.isValidElement(item.icon) ? React.cloneElement(item.icon as React.ReactElement, { size: 12, style: { ...item.icon.props.style, fontSize: 12 } }) : item.icon}
-
{item.label}
-
{item.value}
+
{item.label}
+
{item.value}
))} @@ -507,37 +509,40 @@ const BasicSettings = () => { {/* 系统维护 */} 系统维护} - extra={} + title={系统维护} + extra={} 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' }} > - + {[ { label: '清理缓存', icon: , color: '#1677ff' }, - { label: '重启服务', icon: , color: '#1677ff' }, + { label: '重启服务', icon: , color: '#1677ff' }, { label: '备份下载', icon: , color: '#1677ff' }, { label: '日志导出', icon: , color: '#1677ff' }, ].map((btn, idx) => (
))} diff --git a/src/components/devices/WayLinePage.tsx b/src/components/devices/WayLinePage.tsx index f67b8a9..0caecc9 100644 --- a/src/components/devices/WayLinePage.tsx +++ b/src/components/devices/WayLinePage.tsx @@ -106,29 +106,30 @@ export default function WayLinePage() { ]; return ( -
- {/* 顶部统计卡片 */} - +
+ + + {topCards.map((item, index) => (
- -
+ +
- {item.icon} + {React.cloneElement(item.icon as React.ReactElement, { size: 18 })}
-
{item.title}
+
{item.title}
- {item.value} - {item.unit} + {item.value} + {item.unit}
-
+
{item.trend || item.desc}
@@ -139,27 +140,27 @@ export default function WayLinePage() { {/* 中间主要内容区 */} - + {/* 左侧:航线编辑与路径规划 */} -
+ 航线编辑与路径规划} + title={航线编辑与路径规划} + size="small" extra={ - - - - - - - + + + +
{t} }, - { title: '坐标/区域', dataIndex: 'coord', width: 120, ellipsis: true }, - { title: '动作', dataIndex: 'action', width: 80, render: (a) => {a} }, - { title: '高度(m)', dataIndex: 'height', width: 70 }, - { title: '速度(m/s)', dataIndex: 'speed', width: 90 }, - { title: '停留(s)', dataIndex: 'stay', width: 70 }, - { title: '备注', dataIndex: 'remark', ellipsis: true }, - ]} - /> +
+
{t} }, + { title: '坐标/区域', dataIndex: 'coord', width: 120, ellipsis: true }, + { title: '动作', dataIndex: 'action', width: 80, render: (a) => {a} }, + { title: '高度(m)', dataIndex: 'height', width: 70 }, + { title: '速度(m/s)', dataIndex: 'speed', width: 90 }, + { title: '停留(s)', dataIndex: 'stay', width: 70 }, + { title: '备注', dataIndex: 'remark', ellipsis: true }, + ]} + style={{ height: "100%" }} + /> + diff --git a/src/pages/CleanOptimization.tsx b/src/pages/CleanOptimization.tsx index b47e679..cc31705 100644 --- a/src/pages/CleanOptimization.tsx +++ b/src/pages/CleanOptimization.tsx @@ -393,7 +393,7 @@ export default function CleanOptimizationPage() { 电站污染分布与建议清洗区块分布图} bordered={false} - style={{ ...cardStyle, flex: 1 }} + style={{ ...cardStyle, }} bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden', minHeight: 500 }} >
diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index cdd623c..ef5f9c0 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -163,16 +163,25 @@ export default function StationDashboard() { { title: '告警数量', value: '8', unit: '', sub: '未处理 5 / 已处理 3', color: '#F53F3F', bg: '#FFF1F0', icon: }, { title: '节省运维成本', value: '¥ 36,540', unit: '', sub: '本月累计节省', color: '#FF7D00', bg: '#FFF7E8', icon: }, ].map((item, idx) => ( -
- + +
-
{item.title}
+
{item.title}
- {item.value} - {item.unit && {item.unit}} + {item.value} + {item.unit && {item.unit}}
-
{item.sub}
+
{item.sub}