From 334922aa46d6812e34d958f5260b5ae6941ca81e Mon Sep 17 00:00:00 2001 From: wenjy Date: Thu, 24 Mar 2022 14:23:33 +0800 Subject: [PATCH] =?UTF-8?q?change-=E6=99=BA=E6=85=A7=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E3=80=81=E8=AE=BE=E5=A4=87=E7=9B=91=E6=8E=A7=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/DeviceMonitorController.java | 21 ++++++++++ .../static/js/Iot-ui/deviceMonitor.js | 8 ++-- .../templates/section/substation.html | 2 +- .../templates/section/transformer-detail.html | 40 ++++++++++++++----- 4 files changed, 57 insertions(+), 14 deletions(-) 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 @@