diff --git a/src/components/SystemSetting/DeviceManagement.tsx b/src/components/SystemSetting/DeviceManagement.tsx index 61fc9e6..363ec8f 100644 --- a/src/components/SystemSetting/DeviceManagement.tsx +++ b/src/components/SystemSetting/DeviceManagement.tsx @@ -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() { setDroneParams({ ...droneParams, gateway_sn: e.target.value })} + allowClear + value={droneParams.sn} + onChange={(e) => setDroneParams({ ...droneParams, sn: e.target.value })} /> - + diff --git a/src/components/SystemSetting/SerialNumGenerate.jsx b/src/components/SystemSetting/SerialNumGenerate.jsx index 75306db..aec4825 100644 --- a/src/components/SystemSetting/SerialNumGenerate.jsx +++ b/src/components/SystemSetting/SerialNumGenerate.jsx @@ -404,7 +404,7 @@ const SerialNumGenerate = () => { }; return ( -
+
{contextHolder} ({ ...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) => { diff --git a/src/pages/Devices.tsx b/src/pages/Devices.tsx index d3880c0..b4a53f7 100644 --- a/src/pages/Devices.tsx +++ b/src/pages/Devices.tsx @@ -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 }) => ( -
-

设置状态页面

-

当前查看设备序列号: {serialNumber || '未选择设备'}

-
-); 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 || '无人机',