This commit is contained in:
mmc
2026-05-26 15:49:22 +08:00
parent 793e473ab9
commit aa19fa9670
5 changed files with 14 additions and 26 deletions

View File

@@ -81,9 +81,9 @@ export default function DeviceManagementPage() {
// 无人机分页 + 筛选
const [droneParams, setDroneParams] = useState({
pageNum: 1,
pageSize: 10,
gateway_sn: '',
status: "",
pageSize: 20,
sn: '',
status: ""
});
const [droneTotal, setDroneTotal] = useState(0);
@@ -94,7 +94,7 @@ export default function DeviceManagementPage() {
const [bindSmartForm] = Form.useForm();
const [smartParams, setSmartParams] = useState({
pageNum: 1,
pageSize: 10,
pageSize: 20,
serialNumber: '',
});
const [smartTotal, setSmartTotal] = useState(0);
@@ -389,7 +389,7 @@ export default function DeviceManagementPage() {
const droneColumns = [
{ title: '设备名称', width: 150, dataIndex: 'drone_callsign', key: 'name' },
{ title: 'SN码', width: 150, dataIndex: 'device_sn', key: 'sn' },
{ title: 'SN码', width: 180, dataIndex: 'device_sn', key: 'sn' },
{ title: '机场SN', width: 150, dataIndex: 'gateway_sn', key: 'gsn' },
{
title: '所属组织', width: 150, key: 'orgName',
@@ -636,8 +636,9 @@ export default function DeviceManagementPage() {
<Input
placeholder="机场SN"
style={{ width: 200 }}
value={droneParams.gateway_sn}
onChange={(e) => setDroneParams({ ...droneParams, gateway_sn: e.target.value })}
allowClear
value={droneParams.sn}
onChange={(e) => setDroneParams({ ...droneParams, sn: e.target.value })}
/>
<Select
placeholder="状态"
@@ -649,7 +650,7 @@ export default function DeviceManagementPage() {
<Select.Option value="1">在线</Select.Option>
<Select.Option value="2">离线</Select.Option>
</Select>
<Button icon={<ReloadOutlined />} onClick={() => setDroneParams({ pageNum: 1, pageSize: 10, gateway_sn: '', status: '' })}>重置</Button>
<Button icon={<ReloadOutlined />} onClick={() => setDroneParams({ pageNum: 1, pageSize: 10, sn: '', status: '' })}>重置</Button>
<Button type="primary" icon={<LinkOutlined />} onClick={openBindModal}>绑定无人机</Button>
<Button disabled={selectedDroneKeys.length === 0} onClick={() => handleUnbind(selectedDroneKeys, 1)}>批量解绑(用户)</Button>

View File

@@ -404,7 +404,7 @@ const SerialNumGenerate = () => {
};
return (
<div style={{ padding: '0px 20px 40px', minHeight: '100vh' }}>
<div style={{ padding: '0px 0px 40px', minHeight: '100vh' }}>
{contextHolder}
<Card

View File

@@ -15,9 +15,7 @@ import {
CarOutlined
} from '@ant-design/icons';
import { useSelector } from 'react-redux';
import { getDeviceListApi } from '../../api/device.ts';
import { RootState } from '@/src/store';
import DroneLivePlayer from '../VolcRtcPlayer.jsx';
import DroneVideoPlayer from './DroneVideoPlayer';
import AgoraTextTest from '../AgoraRtc.tsx';

View File

@@ -186,9 +186,6 @@ export default function WayLinePage({ planedevices }) {
setTaskForm(prev => ({ ...prev, sn: listDrone.gateway_sn || '' }));
}
}, [listDrone]);
// ==============================================
// ✅ 创建任务模块结束
// ==============================================
// 顶部统计
const topCards = [
@@ -503,7 +500,8 @@ export default function WayLinePage({ planedevices }) {
allowClear
options={planedevices?.map(item => ({
value: item.device_sn,
label: item.drone_callsign || item.device_sn
label: item.drone_callsign || item.device_sn || item.callsign
}))}
value={listDrone?.device_sn}
onChange={(val) => {

View File

@@ -3,7 +3,7 @@ import { Layout, Typography, Menu, Tabs } from 'antd';
import { AimOutlined, AppstoreOutlined, SettingOutlined } from '@ant-design/icons';
import DeviceOverviewPage from '../components/devices/DeviceOverviewPage';
import DeviceStatusPage from '../components/devices/DeviceStatusPage';
import { getDeviceListApi, getSiteDevice, getSiteUAVList } from '../api/device';
import { getSiteDevice, getSiteUAVList } from '../api/device';
import { useSelector } from 'react-redux';
import { RootState } from '../store';
import WayLinePage from '../components/devices/WayLinePage';
@@ -11,12 +11,6 @@ import WayLinePage from '../components/devices/WayLinePage';
const { Header, Content } = Layout;
const { Text } = Typography;
const DeviceStatusSettingPage = ({ serialNumber }) => (
<div style={{ padding: 20 }}>
<h2>设置状态页面</h2>
<p>当前查看设备序列号: <span style={{ fontWeight: 'bold', color: '#1890ff' }}>{serialNumber || '未选择设备'}</span></p>
</div>
);
export default function DeviceIndexPage() {
const [activeTab, setActiveTab] = useState('overview');
@@ -53,14 +47,11 @@ export default function DeviceIndexPage() {
// ====================== ✅ 核心改造 ======================
planeData = planeData.map(item => ({
...item,
// 给无人机统一设置 type: plane
type: 'plane',
// 自动生成 lastRunningStatus(经纬度取无人机自身字段)
lastRunningStatus: {
longitude: item.longitude || 0,
latitude: item.latitude || 0,
},
// 兼容地图取设备名/序列号
deviceAlias: item.drone_callsign || item.device_sn
|| '无人机',