From 8dafe585413c569a811c11a6cf103b87e159b069 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Tue, 7 Jul 2026 16:59:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=9C=BA=E5=99=A8=EF=BC=88?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=80=9F=E5=BA=A6=E7=AD=89=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Map.jsx | 1 - .../SystemSetting/DeviceManagement.tsx | 60 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 1fb1ae9..c70471d 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -1601,7 +1601,6 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, } - //rotation = Cesium.Math.toRadians(-3.17); if (!realtimeCarEntityRef.current) { diff --git a/src/components/SystemSetting/DeviceManagement.tsx b/src/components/SystemSetting/DeviceManagement.tsx index a35f63b..255aa5d 100644 --- a/src/components/SystemSetting/DeviceManagement.tsx +++ b/src/components/SystemSetting/DeviceManagement.tsx @@ -109,6 +109,10 @@ export default function DeviceManagementPage() { const [allSiteOptions, setAllSiteOptions] = useState([]); const [allUserOptions, setAllUserOptions] = useState([]); + const [editSmartModalVisible, setEditSmartModalVisible] = useState(false); + const [editSmartForm] = Form.useForm(); + const [currentEditSmart, setCurrentEditSmart] = useState(null); + // 获取无人机列表(带分页 + 筛选) const fetchDroneList = async () => { 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 () => { setLoading(true); try { @@ -343,6 +373,8 @@ export default function DeviceManagementPage() { title: '操作', width: 280, key: 'action', fixed: 'right', render: (_, record) => ( + + @@ -628,6 +660,34 @@ export default function DeviceManagementPage() { + + {/* 智能装备编辑弹窗 */} + { + setEditSmartModalVisible(false); + setCurrentEditSmart(null); + editSmartForm.resetFields(); + }} + onOk={() => editSmartForm.submit()} + width={480} + > +
+ + + + + + + + + +
+
) : activeTab === 'drone' ? ( <>