diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/DeviceMonitorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/DeviceMonitorController.java index 14afa12..795b093 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/DeviceMonitorController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/DeviceMonitorController.java @@ -88,6 +88,25 @@ public class DeviceMonitorController { return JSONArray.toJSONString(jsonResult); } + + /** + * 获取第一个监控设备 + * @author WenJY + * @date 2022/3/24 13:44 + * @return java.lang.String + */ + @GetMapping("/getFirstMonitorUnit") + @ResponseBody + public String getFirstMonitorUnit(){ + String monitorunitId = ""; + List baseMonitorunitInfos = baseMonitorunitInfoService.selectBaseMonitorunitInfoList(new BaseMonitorunitInfo()); + if(baseMonitorunitInfos.size() > 0){ + BaseMonitorunitInfo baseMonitorunitInfo = baseMonitorunitInfos.stream().filter(x -> !x.getParentId().isEmpty()).collect(Collectors.toList()).get(0); + monitorunitId = baseMonitorunitInfo.getMonitorunitId(); + } + return monitorunitId; + } + /** * 监控单元模块 * @@ -155,6 +174,8 @@ public class DeviceMonitorController { info.put("sensorId", y.getSensorId()); + info.put("sensorName", y.getSensorName()); + info.put("edgeId", y.getEdgeId()); info.put("sensorLocation", y.getSensorLocation()); diff --git a/ruoyi-admin/src/main/resources/static/js/Iot-ui/deviceMonitor.js b/ruoyi-admin/src/main/resources/static/js/Iot-ui/deviceMonitor.js index c0098d2..e2144f7 100644 --- a/ruoyi-admin/src/main/resources/static/js/Iot-ui/deviceMonitor.js +++ b/ruoyi-admin/src/main/resources/static/js/Iot-ui/deviceMonitor.js @@ -47,7 +47,7 @@ const createDeviceModule = function (sensor,params) { let html = '
'; switch (sensor.datatype) { case "temperature": - html += `
${sensor.sensorId}
`; + html += `
${sensor.sensorName}
`; html += '
'; for (let i=0; i${sensor.sensorId}  ${sensor['sensorStatus'] == null ? "-" : sensorStatus(sensor['sensorStatus'])}
` + html += `
${sensor.sensorName}  ${sensor['sensorStatus'] == null ? "-" : sensorStatus(sensor['sensorStatus'])}
` html += '
'; let imgurl = sensor.imgstr.replace("D:/ruoyi/uploadPath","/profile"); html += '' @@ -85,7 +85,7 @@ const createDeviceModule = function (sensor,params) { break; case "smoke": - html += `
${sensor.sensorId}
`; + html += `
${sensor.sensorName}
`; html += '
'; for (let i=0; i${sensor.sensorId}
`; + html += `
${sensor.sensorName}
`; html += '
'; for (let i=0; i
'; + e += '
'; ul.append(e); } } else { // 当超过一页时 diff --git a/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html b/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html index 4c76afa..29e8550 100644 --- a/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html +++ b/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html @@ -439,7 +439,6 @@ placeholder="请输入传感器名称"> -
@@ -449,13 +448,11 @@