diff --git a/src/api/deviceAccess.ts b/src/api/deviceAccess.ts index e7722e6..44e867f 100644 --- a/src/api/deviceAccess.ts +++ b/src/api/deviceAccess.ts @@ -39,6 +39,16 @@ export function addProduct(data) { }); } +//协议查询 + +export function getConnectTypes(params) { + return request({ + url: '/system/devicemodel/connectTypes', + method: 'get', + params + }); +} + diff --git a/src/components/SystemSetting/BasicSettings.tsx b/src/components/SystemSetting/BasicSettings.tsx index 0cdba2d..5167cb4 100644 --- a/src/components/SystemSetting/BasicSettings.tsx +++ b/src/components/SystemSetting/BasicSettings.tsx @@ -172,222 +172,234 @@ const BasicSettings = () => { - + {/* 左侧主内容 */} - - {/* 平台参数 */} - -
- - - - - + +
+ {/* 平台参数 */} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {/* 通知与告警策略 */} + + + +
+ 短信 + +
- - - - + +
+ 邮件 + +
+ + +
+ 企业微信 + +
- - - - + +
+ 系统通知 + +
- - - - + +
+ 严重告警立即通知 + +
+ + +
+ 通信中断通知 + +
- - - - -
+ - {/* 通知与告警策略 */} - - - -
- 短信 - -
- - -
- 邮件 - -
- - -
- 企业微信 - -
- -
- - -
- 系统通知 - -
- - -
- 严重告警立即通知 - -
- - -
- 通信中断通知 - -
- -
-
+ {/* 用户与权限预览 */} + + {text} }, + ]} + dataSource={[ + { name: '张运维', role: '超级管理员', phone: '138****0001', status: '在线' }, + { name: '李工程师', role: '运维工程师', phone: '139****0002', status: '在线' }, + { name: '王班长', role: '巡检主管', phone: '137****0003', status: '在线' }, + { name: '赵分析师', role: '数据分析师', phone: '136****0004', status: '在线' }, + ]} + /> + + {/* MQTT接入状态 */} + +
来自 /pv/mqtt/status,后端未登录时显示预览兜底数据
+ + {mqttStatusData.map((item, index) => ( +
+
+
{item.name}
+
{item.value}
+
+ + ))} + + - {/* 用户与权限预览 */} - -
{text} }, - ]} - dataSource={[ - { name: '张运维', role: '超级管理员', phone: '138****0001', status: '在线' }, - { name: '李工程师', role: '运维工程师', phone: '139****0002', status: '在线' }, - { name: '王班长', role: '巡检主管', phone: '137****0003', status: '在线' }, - { name: '赵分析师', role: '数据分析师', phone: '136****0004', status: '在线' }, - ]} - /> - + {/* MQTT消息日志 */} + +
阶段3A用于验证遥测原始消息落库
+
+ + + + + + + + + + + + + + + + + + {/* 右侧边栏 */} - - {/* 设备接入状态 */} - - - {deviceStatusData.map((item, index) => ( - -
-
{item.name}
-
{item.count}
-
{item.status}
-
- - ))} - - + +
+ {/* 设备接入状态 */} + + + {deviceStatusData.map((item, index) => ( +
+
+
{item.name}
+
{item.count}
+
{item.status}
+
+ + ))} + + - {/* 服务配置展示 */} - - {serviceConfigData.map((item, index) => ( -
-
-
{item.name}
-
{item.value}
+ {/* 服务配置展示 */} + + {serviceConfigData.map((item, index) => ( +
+
+
{item.name}
+
{item.value}
+
+ {item.status}
- {item.status} -
- ))} - - - {/* 视频服务配置状态 */} - -
来自 /pv/video/summary 与 /pv/video/media-server/list
- - {videoServiceData.map((item, index) => ( -
-
-
{item.name}
-
{item.value}
-
- ))} - - - + - {/* MQTT接入状态 */} - -
来自 /pv/mqtt/status,后端未登录时显示预览兜底数据
- - {mqttStatusData.map((item, index) => ( -
-
-
{item.name}
-
{item.value}
-
- - ))} - - + {/* 视频服务配置状态 */} + +
来自 /pv/video/summary 与 /pv/video/media-server/list
+ + {videoServiceData.map((item, index) => ( +
+
+
{item.name}
+
{item.value}
+
+ + ))} + + + - {/* MQTT消息日志 */} - -
阶段3A用于验证遥测原始消息落库
-
- - {/* WebSocket实时推送 */} - -
来自 /pv/ws/status,并显示前端本地连接状态
- - {wsStatusData.map((item, index) => ( -
-
-
{item.name}
-
{item.value}
-
- - ))} - - - {/* 系统维护 */} - - - - - - - - - - - - - - - - + {/* WebSocket实时推送 */} + +
来自 /pv/ws/status,并显示前端本地连接状态
+ + {wsStatusData.map((item, index) => ( +
+
+
{item.name}
+
{item.value}
+
+ + ))} + + + + {/* 系统维护 */} + + diff --git a/src/components/SystemSetting/DeviceAccessPage.tsx b/src/components/SystemSetting/DeviceAccessPage.tsx index 230d9aa..fbb8ed8 100644 --- a/src/components/SystemSetting/DeviceAccessPage.tsx +++ b/src/components/SystemSetting/DeviceAccessPage.tsx @@ -7,7 +7,7 @@ import { PlusOutlined, EditOutlined, DeleteOutlined, ProductOutlined, AppstoreOutlined, SwapOutlined, VideoCameraOutlined } from '@ant-design/icons'; -import { addDeviceModel, getDeviceModelList, updateDeviceModel } from '../../api/deviceAccess.ts'; +import { addDeviceModel, getConnectTypes, getDeviceModelList, updateDeviceModel } from '../../api/deviceAccess.ts'; const { Option } = Select; const { TabPane } = Tabs; @@ -111,6 +111,7 @@ export default function DeviceAccessPage() { const [mappingList, setMappingList] = useState(mappingInitList); const [mappingModal, setMappingModal] = useState(false); const [mappingForm] = Form.useForm(); + const [protocolList, setProtocolList] = useState([]); // 筛选条件 const [filterForm] = Form.useForm(); @@ -122,6 +123,17 @@ export default function DeviceAccessPage() { pageSize: 10, total: 0, }); + const getConnectList = () => { + getConnectTypes("").then(res => { + if (res.code == 200) { + setProtocolList(res.data || []); + } else { + setProtocolList([]); + + } + + }); + } // 删除物模型 const handleDeleteModel = (id) => { @@ -256,7 +268,6 @@ export default function DeviceAccessPage() { } }); } - console.log('✅ 提交物模型', submitData); } setVisible(false); }); @@ -316,7 +327,11 @@ export default function DeviceAccessPage() { if (activeTab === 'model') { getModel(); } + }, [pagination.current, pagination.pageSize, activeTab]); + useEffect(() => { + getConnectList(); + }, []) // 表格列 const deviceColumns = [ @@ -584,7 +599,20 @@ export default function DeviceAccessPage() { @@ -620,6 +648,7 @@ export default function DeviceAccessPage() { + {/* 指令弹窗 */} {/* 指令弹窗 */} setActionModal(false)} onOk={() => { @@ -641,17 +670,40 @@ export default function DeviceAccessPage() { setCurrentAction({ ...currentAction, actionName: e.target.value })} style={{ flex: 1 }} /> 指令参数 - {paramList[0] && ( -
- setParamList([{ ...paramList[0], paramKey: e.target.value }])} /> - - setParamList([{ ...paramList[0], desc: e.target.value }])} /> - setParamList([{ ...paramList[0], defaultValue: e.target.value }])} /> - setParamList([{ ...paramList[0], enum: e.target.value.split(',').map(s => s.trim()) }])} /> -
- )} + + {/* ✅ 修复:永远显示参数行,不会空白 */} +
+ setParamList([{ ...paramList[0], paramKey: e.target.value }])} + /> + + setParamList([{ ...paramList[0], desc: e.target.value }])} + /> + setParamList([{ ...paramList[0], defaultValue: e.target.value }])} + /> + setParamList([{ ...paramList[0], enum: e.target.value.split(',').map(s => s.trim()) }])} + /> +
{/* 字段映射 */}