装备空竹界面

This commit is contained in:
mmc
2026-05-11 08:43:51 +08:00
parent d3fdbf9884
commit 0b514dbace
2 changed files with 222 additions and 65 deletions

View File

@@ -48,6 +48,13 @@
opacity: 1;
font-weight: 800;
}
.ant-card-head{
min-height:44px !important
}
.ant-card-body{
padding-top:12px !important;
}
@keyframes sunRotate {

View File

@@ -181,30 +181,30 @@ export default function EquipmentCooperationPage() {
</div>
</Card>
{/* 装备调度列表 */}
<Card title={<><SettingOutlined /> 装备调度列表</>} bordered={false} style={{ borderRadius: 12, marginBottom: 16 }}>
<Table
rowKey="id"
size="small"
pagination={false}
columns={[
{ title: '装备名称', dataIndex: 'name', width: 160 },
{ title: '类型', dataIndex: 'type', width: 100 },
{ title: '当前状态', dataIndex: 'status', width: 80, render: (s) => <Tag color={s === '作业中' ? 'processing' : s === '在线' ? 'success' : 'default'}>{s}</Tag> },
{ title: '模式', dataIndex: 'mode', width: 80 },
{ title: '电量', dataIndex: 'battery', width: 80, render: (v) => <Progress percent={v} size="small" status={v < 40 ? 'exception' : 'active'} /> },
{ title: '位置', dataIndex: 'position', width: 100 },
{ title: '当前任务', dataIndex: 'task', width: 120 },
{ title: '通讯状态', dataIndex: 'comm', width: 80, render: (v) => <Badge status="success" text={v} /> },
{ title: '操作', key: 'action', width: 100, render: () => <Space><Button size="small" type="text" icon={<EditOutlined />} /><Button size="small" type="text" icon={<SettingOutlined />} /></Space> }
]}
dataSource={scheduleList}
scroll={{ x: 'max-content' }}
/>
</Card>
{/* 任务执行时间线 + 环境信息 */}
<Row gutter={16}>
<Col xs={24} md={12}>
<Card title={<><SettingOutlined /> 装备调度列表</>} bordered={false} style={{ borderRadius: 12, marginBottom: 16 }}>
<Table
rowKey="id"
size="small"
pagination={false}
columns={[
{ title: '装备名称', dataIndex: 'name', width: 160 },
{ title: '类型', dataIndex: 'type', width: 100 },
{ title: '当前状态', dataIndex: 'status', width: 80, render: (s) => <Tag color={s === '作业中' ? 'processing' : s === '在线' ? 'success' : 'default'}>{s}</Tag> },
{ title: '模式', dataIndex: 'mode', width: 80 },
{ title: '电量', dataIndex: 'battery', width: 80, render: (v) => <Progress percent={v} size="small" status={v < 40 ? 'exception' : 'active'} /> },
{ title: '位置', dataIndex: 'position', width: 100 },
{ title: '当前任务', dataIndex: 'task', width: 120 },
{ title: '通讯状态', dataIndex: 'comm', width: 80, render: (v) => <Badge status="success" text={v} /> },
{ title: '操作', key: 'action', width: 100, render: () => <Space><Button size="small" type="text" icon={<EditOutlined />} /><Button size="small" type="text" icon={<SettingOutlined />} /></Space> }
]}
dataSource={scheduleList}
scroll={{ x: 'max-content' }}
/>
</Card>
</Col>
<Col xs={24} md={12}>
<Card title={<><ClockCircleOutlined /> 任务执行时间线</>} bordered={false} style={{ borderRadius: 12 }} extra={<div style={{ fontSize: 12, color: '#666' }}>今天 2025-05-24</div>}>
<Timeline mode="left">
@@ -218,35 +218,10 @@ export default function EquipmentCooperationPage() {
<div style={{ textAlign: 'center', marginTop: 12 }}><Button type="link">查看更多</Button></div>
</Card>
</Col>
<Col xs={24} md={12}>
<Card title={<><CloudOutlined /> 环境与飞行条件</>} bordered={false} style={{ borderRadius: 12 }}>
<Row gutter={[16, 16]}>
<Col span={12}><div style={{ fontSize: 12, color: '#999' }}>风速</div><div style={{ fontSize: 14 }}>2.6 m/s 轻风</div></Col>
<Col span={12}><div style={{ fontSize: 12, color: '#999' }}>温度</div><div style={{ fontSize: 14 }}>28.7℃ 适宜</div></Col>
<Col span={12}><div style={{ fontSize: 12, color: '#999' }}>辐照度</div><div style={{ fontSize: 14 }}>812 W/m² 较高</div></Col>
<Col span={12}><div style={{ fontSize: 12, color: '#999' }}>降雨概率</div><div style={{ fontSize: 14 }}>10% 低</div></Col>
<Col span={12}><div style={{ fontSize: 12, color: '#999' }}>GNSS状态</div><div style={{ fontSize: 14 }}>正常 定位稳定</div></Col>
<Col span={12}>
<div style={{ fontSize: 12, color: '#999' }}>禁飞状态</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
<div style={{ fontSize: 14 }}>未禁飞</div>
<Badge status="success" />
</div>
</Col>
</Row>
<div style={{ marginTop: 16, background: '#f6ffed', borderRadius: 8, padding: 10, display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<CheckCircleOutlined style={{ color: '#52c41a' }} />
<div>
<div style={{ fontSize: 13, fontWeight: 500 }}>适宜执行</div>
<div style={{ fontSize: 11, color: '#666' }}>可正常开展作业</div>
</div>
</div>
<Button type="primary" size="small">一键作业</Button>
</div>
</Card>
</Col>
</Row>
</Col>
{/* 右侧:设备控制面板 */}
@@ -567,22 +542,197 @@ export default function EquipmentCooperationPage() {
</Col>
</Row>
</Card>
<Card
title={<><span >环境与飞行条件</span></>}
bordered={false}
style={{ borderRadius: 12, marginBottom: 16 }}
bodyStyle={{ paddingBottom: "12px" }}
>
<div style={{ display: "flex", justifyContent: "space-between", gap: 12, alignItems: "center" }}>
{/* 左边六个数据项,统一加外边框和右边框分隔线 */}
<div style={{
display: "flex",
border: "1px solid #e8e8e8",
borderRadius: 12,
overflow: "hidden",
flex: 1,
}}>
{/* 风速 */}
<div style={{
flex: 1,
textAlign: 'center',
whiteSpace: "nowrap",
padding: "12px 4px",
borderRight: "1px solid #e8e8e8"
}}>
<div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>风速</div>
<div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>2.6 m/s</div>
<div style={{ fontSize: 11, color: '#666', fontWeight: 600, marginTop: 2 }}>轻风</div>
</div>
{/* 温度 */}
<div style={{
flex: 1,
textAlign: 'center',
whiteSpace: "nowrap",
padding: "12px 4px",
borderRight: "1px solid #e8e8e8"
}}>
<div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>温度</div>
<div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>28.7℃</div>
<div style={{ fontSize: 11, color: '#52c41a', fontWeight: 600, marginTop: 2 }}>适宜</div>
</div>
{/* 辐照度 */}
<div style={{
flex: 1,
textAlign: 'center',
whiteSpace: "nowrap",
padding: "12px 4px",
borderRight: "1px solid #e8e8e8"
}}>
<div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>辐照度</div>
<div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>812W/m²</div>
<div style={{ fontSize: 11, color: '#fa8c16', fontWeight: 600, marginTop: 2 }}>较高</div>
</div>
{/* 降雨概率 */}
<div style={{
flex: 1,
textAlign: 'center',
whiteSpace: "nowrap",
padding: "12px 4px",
borderRight: "1px solid #e8e8e8"
}}>
<div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>降雨概率</div>
<div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>10%</div>
<div style={{ fontSize: 11, color: '#52c41a', fontWeight: 600, marginTop: 2 }}>低</div>
</div>
{/* GNSS状态 */}
<div style={{
flex: 1,
textAlign: 'center',
whiteSpace: "nowrap",
padding: "12px 4px",
borderRight: "1px solid #e8e8e8"
}}>
<div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>GNSS状态</div>
<div style={{ fontSize: 14, fontWeight: 700, color: '#52c41a', marginTop: 2 }}>正常</div>
<div style={{ fontSize: 11, color: '#666', fontWeight: 600, marginTop: 2 }}>定位稳定</div>
</div>
{/* 禁飞状态 */}
<div style={{
flex: 1,
textAlign: 'center',
whiteSpace: "nowrap",
padding: "12px 4px"
}}>
<div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>禁飞状态</div>
<div style={{ fontSize: 14, fontWeight: 700, color: '#52c41a', marginTop: 2 }}>未禁飞</div>
<div style={{ fontSize: 11, color: '#666', fontWeight: 600, marginTop: 2 }}>可执行</div>
</div>
</div>
{/* 右侧“适宜执行”卡片,保留边框 */}
<div style={{
width: 110,
padding: '12px 8px',
borderRadius: 8,
background: '#f6ffed',
border: '1px solid #b7eb8f',
textAlign: 'center',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
gap: 4,
}}>
<div style={{ fontSize: 14, fontWeight: 700, color: '#52c41a' }}>适宜执行</div>
<div style={{
width: 18,
height: 18,
borderRadius: '50%',
background: '#52c41a',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}>
<CheckCircleOutlined style={{ fontSize: 12, color: '#fff' }} />
</div>
<div style={{ fontSize: 11, color: '#666' }}>可正常开展作业</div>
</div>
</div>
</Card>
{/* 控制日志/告警记录 */}
<Card title={<><SettingOutlined /> 控制日志 / 告警记录</>} bordered={false} style={{ borderRadius: 12 }} extra={<Button type="link" size="small">查看更多日志</Button>}>
<div style={{ maxHeight: 300, overflow: 'auto' }}>
{logs.map((log, idx) => (
<div key={idx} style={{ display: 'flex', justifyContent: 'space-between', padding: '8px 0', borderBottom: '1px solid #f0f0f0' }}>
<div style={{ fontSize: 12 }}>
<div style={{ color: '#999', marginBottom: 2 }}>{log.time}</div>
<div style={{ display: 'flex', gap: 8 }}>
<Tag size="small" color={log.type === '命令' ? 'blue' : log.type === '告警' ? 'orange' : 'default'}>{log.type}</Tag>
<div>{log.device} - {log.desc}</div>
</div>
</div>
{log.level && <Tag color="red" size="small">{log.level}</Tag>}
</div>
))}
<Card
title={<><SettingOutlined style={{ color: '#1890ff' }} /> <span style={{ color: '#1890ff' }}>控制日志 / 告警记录</span></>}
bordered={false}
style={{ borderRadius: 12 }}
extra={
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<Button size="small" style={{ borderRadius: 8, border: '1px solid #d9d9d9' }}>
全部级别 <span style={{ marginLeft: 4 }}>▼</span>
</Button>
</div>
}
>
<Table
rowKey="time"
size="small"
pagination={false}
dataSource={logs}
scroll={{ x: 'max-content' }}
columns={[
{
title: '时间',
dataIndex: 'time',
width: 100,
render: (text) => <span style={{ fontSize: 14 }}>{text}</span>
},
{
title: '设备',
dataIndex: 'device',
width: 120,
render: (text) => <span style={{ fontSize: 14 }}>{text}</span>
},
{
title: '类型',
dataIndex: 'type',
width: 80,
render: (text) => {
let color = '#52c41a';
if (text === '告警') color = '#fa8c16';
if (text === '事件') color = '#1890ff';
return (
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
<span style={{
width: 12,
height: 12,
borderRadius: 2,
background: color,
display: 'inline-block'
}} />
<span style={{ fontSize: 14 }}>{text}</span>
</div>
);
}
},
{
title: '描述',
dataIndex: 'desc',
render: (text) => <span style={{ fontSize: 14 }}>{text}</span>
},
{
title: '',
width: 80,
render: (_, record) => record.level ? (
<Tag color="red" style={{ fontSize: 12, padding: '0 6px', borderRadius: 4 }}>
{record.level}
</Tag>
) : null
}
]}
/>
<div style={{ textAlign: 'center', marginTop: 12 }}>
<Button type="link" style={{ fontSize: 16, color: '#1890ff' }}>查看更多日志</Button>
</div>
</Card>
</Col>