From e4771c98d32dd99ab19a610979f8bd10e339a2d9 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Tue, 19 May 2026 16:22:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=BE=E5=A4=87=E6=8E=A5?= =?UTF-8?q?=E5=85=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SystemSetting/DeviceAccessPage.tsx | 101 ++++++++++++++---- 1 file changed, 80 insertions(+), 21 deletions(-) diff --git a/src/components/SystemSetting/DeviceAccessPage.tsx b/src/components/SystemSetting/DeviceAccessPage.tsx index ee6b479..4e9ace6 100644 --- a/src/components/SystemSetting/DeviceAccessPage.tsx +++ b/src/components/SystemSetting/DeviceAccessPage.tsx @@ -136,6 +136,7 @@ export default function DeviceAccessPage() { form.resetFields(); setSelectedModelId(''); setPropertyList([]); + getModelAll(); if (record) { form.setFieldsValue(record); @@ -447,7 +448,7 @@ export default function DeviceAccessPage() { useEffect(() => { getConnectList(); - getModelAll(); + getProductList(); getDataTypes(); }, []); @@ -770,37 +771,23 @@ export default function DeviceAccessPage() { - {/* - - */} - - - + - - - - - - + - - 物模型属性配置 + 绑定物模型 - + {/* 隐藏字段:存储协议(从物模型自动获取) */} + + + {/* ====================== + 根据【物模型协议】自动显示配置 + ====================== */} + {selectedModelId && ( + <> + + {/* MQTT 协议配置 */} + {form.getFieldValue('protocolCode')?.toLowerCase() === 'mqtt' && ( + <> + 协议自动配置项 +
+ + + + + + +
+ + + )} + + {/* ONVIF 协议配置 */} + {form.getFieldValue('protocolCode')?.toLowerCase() === 'onvif' && ( + <> + 协议自动配置项 +
+ + + + + + + + + + + + +
+ + + + )} + + {/* RTSP 协议配置 */} + {form.getFieldValue('protocolCode')?.toLowerCase() === 'rtsp' && ( + <> + 协议自动配置项 + + + + + + + )} + + )} + + 物模型属性配置 +
{propertyList?.map((item) => (
@@ -855,7 +915,6 @@ export default function DeviceAccessPage() {
)} - {modalType === 'model' && ( <>