编辑机器(配置速度等)
This commit is contained in:
@@ -1601,7 +1601,6 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//rotation = Cesium.Math.toRadians(-3.17);
|
|
||||||
|
|
||||||
|
|
||||||
if (!realtimeCarEntityRef.current) {
|
if (!realtimeCarEntityRef.current) {
|
||||||
|
|||||||
@@ -109,6 +109,10 @@ export default function DeviceManagementPage() {
|
|||||||
const [allSiteOptions, setAllSiteOptions] = useState([]);
|
const [allSiteOptions, setAllSiteOptions] = useState([]);
|
||||||
const [allUserOptions, setAllUserOptions] = useState([]);
|
const [allUserOptions, setAllUserOptions] = useState([]);
|
||||||
|
|
||||||
|
const [editSmartModalVisible, setEditSmartModalVisible] = useState(false);
|
||||||
|
const [editSmartForm] = Form.useForm();
|
||||||
|
const [currentEditSmart, setCurrentEditSmart] = useState(null);
|
||||||
|
|
||||||
// 获取无人机列表(带分页 + 筛选)
|
// 获取无人机列表(带分页 + 筛选)
|
||||||
const fetchDroneList = async () => {
|
const fetchDroneList = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -125,6 +129,32 @@ export default function DeviceManagementPage() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 打开智能装备编辑弹窗
|
||||||
|
const openEditSmartModal = (record) => {
|
||||||
|
setCurrentEditSmart(record);
|
||||||
|
setEditSmartModalVisible(true);
|
||||||
|
editSmartForm.setFieldsValue({
|
||||||
|
deviceAlias: record.deviceAlias,
|
||||||
|
serialNumber: record.serialNumber,
|
||||||
|
onlineStatus: record.onlineStatus,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 保存智能装备编辑
|
||||||
|
const saveEditSmart = (values) => {
|
||||||
|
// 模拟接口更新,真实项目替换为编辑接口
|
||||||
|
setSmartList(prev => prev.map(item => {
|
||||||
|
if (item.serialNumber === currentEditSmart.serialNumber) {
|
||||||
|
return { ...item, ...values };
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
}));
|
||||||
|
utils.message.success('装备编辑成功');
|
||||||
|
setEditSmartModalVisible(false);
|
||||||
|
editSmartForm.resetFields();
|
||||||
|
setCurrentEditSmart(null);
|
||||||
|
};
|
||||||
|
|
||||||
const fetchSmartList = async () => {
|
const fetchSmartList = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
@@ -343,6 +373,8 @@ export default function DeviceManagementPage() {
|
|||||||
title: '操作', width: 280, key: 'action', fixed: 'right',
|
title: '操作', width: 280, key: 'action', fixed: 'right',
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space>
|
<Space>
|
||||||
|
<Button size="small" icon={<EditOutlined />} onClick={() => openEditSmartModal(record)}>编辑</Button>
|
||||||
|
|
||||||
<Tooltip title="清除人员绑定">
|
<Tooltip title="清除人员绑定">
|
||||||
<Button size="small" icon={<DisconnectOutlined />} onClick={() => handleUnbindSmart([record.serialNumber], 1)}>用户</Button>
|
<Button size="small" icon={<DisconnectOutlined />} onClick={() => handleUnbindSmart([record.serialNumber], 1)}>用户</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@@ -628,6 +660,34 @@ export default function DeviceManagementPage() {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
{/* 智能装备编辑弹窗 */}
|
||||||
|
<Modal
|
||||||
|
title="编辑智能装备信息"
|
||||||
|
open={editSmartModalVisible}
|
||||||
|
onCancel={() => {
|
||||||
|
setEditSmartModalVisible(false);
|
||||||
|
setCurrentEditSmart(null);
|
||||||
|
editSmartForm.resetFields();
|
||||||
|
}}
|
||||||
|
onOk={() => editSmartForm.submit()}
|
||||||
|
width={480}
|
||||||
|
>
|
||||||
|
<Form form={editSmartForm} layout="vertical" onFinish={saveEditSmart}>
|
||||||
|
<Form.Item label="设备名称" name="deviceAlias" rules={[{ required: true, message: '请填写设备名称' }]}>
|
||||||
|
<Input placeholder="请输入设备名称" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="设备序列号" name="serialNumber" rules={[{ required: true, message: '请填写设备码' }]}>
|
||||||
|
<Input placeholder="请输入设备序列号" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="在线状态" name="onlineStatus" rules={[{ required: true, message: '请选择在线状态' }]}>
|
||||||
|
<Select placeholder="选择在线状态">
|
||||||
|
<Select.Option value="ONLINE">在线</Select.Option>
|
||||||
|
<Select.Option value="OFFLINE">离线</Select.Option>
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</Modal>
|
||||||
</>
|
</>
|
||||||
) : activeTab === 'drone' ? (
|
) : activeTab === 'drone' ? (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user