This commit is contained in:
mmc
2026-05-14 16:25:10 +08:00
parent 468f1a5cf0
commit 6cadb14a9c
4 changed files with 230 additions and 199 deletions

View File

@@ -167,119 +167,122 @@ const BasicSettings = () => {
]; ];
return ( 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) => ( {topCards.map((item, idx) => (
<Col key={idx} style={{ minWidth: '160px', flex: '1 0 auto' }}> <Col key={idx} xs={12} sm={8} md={4} style={{ flex: 1 }}>
<AntdCard <AntdCard bordered={false} bodyStyle={{ padding: '12px 16px' }} style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}>
size="small" <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
style={{ borderRadius: 8, width: '100%' }} <div style={{ width: 40, height: 40, borderRadius: 10, background: item.bg, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
bodyStyle={{ padding: '12px' }} {React.cloneElement(item.icon as React.ReactElement, { size: 20, style: item.icon.props.style ? { ...item.icon.props.style, fontSize: 20 } : { fontSize: 20 } })}
> </div>
<Space> <div style={{ flex: 1 }}>
<div style={{ background: item.bg, borderRadius: 8, padding: 8 }}> <div style={{ color: '#8c8c8c', fontSize: fontSmall, marginBottom: 2 }}>{item.title}</div>
{item.icon} <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>
<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>
</div> </div>
</Space>
</AntdCard> </AntdCard>
</Col> </Col>
))} ))}
</Row> </Row>
<Row gutter={16}> <Row gutter={12}>
{/* 左侧 */} {/* 左侧 */}
<Col xs={24} xl={17}> <Col xs={24} xl={17}>
{/* 基础配置 */} {/* 基础配置 */}
<AntdCard <AntdCard
title={<Space><SettingOutlined style={{ color: '#1677ff' }} /><b>基础配置</b></Space>} title={<Space><SettingOutlined style={{ color: '#1677ff' }} /><b>基础配置</b></Space>}
bordered={false} 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"> <Form form={form} layout="vertical">
<Row gutter={24}> <Row gutter={16}>
<Col xs={24} sm={12} md={8}> <Col xs={24} sm={12} md={8}>
<Form.Item label="系统名称" name="systemName"> <Form.Item label="系统名称" name="systemName" style={{ marginBottom: 12 }}>
<Input defaultValue="光伏电站智能监控与运维系统" /> <Input size="small" defaultValue="光伏电站智能监控与运维系统" />
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={12} md={8}> <Col xs={24} sm={12} md={8}>
<Form.Item label="默认电站" name="defaultSite"> <Form.Item label="默认电站" name="defaultSite" style={{ marginBottom: 12 }}>
<Select defaultValue="1MW 光伏电站"> <Select size="small" defaultValue="1MW 光伏电站">
<Select.Option value="1MW">1MW 光伏电站</Select.Option> <Select.Option value="1MW">1MW 光伏电站</Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={12} md={8}> <Col xs={24} sm={12} md={8}>
<Form.Item label="默认语言" name="defaultLang"> <Form.Item label="默认语言" name="defaultLang" style={{ marginBottom: 12 }}>
<Select defaultValue="zh"> <Select size="small" defaultValue="zh">
<Select.Option value="zh">中文</Select.Option> <Select.Option value="zh">中文</Select.Option>
<Select.Option value="en">English</Select.Option> <Select.Option value="en">English</Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={12} md={8}> <Col xs={24} sm={12} md={8}>
<Form.Item label="时区" name="timezone"> <Form.Item label="时区" name="timezone" style={{ marginBottom: 12 }}>
<Select defaultValue="UTC+08:00"> <Select size="small" defaultValue="UTC+08:00">
<Select.Option value="8">UTC+08:00</Select.Option> <Select.Option value="8">UTC+08:00</Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={12} md={8}> <Col xs={24} sm={12} md={8}>
<Form.Item label="首页默认页面" name="defaultPage"> <Form.Item label="首页默认页面" name="defaultPage" style={{ marginBottom: 12 }}>
<Select defaultValue="dashboard"> <Select size="small" defaultValue="dashboard">
<Select.Option value="dashboard">总览首页</Select.Option> <Select.Option value="dashboard">总览首页</Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={12} md={8}> <Col xs={24} sm={12} md={8}>
<Form.Item label="数据刷新频率" name="refreshRate"> <Form.Item label="数据刷新频率" name="refreshRate" style={{ marginBottom: 12 }}>
<Select defaultValue="5min"> <Select size="small" defaultValue="5min">
<Select.Option value="5min">5 分钟</Select.Option> <Select.Option value="5min">5 分钟</Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={12} md={8}> <Col xs={24} sm={12} md={8}>
<Form.Item label="地图服务" name="mapService"> <Form.Item label="地图服务" name="mapService" style={{ marginBottom: 12 }}>
<Select defaultValue="gaode"> <Select size="small" defaultValue="gaode">
<Select.Option value="gaode">高德地图</Select.Option> <Select.Option value="gaode">高德地图</Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} md={16}> <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> <Space>
<span style={{ fontSize: fontNormal }}>工单自动编号</span> <span style={{ fontSize: fontSmall }}>工单自动编号</span>
<Switch defaultChecked /> <Switch size="small" defaultChecked />
</Space> </Space>
<Space> <Space>
<span style={{ fontSize: fontNormal }}>AI建议自动生成</span> <span style={{ fontSize: fontSmall }}>AI建议自动生成</span>
<Switch defaultChecked /> <Switch size="small" defaultChecked />
</Space> </Space>
<Space> <Space>
<span style={{ fontSize: fontNormal }}>移动端同步</span> <span style={{ fontSize: fontSmall }}>移动端同步</span>
<Switch defaultChecked /> <Switch size="small" defaultChecked />
</Space> </Space>
</div> </div>
</Col> </Col>
</Row> </Row>
<div style={{ marginTop: 16 }}> <div style={{ marginTop: 12 }}>
<Button type="primary" onClick={handleSave} style={{ width: 120, borderRadius: 6, height: 36 }}>保存设置</Button> <Button type="primary" size="small" onClick={handleSave} style={{ width: 100, borderRadius: 6 }}>保存设置</Button>
<Button style={{ marginLeft: 12, borderRadius: 6, height: 36 }}>恢复默认</Button> <Button size="small" style={{ marginLeft: 8, borderRadius: 6 }}>恢复默认</Button>
</div> </div>
</Form> </Form>
</AntdCard> </AntdCard>
@@ -288,38 +291,39 @@ const BasicSettings = () => {
<AntdCard <AntdCard
title={<Space><BellOutlined style={{ color: '#1677ff' }} /><b>通知与告警策略</b></Space>} title={<Space><BellOutlined style={{ color: '#1677ff' }} /><b>通知与告警策略</b></Space>}
bordered={false} 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: <Smartphone size={16} />, color: '#52c41a', status: '已启用' },
{ label: '邮件', icon: <Mail size={18} />, color: '#1677ff', status: '已启用' }, { label: '邮件', icon: <Mail size={16} />, color: '#1677ff', status: '已启用' },
{ label: 'Telegram', icon: <Send size={18} />, color: '#13c2c2', status: '已启用' }, { label: 'Telegram', icon: <Send size={16} />, color: '#13c2c2', status: '已启用' },
{ label: '系统通知', icon: <BellOutlined />, color: '#fa8c16', status: '已启用' }, { label: '系统通知', icon: <BellOutlined style={{ fontSize: 16 }} />, color: '#fa8c16', status: '已启用' },
].map((item, idx) => ( ].map((item, idx) => (
<Col xs={24} sm={12} lg={6} key={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={{ display: 'flex', alignItems: 'center', padding: '10px 12px', background: '#f8fafc', borderRadius: 8, 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={{ 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 } })} {React.cloneElement(item.icon as React.ReactElement, { style: { color: item.color } })}
</div> </div>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<div style={{ fontSize: fontSmall, color: '#8c8c8c' }}>{item.label}</div> <div style={{ fontSize: 10, color: '#8c8c8c' }}>{item.label}</div>
<div style={{ fontSize: fontSmall, color: '#52c41a' }}>{item.status}</div> <div style={{ fontSize: 10, color: '#52c41a' }}>{item.status}</div>
</div> </div>
<Switch size="small" defaultChecked /> <Switch size="small" defaultChecked />
</div> </div>
</Col> </Col>
))} ))}
</Row> </Row>
<Row gutter={[32, 16]}> <Row gutter={[24, 12]}>
<Col xs={24} sm={12} md={8}><Space><span>严重告警立即通知</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><span>发电下降超过 15%</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><span>通信中断通知</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><span>每日汇总推送</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}> <Col xs={24} md={16}>
<Space size="middle" style={{ flexWrap: 'wrap' }}> <Space size="middle" style={{ flexWrap: 'wrap' }}>
<span>夜间免打扰</span> <span style={{ fontSize: fontSmall }}>夜间免打扰</span>
<TimePicker.RangePicker size="small" defaultValue={[dayjs('23:00', 'HH:mm'), dayjs('07:00', 'HH:mm')]} format="HH:mm" /> <TimePicker.RangePicker size="small" defaultValue={[dayjs('23:00', 'HH:mm'), dayjs('07:00', 'HH:mm')]} format="HH:mm" style={{ width: 140 }} />
<Switch size="small" /> <Switch size="small" />
</Space> </Space>
</Col> </Col>
@@ -328,20 +332,22 @@ const BasicSettings = () => {
{/* 用户与权限预览 */} {/* 用户与权限预览 */}
<AntdCard <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} 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 <Table
size="small" size="small"
scroll={{ x: 'max-content' }} scroll={{ x: 'max-content' }}
pagination={{ size: 'small', total: 4, pageSize: 4, showTotal: (total) => `共 ${total} 条` }} pagination={{ size: 'small', total: 4, pageSize: 4, showTotal: (total) => `共 ${total} 条` }}
columns={[ columns={[
{ title: '用户名', dataIndex: 'name', key: 'name', fixed: 'left' }, { title: '用户名', dataIndex: 'name', key: 'name', fixed: 'left', width: 80 },
{ {
title: '角色', title: '角色',
dataIndex: 'role', dataIndex: 'role',
key: 'role', key: 'role',
width: 100,
render: (role) => { render: (role) => {
const config: any = { const config: any = {
'超级管理员': { color: '#1677ff', bg: '#e6f4ff' }, '超级管理员': { color: '#1677ff', bg: '#e6f4ff' },
@@ -350,23 +356,24 @@ const BasicSettings = () => {
'数据分析师': { color: '#722ed1', bg: '#f9f0ff' }, '数据分析师': { color: '#722ed1', bg: '#f9f0ff' },
}; };
const s = config[role] || { color: '#8c8c8c', bg: '#f5f5f5' }; 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: 'phone', key: 'phone', width: 110 },
{ title: '邮箱', dataIndex: 'email', key: 'email' }, { title: '邮箱', dataIndex: 'email', key: 'email', ellipsis: true },
{ {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
width: 70,
render: (status) => ( render: (status) => (
<Space size={4}> <Space size={4}>
<div style={{ width: 6, height: 6, borderRadius: '50%', background: status === '在线' ? '#52c41a' : '#bfbfbf' }} /> <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> </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={[ dataSource={[
{ name: '张运维', role: '超级管理员', phone: '138****0001', email: 'zhangyw@pvsmart.com', status: '在线' }, { name: '张运维', role: '超级管理员', phone: '138****0001', email: 'zhangyw@pvsmart.com', status: '在线' },
@@ -382,26 +389,26 @@ const BasicSettings = () => {
<Col xs={24} xl={7}> <Col xs={24} xl={7}>
{/* 角色权限概览 */} {/* 角色权限概览 */}
<AntdCard <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} 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: '12px' }} bodyStyle={{ padding: '10px' }}
> >
<Row gutter={[12, 12]}> <Row gutter={[8, 8]}>
{roleOverview.map((role, idx) => ( {roleOverview.map((role, idx) => (
<Col xs={24} sm={12} key={idx}> <Col xs={24} sm={12} key={idx}>
<div style={{ background: role.bg, borderRadius: 10, padding: 10, height: '100%' }}> <div style={{ background: role.bg, borderRadius: 8, padding: 8, height: '100%' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 8 }}> <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 4 }}>
{role.icon} {React.cloneElement(role.icon as React.ReactElement, { size: 16 })}
<RightOutlined style={{ fontSize: 10, color: role.color }} /> <RightOutlined style={{ fontSize: 9, color: role.color }} />
</div> </div>
<div style={{ fontWeight: 600, fontSize: fontSmall, color: role.color, marginBottom: 4 }}>{role.title}</div> <div style={{ fontWeight: 600, fontSize: 11, color: role.color, marginBottom: 2 }}>{role.title}</div>
<div style={{ fontSize: 10, color: '#8c8c8c', marginBottom: 8 }}> <div style={{ fontSize: 9, color: '#8c8c8c', marginBottom: 6 }}>
用户 {role.users} 人 | 权限 {role.perms} 项 用户 {role.users} | 权限 {role.perms}
</div> </div>
<div style={{ display: 'flex', gap: 4, flexWrap: 'wrap' }}> <div style={{ display: 'flex', gap: 4, flexWrap: 'wrap' }}>
{role.tags.map((tag, tidx) => ( {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>
</div> </div>
@@ -413,34 +420,32 @@ const BasicSettings = () => {
{/* 设备接入状态 */} {/* 设备接入状态 */}
<AntdCard <AntdCard
title={<Space><ApiOutlined style={{ color: '#1677ff' }} /><b>设备接入状态</b></Space>} 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} 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' }} bodyStyle={{ padding: '12px' }}
> >
<div style={{ display: 'flex', gap: 20 }}> <div style={{ display: 'flex', gap: 12 }}>
<div style={{ flex: '0 0 100px' }}> <div style={{ flex: '0 0 90px' }}>
{deviceStatuses.map((item, idx) => ( {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}> <Space size={4}>
<div style={{ width: 6, height: 6, borderRadius: '50%', background: '#52c41a' }} /> <div style={{ width: 5, height: 5, borderRadius: '50%', background: '#52c41a' }} />
<span style={{ fontSize: 11, color: '#595959' }}>{item.name}</span> <span style={{ fontSize: 10, color: '#595959' }}>{item.name}</span>
</Space> </Space>
<span style={{ fontSize: 11, fontWeight: 500 }}>{item.count}</span> <span style={{ fontSize: 10, fontWeight: 500 }}>{item.count}</span>
</div> </div>
))} ))}
</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 }}> <div style={{ flex: 1, position: 'relative', height: 130, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgba(22, 119, 255, 0.02)', borderRadius: 10 }}>
{/* SVG 拓扑图:使用百分比和 viewBox 保证缩放比一致性 */} <svg width="100%" height="100%" viewBox="0 0 200 160" style={{ maxWidth: 180 }}>
<svg width="100%" height="100%" viewBox="0 0 200 160" style={{ maxWidth: 240 }}>
<defs> <defs>
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%"> <filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur stdDeviation="3" result="blur" /> <feGaussianBlur stdDeviation="3" result="blur" />
<feComposite in="SourceGraphic" in2="blur" operator="over" /> <feComposite in="SourceGraphic" in2="blur" operator="over" />
</filter> </filter>
</defs> </defs>
{/* 动态连线 */} <g stroke="#1677ff30" strokeWidth="0.8" strokeDasharray="3 2">
<g stroke="#1677ff40" strokeWidth="1" strokeDasharray="4 2">
<line x1="100" y1="80" x2="60" y2="40" /> <line x1="100" y1="80" x2="60" y2="40" />
<line x1="100" y1="80" x2="140" 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="160" y2="80" />
@@ -448,26 +453,23 @@ const BasicSettings = () => {
<line x1="100" y1="80" x2="60" y2="120" /> <line x1="100" y1="80" x2="60" y2="120" />
<line x1="100" y1="80" x2="40" y2="80" /> <line x1="100" y1="80" x2="40" y2="80" />
</g> </g>
{/* 中心核心节点 */} <circle cx="100" cy="80" r="14" fill="#1677ff" filter="url(#glow)" />
<circle cx="100" cy="80" r="18" fill="#1677ff" filter="url(#glow)" /> <rect x="93" y="73" width="14" height="14" rx="2" fill="none" stroke="#fff" strokeWidth="1.2" />
<rect x="91" y="71" width="18" height="18" rx="3" fill="none" stroke="#fff" strokeWidth="1.5" /> <path d="M96 76h8M96 80h8M96 84h8" stroke="#fff" strokeWidth="0.8" />
<path d="M95 75h10M95 80h10M95 85h10" stroke="#fff" strokeWidth="1.2" />
{/* 周边子节点 */}
{[ {[
{ x: 60, y: 40, icon: <Cpu size={12} />, label: '逆变器' }, { x: 60, y: 40, icon: <Cpu size={10} />, label: '逆变器' },
{ x: 140, y: 40, icon: <Box size={12} />, label: '汇流箱' }, { x: 140, y: 40, icon: <Box size={10} />, label: '汇流箱' },
{ x: 160, y: 80, icon: <Wind size={12} />, label: '气象站' }, { x: 160, y: 80, icon: <Wind size={10} />, label: '气象站' },
{ x: 140, y: 120, icon: <Camera size={12} />, label: '摄像头' }, { x: 140, y: 120, icon: <Camera size={10} />, label: '摄像头' },
{ x: 60, y: 120, icon: <Activity size={12} />, label: '机器人' }, { x: 60, y: 120, icon: <Activity size={10} />, label: '机器人' },
{ x: 40, y: 80, icon: <Zap size={12} />, label: '接口' }, { x: 40, y: 80, icon: <Zap size={10} />, label: '接口' },
].map((node, i) => ( ].map((node, i) => (
<g key={i}> <g key={i}>
<circle cx={node.x} cy={node.y} r="12" fill="#fff" stroke="#e8e8e8" strokeWidth="1" /> <circle cx={node.x} cy={node.y} r="10" fill="#fff" stroke="#e8e8e8" strokeWidth="0.8" />
<foreignObject x={node.x - 6} y={node.y - 6} width="12" height="12"> <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> <div style={{ color: '#1677ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>{node.icon}</div>
</foreignObject> </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> </g>
))} ))}
</svg> </svg>
@@ -477,28 +479,28 @@ const BasicSettings = () => {
{/* 数据与安全 */} {/* 数据与安全 */}
<AntdCard <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} 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' }} 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: '3 年', icon: <DatabaseOutlined style={{ color: '#1677ff' }} /> },
{ label: '登录审计', value: '已开启', icon: <CheckCircleOutlined style={{ color: '#52c41a' }} />, color: '#52c41a' }, { label: '登录审计', value: '已开启', icon: <CheckCircleOutlined style={{ color: '#52c41a' }} />, color: '#52c41a' },
{ label: '每日自动备份', value: '02:00', icon: <RefreshCw size={14} color="#1677ff" /> }, { label: '自动备份', value: '02:00', icon: <RefreshCw size={12} color="#1677ff" /> },
{ label: 'API 密钥管理', value: '正常', icon: <Key size={14} color="#52c41a" />, color: '#52c41a' }, { label: 'API 密钥', value: '正常', icon: <Key size={12} color="#52c41a" />, color: '#52c41a' },
{ label: '最近备份时间', value: '2025-05-24 02:00', icon: <CalendarOutlined style={{ color: '#1677ff' }} />, isFull: true }, { label: '最近备份', value: '2025-05-24 02:00', icon: <CalendarOutlined style={{ color: '#1677ff' }} /> },
{ label: 'SSL 证书', value: '有效期至 2026-12-31', icon: <SafetyCertificateOutlined style={{ color: '#fa8c16' }} />, isFull: true }, { label: 'SSL 证书', value: '有效期至 2026-12-31', icon: <SafetyCertificateOutlined style={{ color: '#fa8c16' }} /> },
{ label: '双因素认证', value: '已开启', icon: <Lock size={14} color="#52c41a" />, color: '#52c41a' }, { label: '双因素认证', value: '已开启', icon: <Lock size={12} color="#52c41a" />, color: '#52c41a' },
].map((item, idx) => ( ].map((item, idx) => (
<div key={idx} style={{ gridColumn: item.isFull ? '1 / -1' : 'auto', display: 'flex', alignItems: 'center', gap: 8 }}> <div key={idx} style={{ gridColumn: item.isFull ? '1 / -1' : 'auto', display: 'flex', alignItems: 'center', gap: 6 }}>
<div style={{ width: 24, height: 24, borderRadius: 6, background: '#f8fafc', display: 'flex', alignItems: 'center', justifyContent: 'center' }}> <div style={{ width: 20, height: 20, borderRadius: 5, background: '#f8fafc', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
{item.icon} {React.isValidElement(item.icon) ? React.cloneElement(item.icon as React.ReactElement, { size: 12, style: { ...item.icon.props.style, fontSize: 12 } }) : item.icon}
</div> </div>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<div style={{ fontSize: fontSmall, color: '#8c8c8c' }}>{item.label}</div> <div style={{ fontSize: 9, color: '#8c8c8c' }}>{item.label}</div>
<div style={{ fontSize: fontNormal, fontWeight: 500, color: item.color || '#262626' }}>{item.value}</div> <div style={{ fontSize: 10, fontWeight: 500, color: item.color || '#262626' }}>{item.value}</div>
</div> </div>
</div> </div>
))} ))}
@@ -507,37 +509,40 @@ const BasicSettings = () => {
{/* 系统维护 */} {/* 系统维护 */}
<AntdCard <AntdCard
title={<Space><Wrench size={18} style={{ color: '#1677ff' }} /><b>系统维护</b></Space>} title={<Space><Wrench size={16} style={{ color: '#1677ff' }} /><b>系统维护</b></Space>}
extra={<Button type="link" size="small" danger style={{ fontSize: fontSmall }}>操作需管理员权限</Button>} extra={<Button type="link" size="small" danger style={{ fontSize: 10, padding: 0 }}>管理权限</Button>}
bordered={false} bordered={false}
style={{ borderRadius: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.05)' }} style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
bodyStyle={{ padding: '16px' }} bodyStyle={{ padding: '12px' }}
> >
<Row gutter={[12, 12]}> <Row gutter={[8, 8]}>
{[ {[
{ label: '清理缓存', icon: <DeleteOutlined />, color: '#1677ff' }, { 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: <DownloadOutlined />, color: '#1677ff' },
{ label: '日志导出', icon: <FileTextOutlined />, color: '#1677ff' }, { label: '日志导出', icon: <FileTextOutlined />, color: '#1677ff' },
].map((btn, idx) => ( ].map((btn, idx) => (
<Col xs={12} sm={6} key={idx}> <Col xs={12} sm={6} key={idx}>
<Button <Button
size="small"
style={{ style={{
width: '100%', width: '100%',
height: 'clamp(56px, 5vw, 64px)', height: 52,
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
borderRadius: 10, borderRadius: 8,
gap: 4, gap: 2,
border: '1px solid #f0f0f0', border: '1px solid #f0f0f0',
background: '#fff', background: '#fff',
padding: '4px' padding: '2px'
}} }}
> >
<div style={{ color: btn.color, fontSize: 'clamp(16px, 1.2vw, 20px)' }}>{btn.icon}</div> <div style={{ color: btn.color, fontSize: 16 }}>
<div style={{ fontSize: fontSmall, color: '#595959' }}>{btn.label}</div> {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> </Button>
</Col> </Col>
))} ))}

View File

@@ -106,29 +106,30 @@ export default function WayLinePage() {
]; ];
return ( return (
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '16px 24px' }}> <div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '0' }}>
{/* 顶部统计卡片 */}
<Row gutter={[12, 12]} style={{ marginBottom: 16 }}>
<Row gutter={[8, 8]} style={{ marginBottom: 10 }}>
{topCards.map((item, index) => ( {topCards.map((item, index) => (
<Col xs={12} sm={8} md={4} key={index}> <Col xs={12} sm={8} md={4} key={index}>
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={cardStyle}> <Card bordered={false} bodyStyle={{ padding: '12px 14px' }} style={cardStyle}>
<div style={{ display: 'flex', alignItems: 'center', gap: 14 }}> <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
<div style={{ <div style={{
width: 44, height: 44, width: 36, height: 36,
background: item.bg, background: item.bg,
borderRadius: 12, borderRadius: 10,
display: 'flex', justifyContent: 'center', alignItems: 'center', display: 'flex', justifyContent: 'center', alignItems: 'center',
color: item.color color: item.color
}}> }}>
{item.icon} {React.cloneElement(item.icon as React.ReactElement, { size: 18 })}
</div> </div>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<div style={{ fontSize: fontSmall, color: '#86909C', marginBottom: 2 }}>{item.title}</div> <div style={{ fontSize: 10, color: '#86909C', marginBottom: 0 }}>{item.title}</div>
<div style={{ display: 'flex', alignItems: 'baseline', gap: 4 }}> <div style={{ display: 'flex', alignItems: 'baseline', gap: 4 }}>
<span style={{ fontSize: fontLarge, fontWeight: 700, color: '#1D2129' }}>{item.value}</span> <span style={{ fontSize: 'clamp(16px, 1vw, 20px)', fontWeight: 700, color: '#1D2129' }}>{item.value}</span>
<span style={{ fontSize: fontSmall, color: '#4E5969' }}>{item.unit}</span> <span style={{ fontSize: 9, color: '#4E5969' }}>{item.unit}</span>
</div> </div>
<div style={{ fontSize: 10, color: item.trendColor || '#86909C', fontWeight: 500 }}> <div style={{ fontSize: 9, color: item.trendColor || '#86909C', fontWeight: 500, lineHeight: 1 }}>
{item.trend || item.desc} {item.trend || item.desc}
</div> </div>
</div> </div>
@@ -139,27 +140,27 @@ export default function WayLinePage() {
</Row> </Row>
{/* 中间主要内容区 */} {/* 中间主要内容区 */}
<Row gutter={16} style={{ marginBottom: 16 }}> <Row gutter={10} style={{ marginBottom: 10 }}>
{/* 左侧:航线编辑与路径规划 */} {/* 左侧:航线编辑与路径规划 */}
<Col xs={24} xl={14}> <Col xs={24} xl={14} style={{ display: "flex", flexDirection: "column" }}>
<Card <Card
title={<span style={{ fontSize: fontTitle, fontWeight: 700, color: '#1D2129' }}>航线编辑与路径规划</span>} title={<span style={{ fontSize: fontNormal, fontWeight: 700, color: '#1D2129' }}>航线编辑与路径规划</span>}
size="small"
extra={ extra={
<Space size={8}> <Space size={4}>
<Button size="small" icon={<PlusOutlined />} style={{ borderRadius: 6 }}>新增航线</Button> <Button size="small" icon={<PlusOutlined />} style={{ borderRadius: 4, fontSize: 11 }}>新增</Button>
<Button size="small" icon={<ImportOutlined />} style={{ borderRadius: 6 }}>导入模板</Button> <Button size="small" icon={<ImportOutlined />} style={{ borderRadius: 4, fontSize: 11 }}>导入</Button>
<Button size="small" icon={<NodeIndexOutlined />} style={{ borderRadius: 6 }}>路径优化</Button> <Button size="small" icon={<NodeIndexOutlined />} style={{ borderRadius: 4, fontSize: 11 }}>优化</Button>
<Button size="small" icon={<SafetyCertificateOutlined />} style={{ borderRadius: 6 }}>风险检查</Button> <Button size="small" icon={<SaveOutlined />} style={{ borderRadius: 4, fontSize: 11 }}>保存</Button>
<Button size="small" icon={<SaveOutlined />} style={{ borderRadius: 6 }}>保存草稿</Button> <Button size="small" icon={<Maximize2 size={12} />} style={{ borderRadius: 4 }} />
<Button size="small" icon={<Maximize2 size={14} />} style={{ borderRadius: 6 }} />
</Space> </Space>
} }
bordered={false} bordered={false}
bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden' }} bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden' }}
style={{ ...cardStyle, marginBottom: 16 }} style={{ ...cardStyle, marginBottom: 10 }}
> >
{/* 地图区域 */} {/* 地图区域 */}
<div style={{ width: '100%', height: 500, background: '#e8f3ff url(https://picsum.photos/seed/solar_map_v2/1600/1000) center/cover', position: 'relative' }}> <div style={{ width: '100%', height: 420, background: '#e8f3ff url(https://picsum.photos/seed/solar_map_v2/1600/1000) center/cover', position: 'relative' }}>
{/* SVG 航线与区域覆盖 */} {/* SVG 航线与区域覆盖 */}
<svg style={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', pointerEvents: 'none' }}> <svg style={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', pointerEvents: 'none' }}>
{/* 航线 1 (蓝色) */} {/* 航线 1 (蓝色) */}
@@ -227,16 +228,30 @@ export default function WayLinePage() {
{/* 航点列表 */} {/* 航点列表 */}
<Card <Card
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>航点列表 <Text type="secondary" style={{ fontSize: 11, fontWeight: 400, marginLeft: 12 }}>航线:FL-03 (无人机热斑巡检)</Text></span>} title={<span style={{ fontSize: fontNormal, fontWeight: 700 }}>航点列表 <Text type="secondary" style={{ fontSize: 10, fontWeight: 400, marginLeft: 8 }}>航线:FL-03</Text></span>}
extra={<PlusOutlined style={{ cursor: 'pointer', color: '#165DFF' }} />} size="small"
extra={<PlusOutlined style={{ cursor: 'pointer', color: '#165DFF', fontSize: 12 }} />}
bordered={false} bordered={false}
bodyStyle={{ padding: 0 }} bodyStyle={{ padding: 0, height: "100%" }}
style={cardStyle} style={{
...cardStyle,
flex: 1,
display: "flex",
flexDirection: "column",
height: "100%",
}}
> >
<div style={{
flex: 1,
height: "100%",
position: "relative",
}}>
<Table <Table
size="small" size="small"
pagination={false} pagination={false}
scroll={{ y: 220 }} scroll={{
y: "auto",
}}
dataSource={[ dataSource={[
{ key: '1', point: 'WP-01', coord: '30.32921, 120.12345', action: '起飞', height: 35, speed: 6.0, stay: 0, remark: '从机场起飞' }, { key: '1', point: 'WP-01', coord: '30.32921, 120.12345', action: '起飞', height: 35, speed: 6.0, stay: 0, remark: '从机场起飞' },
{ key: '2', point: 'WP-02', coord: '区块 B-01', action: '拍摄', height: 35, speed: 6.0, stay: 2, remark: '组件可见光' }, { key: '2', point: 'WP-02', coord: '区块 B-01', action: '拍摄', height: 35, speed: 6.0, stay: 2, remark: '组件可见光' },
@@ -254,7 +269,9 @@ export default function WayLinePage() {
{ title: '停留(s)', dataIndex: 'stay', width: 70 }, { title: '停留(s)', dataIndex: 'stay', width: 70 },
{ title: '备注', dataIndex: 'remark', ellipsis: true }, { title: '备注', dataIndex: 'remark', ellipsis: true },
]} ]}
style={{ height: "100%" }}
/> />
</div>
</Card> </Card>
</Col> </Col>

View File

@@ -393,7 +393,7 @@ export default function CleanOptimizationPage() {
<Card <Card
title={<span style={{ fontSize: 15, fontWeight: 700 }}>电站污染分布与建议清洗区块分布图</span>} title={<span style={{ fontSize: 15, fontWeight: 700 }}>电站污染分布与建议清洗区块分布图</span>}
bordered={false} bordered={false}
style={{ ...cardStyle, flex: 1 }} style={{ ...cardStyle, }}
bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden', minHeight: 500 }} bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden', minHeight: 500 }}
> >
<div style={{ background: '#f8fafc', padding: '10px 20px', display: 'flex', justifyContent: 'space-between', borderBottom: '1px solid #f0f0f0', flexWrap: 'wrap', gap: 8 }}> <div style={{ background: '#f8fafc', padding: '10px 20px', display: 'flex', justifyContent: 'space-between', borderBottom: '1px solid #f0f0f0', flexWrap: 'wrap', gap: 8 }}>

View File

@@ -163,16 +163,25 @@ export default function StationDashboard() {
{ title: '告警数量', value: '8', unit: '', sub: '未处理 5 / 已处理 3', color: '#F53F3F', bg: '#FFF1F0', icon: <BellOutlined /> }, { title: '告警数量', value: '8', unit: '', sub: '未处理 5 / 已处理 3', color: '#F53F3F', bg: '#FFF1F0', icon: <BellOutlined /> },
{ title: '节省运维成本', value: '¥ 36,540', unit: '', sub: '本月累计节省', color: '#FF7D00', bg: '#FFF7E8', icon: <MoneyCollectOutlined /> }, { title: '节省运维成本', value: '¥ 36,540', unit: '', sub: '本月累计节省', color: '#FF7D00', bg: '#FFF7E8', icon: <MoneyCollectOutlined /> },
].map((item, idx) => ( ].map((item, idx) => (
<Col key={idx} style={{ flex: "1 0 auto", minWidth: "200px" }}> <Col key={idx} style={{
<Card bordered={false} style={{ ...cardStyle, height: "100%", minWidth: "200px" }} bodyStyle={{ padding: '16px' }}> flex: '0 0 auto', // 关键:不拉伸
width: '240px', // 固定卡片宽度
maxWidth: '240px',
minWidth: '240px'
}}>
<Card
bordered={false}
style={{ ...cardStyle, height: "100%" }}
bodyStyle={{ padding: '16px' }}
>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}> <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div> <div>
<div style={{ color: '#000', fontSize: 'clamp(12px, 1vw, 14px)', fontWeight: 600, marginBottom: 8 }}>{item.title}</div> <div style={{ color: '#000', fontSize: '14px', fontWeight: 600, marginBottom: 8 }}>{item.title}</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}> <div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: item.color, fontSize: 'clamp(20px, 1.8vw, 24px)', fontWeight: 800 }}>{item.value}</span> <span style={{ color: item.color, fontSize: '24px', fontWeight: 800 }}>{item.value}</span>
{item.unit && <span style={{ color: '#666', fontSize: 'clamp(12px, 0.9vw, 14px)', marginLeft: 4 }}>{item.unit}</span>} {item.unit && <span style={{ color: '#666', fontSize: '14px', marginLeft: 4 }}>{item.unit}</span>}
</div> </div>
<div style={{ fontSize: 'clamp(10px, 0.8vw, 12px)', color: '#999', marginTop: 8 }}>{item.sub}</div> <div style={{ fontSize: '12px', color: '#999', marginTop: 8 }}>{item.sub}</div>
</div> </div>
<div style={{ <div style={{
width: 50, height: 50, background: item.bg, borderRadius: '50%', width: 50, height: 50, background: item.bg, borderRadius: '50%',