-
- } onClick={openBindModal}>绑定无人机
-
-
-
-
+ {/* 无人机搜索栏 */}
+
+ setDroneParams({ ...droneParams, gateway_sn: e.target.value })}
+ />
+
+ } onClick={() => setDroneParams({ pageNum: 1, pageSize: 10, gateway_sn: '', status: '' })}>重置
+
+ } onClick={openBindModal}>绑定无人机
+
+
+
-
+
`共 ${t} 条`
- }}
- scroll={{
- y: 'auto ', // 最大高度,超过才滚动
- x: '700px' /* 横向最小宽度,不够自动出滚动条 */
+ showTotal: t => `共 ${t} 条`,
+ onChange: (page, pageSize) => {
+ setDroneParams({ ...droneParams, pageNum: page, pageSize });
+ },
}}
+ scroll={{ y: 'auto', x: '700px' }}
/>
@@ -706,7 +676,7 @@ export default function DeviceManagementPage() {
setBindModalVisible(false);
setSiteOptions([]);
setUserOptions([]);
- bindForm.resetFields(); // 加一句重置,避免缓存
+ bindForm.resetFields();
}}
onOk={() => bindForm.submit()}
width={500}
@@ -715,8 +685,6 @@ export default function DeviceManagementPage() {
-
- {/* ========== 修复:组织 ========== */}
-
- {/* ========== 修复:场站 ========== */}
-
- {/* ========== 修复:用户 ========== */}
-
+
>
) : (
- // 显示原来的设备列表
<>
- {/* 筛选栏 */}
@@ -800,8 +753,6 @@ export default function DeviceManagementPage() {
-
- {/* 表格 */}
>
- )
- }
-
+ )}
+
);
}
diff --git a/src/components/devices/DeviceOverviewPage.tsx b/src/components/devices/DeviceOverviewPage.tsx
index ffe9f8b..bd4af3d 100644
--- a/src/components/devices/DeviceOverviewPage.tsx
+++ b/src/components/devices/DeviceOverviewPage.tsx
@@ -195,7 +195,9 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
showSearch
allowClear
optionFilterProp="label"
- filterOption={(input, option) => option.label.toLowerCase().includes(input.toLowerCase())}
+ filterOption={(input, option) =>
+ String(option?.label || "").toLowerCase().includes(input.toLowerCase())
+ }
options={[
{ label: 机器人, options: devices.map(item => ({ value: item.device_sn || item.serialNumber, label: item.deviceAlias || item.deviceName || '未知设备' })) },
{ label: 无人机, options: planedevices.map(item => ({ value: item.device_sn, label: item.drone_callsign || item.callsign || '未知设备' })) },
diff --git a/src/pages/Devices.tsx b/src/pages/Devices.tsx
index 41759b4..e8513d5 100644
--- a/src/pages/Devices.tsx
+++ b/src/pages/Devices.tsx
@@ -48,7 +48,7 @@ export default function DeviceIndexPage() {
const devData = deviceRes?.code === 200 ? (deviceRes.data || []) : [];
// 3. 处理无人机 + 自动补全地图需要的字段(关键改动)
- let planeData = planeRes?.code === 200 ? (planeRes.data?.detail || []) : [];
+ let planeData = planeRes?.code === 200 ? (planeRes?.rows || []) : [];
// ====================== ✅ 核心改造 ======================
planeData = planeData.map(item => ({