机器人 无人机绑定 解绑分页查询 筛选 成功
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
||||
DisconnectOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import SerialNumGenerate from "./SerialNumGenerate"
|
||||
import { getPlaneDeviceList, bindDrone, unbindDrone, bindSmartDevice, unbindSmartDevice, getSiteDevice } from '@/api/device';
|
||||
import { getPlaneDeviceList, bindDrone, unbindDrone, bindSmartDevice, unbindSmartDevice, getAllDevice } from '@/api/device';
|
||||
import { getOrgList } from '@/api/organization/index';
|
||||
import { getSiteByOrgId, getStationList } from '@/api/stationManage/index';
|
||||
import { getUser } from '@/api/user/index';
|
||||
@@ -95,6 +95,7 @@ export default function DeviceManagementPage() {
|
||||
const [smartParams, setSmartParams] = useState({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
serialNumber: '',
|
||||
});
|
||||
const [smartTotal, setSmartTotal] = useState(0);
|
||||
|
||||
@@ -127,7 +128,7 @@ export default function DeviceManagementPage() {
|
||||
const fetchSmartList = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await getSiteDevice(smartParams);
|
||||
const res = await getAllDevice(smartParams);
|
||||
if (res.code === 200) {
|
||||
setSmartList(res.rows || []);
|
||||
setSmartTotal(res.total || res.rows.length);
|
||||
@@ -343,13 +344,13 @@ export default function DeviceManagementPage() {
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Tooltip title="清除人员绑定">
|
||||
<Button size="small" icon={<DisconnectOutlined />} onClick={() => handleUnbindSmart([record.deviceId || record.id], 1)}>用户</Button>
|
||||
<Button size="small" icon={<DisconnectOutlined />} onClick={() => handleUnbindSmart([record.serialNumber], 1)}>用户</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title="清除场站绑定">
|
||||
<Button size="small" icon={<DisconnectOutlined />} onClick={() => handleUnbindSmart([record.deviceId || record.id], 2)}>场站</Button>
|
||||
<Button size="small" icon={<DisconnectOutlined />} onClick={() => handleUnbindSmart([record.serialNumber], 2)}>场站</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title="清除组织绑定">
|
||||
<Button size="small" icon={<DisconnectOutlined />} onClick={() => handleUnbindSmart([record.deviceId || record.id], 3)}>组织</Button>
|
||||
<Button size="small" icon={<DisconnectOutlined />} onClick={() => handleUnbindSmart([record.serialNumber], 3)}>组织</Button>
|
||||
</Tooltip>
|
||||
</Space>
|
||||
),
|
||||
@@ -533,6 +534,14 @@ export default function DeviceManagementPage() {
|
||||
<>
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
<Space>
|
||||
<Input
|
||||
placeholder="设备码"
|
||||
style={{ width: 240 }}
|
||||
value={smartParams.serialNumber}
|
||||
allowClear
|
||||
onChange={(e) => setSmartParams({ ...smartParams, serialNumber: e.target.value.trim() })}
|
||||
/>
|
||||
<Button icon={<ReloadOutlined />} onClick={() => setSmartParams({ pageNum: 1, pageSize: 10, serialNumber: '' })}>重置</Button>
|
||||
<Button type="primary" icon={<LinkOutlined />} onClick={openBindSmartModal}>绑定装备</Button>
|
||||
<Button disabled={selectedSmartKeys.length === 0} onClick={() => handleUnbindSmart(selectedSmartKeys, 1)}>批量解绑(用户)</Button>
|
||||
<Button disabled={selectedSmartKeys.length === 0} onClick={() => handleUnbindSmart(selectedSmartKeys, 2)}>批量解绑(场站)</Button>
|
||||
|
||||
Reference in New Issue
Block a user