diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/SysParamConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/SysParamConfigController.java index 18c850d..1a61ab3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/SysParamConfigController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/SysParamConfigController.java @@ -63,6 +63,16 @@ public class SysParamConfigController extends BaseController { return JSONArray.toJSONString(sysParamConfigs); } + @PostMapping("/getParameterNotVisibleFlag") + @ResponseBody + public String getParameterNotVisibleFlag(String sensorTypeId){ + SysParamConfig sysParamConfig = new SysParamConfig(); + sysParamConfig.setParamType(sensorTypeId); + List sysParamConfigs = + sysParamConfigService.selectSysParamConfigList(sysParamConfig); + return JSONArray.toJSONString(sysParamConfigs); + } + /** 导出传感器参数配置列表 */ @RequiresPermissions("base:sysParamConfig:export") @Log(title = "传感器参数配置", businessType = BusinessType.EXPORT) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/SensorSummaryController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/SensorSummaryController.java index 9fda671..ea41b46 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/SensorSummaryController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/SensorSummaryController.java @@ -75,7 +75,7 @@ public class SensorSummaryController extends BaseController { info = JsonUtils.JSONObjectToMap(datavalue); - info.put("datatype", jsonObject.get("datatype")); + /*info.put("datatype", jsonObject.get("datatype"));*/ } info.put("id", 1); diff --git a/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js b/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js index ebe8276..3bc6602 100644 --- a/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js +++ b/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js @@ -12,41 +12,43 @@ const sensorInfoList = function (sensorTypeId) { processData: false, contentType: false, success: function (json) { - - let sensorTypeArray = getparamsFunction(sensorTypeId); - + const sensorTypeArray = getparamsFunction(sensorTypeId); const columnsArray = []; - columnsArray.push({field: "id", title: "序号", width: 60, colspan: 1, rowspan: 1, align: "center"}); - columnsArray.push({field: "edgeId", title: "边设备ID", width: 160, colspan: 1, rowspan: 1, align: "center"}); - columnsArray.push({field: "sensorId", title: "传感器ID", width: 160, colspan: 1, rowspan: 1, align: "center"}); - columnsArray.push({ - field: "sensorLocation", - title: "监测位置", - width: 145, - colspan: 1, - rowspan: 1, - align: "center" - }); + if(sensorTypeArray.length > 0){ + columnsArray.push({field: "id", title: "序号", width: 60, colspan: 1, rowspan: 1, align: "center"}); + columnsArray.push({field: "edgeId", title: "边设备ID", width: 160, colspan: 1, rowspan: 1, align: "center"}); + columnsArray.push({field: "sensorId", title: "传感器ID", width: 160, colspan: 1, rowspan: 1, align: "center"}); + columnsArray.push({ + field: "sensorLocation", + title: "监测位置", + width: 145, + colspan: 1, + rowspan: 1, + align: "center" + }); - columnsArray.push({ - field: "collectTime", - title: "时间", - width: 160, - colspan: 1, - rowspan: 1, - align: "center" - }); + columnsArray.push({ + field: "collectTime", + title: "时间", + width: 160, + colspan: 1, + rowspan: 1, + align: "center" + }); - if (json.length > 0) { - for (let i = 0; i < (Object.keys(json[0])).length; i++) {//Object.keys(obj) 获取key名称 - let property = (Object.keys(json[0]))[i]; - if (property != "id" && property != "edgeId" && property != "sensorId" && property != 'sensorLocation' && property != 'datatype' && property != 'collectTime') { - columnsArray.push({ - field: property, - title: sensorTypeArray.length == 0 ? property : sensorTypeArray.find(array => array.paramTitle === property).paramText, - width: property === "imgstr" ? 500 : 160, - align: "center", - }); + if (json.length > 0) { + const jsonObj = Object.keys(json[0]); + console.log(jsonObj); + for (let i = 0; i < jsonObj.length; i++) {//Object.keys(obj) 获取key名称 + let property = jsonObj[i]; + if (property != "id" && property != "edgeId" && property != "sensorId" && property != 'sensorLocation' && property != 'datatype' && property != 'collectTime') { + columnsArray.push({ + field: property, + title: typeof(sensorTypeArray.find(x=>x.paramTitle.includes(property))) == "undefined" ? property : sensorTypeArray.find(x=>x.paramTitle.includes(property)).paramText, + width: property === "imgstr" ? 500 : 160, + align: "center", + }); + } } } } @@ -79,7 +81,7 @@ const getparamsFunction = function (sensorTypeId) { formData.append("sensorTypeId", sensorTypeId); $.ajax({ type: "post", - url: "/base/sysParamConfig/getParameter", + url: "/base/sysParamConfig/getParameterNotVisibleFlag", data: formData, contentType: "application/json;charset=utf-8", dataType: "json", 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 11ebfb4..4bca9a6 100644 --- a/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html +++ b/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html @@ -417,12 +417,6 @@
-