优化创建任务之后 需要重新获取无人机接口

This commit is contained in:
mmc
2026-05-27 15:26:29 +08:00
parent 2ab9e3715a
commit 834f93b947
4 changed files with 14 additions and 13 deletions

View File

@@ -381,7 +381,7 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
</Card>
<Card title={<><ApiOutlined /> AI分析与操作建议</>} bordered={false} style={{ borderRadius: 12, marginBottom: 8 }}>
<Row gutter={16} style={{ marginBottom: 20 }}>
<Row gutter={16} style={{ marginBottom: 8 }}>
<Col span={6}><div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '6px 12px 4px', borderRadius: 12, border: '1px solid #e8e8e8' }}><div style={{ width: 30, height: 30, borderRadius: '50%', background: 'rgba(255,77,79,0.15)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#ff4d4f', fontSize: 20 }}><span role="img" aria-label="hotspot">🔥</span></div><div><div style={{ fontSize: 11, color: '#666' }}>热斑疑似</div><div style={{ fontSize: 22, fontWeight: 700, color: '#222' }}>2 <span style={{ fontSize: 12 }}>处</span></div></div></div></Col>
<Col span={6}><div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '6px 12px 4px', borderRadius: 12, border: '1px solid #e8e8e8' }}><div style={{ width: 30, height: 30, borderRadius: '50%', background: 'rgba(82,196,26,0.15)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#52c41a', fontSize: 16 }}><BranchesOutlined /></div><div><div style={{ fontSize: 11, color: '#666' }}>杂草高发区</div><div style={{ fontSize: 22, fontWeight: 700, color: '#222' }}>3 <span style={{ fontSize: 12 }}>块</span></div></div></div></Col>
<Col span={6}><div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '6px 12px 4px', borderRadius: 12, border: '1px solid #e8e8e8' }}><div style={{ width: 30, height: 30, borderRadius: '50%', background: 'rgba(24,144,255,0.15)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#1890ff', fontSize: 16 }}><CloudOutlined /></div><div><div style={{ fontSize: 11, color: '#666' }}>组件风险区</div><div style={{ fontSize: 22, fontWeight: 700, color: '#222' }}>4 <span style={{ fontSize: 12 }}>块</span></div></div></div></Col>
@@ -390,7 +390,7 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
<Row gutter={16}>
<Col span={14}>
<div style={{ marginBottom: 12 }}>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1890ff', marginBottom: 12 }}>建议操作</div>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1890ff', marginBottom: 8 }}>建议操作</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 2, padding: '4px', borderRadius: 12, border: '1px solid #e8e8e8' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}><div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ color: '#1890ff' }}>⦿</span><span style={{ fontSize: 16 }}>优先执行巡检航线 P-03</span></div><ArrowRightOutlined style={{ color: '#666' }} /></div>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}><div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ color: '#1890ff' }}>⦿</span><span style={{ fontSize: 16 }}>先行安排除草任务 G-02</span></div><ArrowRightOutlined style={{ color: '#666' }} /></div>
@@ -401,10 +401,10 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
<Col span={10}>
<div style={{ display: 'flex', flexDirection: 'column', paddingBottom: "12px", gap: 16, height: '100%', justifyContent: "end" }}>
<div style={{ display: 'flex', gap: 12, flexWrap: "wrap" }}>
<Button type="primary" size="large" style={{ flex: 1, borderRadius: 8, fontSize: 16 }}>生成任务</Button>
<Button size="large" style={{ flex: 1, borderRadius: 8, fontSize: 16, border: '1px solid #1890ff', color: '#1890ff' }}>AI优化路径</Button>
<Button type="primary" size="middle" style={{ flex: 1, borderRadius: 8, fontSize: 14 }}>生成任务</Button>
<Button size="middle" style={{ flex: 1, borderRadius: 8, fontSize: 14, border: '1px solid #1890ff', color: '#1890ff' }}>AI优化路径</Button>
</div>
<Button type="primary" size="large" style={{ borderRadius: 8, fontSize: 16 }}>一键联动作业</Button>
<Button type="primary" size="middle" style={{ borderRadius: 8, fontSize: 14 }}>一键联动作业</Button>
</div>
</Col>
</Row>

View File

@@ -35,8 +35,8 @@ const DroneVideoPlayer: React.FC<DroneVideoPlayerProps> = ({
else setInternalVideoSource(source);
};
const [selectedCamera, setSelectedCamera] = useState<'indoor' | 'outdoor'>('indoor');
const [selectedLens, setSelectedLens] = useState<'wide' | 'zoom' | 'ir'>('wide');
const [selectedCamera, setSelectedCamera] = useState<'indoor' | 'outdoor'>('');
const [selectedLens, setSelectedLens] = useState<'wide' | 'zoom' | 'ir'>('');
// 当前选中的摄像头 index
const [selectedDroneCameraIdx, setSelectedDroneCameraIdx] = useState<number>(0);
const [droneStreamData, setDroneStreamData] = useState<any>(null);
@@ -263,8 +263,8 @@ const DroneVideoPlayer: React.FC<DroneVideoPlayerProps> = ({
padding: '4px 8px',
fontSize: 10
}}>
<span>高度 {h.toFixed(2) || device.height?.toFixed(2) || '-'}m</span>
<span>风速 {wind_speed.toFixed(2) || device.wind_speed?.toFixed(2) || '0'}m/s</span>
<span>高度 {h?.toFixed(2) || device?.height?.toFixed(2) || '-'}m</span>
<span>风速 {wind_speed?.toFixed(2) || device?.wind_speed?.toFixed(2) || '0'}m/s</span>
</div>
)}
</div>

View File

@@ -27,7 +27,7 @@ import CesiumMap from '../Map';
const { Text, Title } = Typography;
const { RangePicker } = DatePicker;
export default function WayLinePage({ planedevices }) {
export default function WayLinePage({ planedevices, onRefresh }) {
const fontSmall = 'clamp(10px, 0.7vw, 11px)';
const fontNormal = 'clamp(12px, 0.75vw, 13px)';
const fontTitle = 'clamp(14px, 0.85vw, 16px)';
@@ -180,7 +180,7 @@ export default function WayLinePage({ planedevices }) {
utils.message.success('创建任务成功');
resetModals();
getListTask();
if (onRefresh) onRefresh();
} else {
utils.message.error(res.msg || '创建失败');
}
@@ -442,6 +442,7 @@ export default function WayLinePage({ planedevices }) {
utils.message.success('航线执行任务创建成功');
setRthModalVisible(false);
getListTask();
if (onRefresh) onRefresh();
//await getTrackFn({
// uuid: res.data.task_uuid