change - 传感器汇总列表显示参数为undfiend问题处理

main
wenjy 3 years ago
parent 298f07888f
commit 521a677b6f

@ -63,6 +63,16 @@ public class SysParamConfigController extends BaseController {
return JSONArray.toJSONString(sysParamConfigs); return JSONArray.toJSONString(sysParamConfigs);
} }
@PostMapping("/getParameterNotVisibleFlag")
@ResponseBody
public String getParameterNotVisibleFlag(String sensorTypeId){
SysParamConfig sysParamConfig = new SysParamConfig();
sysParamConfig.setParamType(sensorTypeId);
List<SysParamConfig> sysParamConfigs =
sysParamConfigService.selectSysParamConfigList(sysParamConfig);
return JSONArray.toJSONString(sysParamConfigs);
}
/** 导出传感器参数配置列表 */ /** 导出传感器参数配置列表 */
@RequiresPermissions("base:sysParamConfig:export") @RequiresPermissions("base:sysParamConfig:export")
@Log(title = "传感器参数配置", businessType = BusinessType.EXPORT) @Log(title = "传感器参数配置", businessType = BusinessType.EXPORT)

@ -75,7 +75,7 @@ public class SensorSummaryController extends BaseController {
info = JsonUtils.JSONObjectToMap(datavalue); info = JsonUtils.JSONObjectToMap(datavalue);
info.put("datatype", jsonObject.get("datatype")); /*info.put("datatype", jsonObject.get("datatype"));*/
} }
info.put("id", 1); info.put("id", 1);

@ -12,41 +12,43 @@ const sensorInfoList = function (sensorTypeId) {
processData: false, processData: false,
contentType: false, contentType: false,
success: function (json) { success: function (json) {
const sensorTypeArray = getparamsFunction(sensorTypeId);
let sensorTypeArray = getparamsFunction(sensorTypeId);
const columnsArray = []; const columnsArray = [];
columnsArray.push({field: "id", title: "序号", width: 60, colspan: 1, rowspan: 1, align: "center"}); if(sensorTypeArray.length > 0){
columnsArray.push({field: "edgeId", title: "边设备ID", width: 160, colspan: 1, rowspan: 1, align: "center"}); columnsArray.push({field: "id", title: "序号", width: 60, colspan: 1, rowspan: 1, align: "center"});
columnsArray.push({field: "sensorId", title: "传感器ID", width: 160, colspan: 1, rowspan: 1, align: "center"}); columnsArray.push({field: "edgeId", title: "边设备ID", width: 160, colspan: 1, rowspan: 1, align: "center"});
columnsArray.push({ columnsArray.push({field: "sensorId", title: "传感器ID", width: 160, colspan: 1, rowspan: 1, align: "center"});
field: "sensorLocation", columnsArray.push({
title: "监测位置", field: "sensorLocation",
width: 145, title: "监测位置",
colspan: 1, width: 145,
rowspan: 1, colspan: 1,
align: "center" rowspan: 1,
}); align: "center"
});
columnsArray.push({ columnsArray.push({
field: "collectTime", field: "collectTime",
title: "时间", title: "时间",
width: 160, width: 160,
colspan: 1, colspan: 1,
rowspan: 1, rowspan: 1,
align: "center" align: "center"
}); });
if (json.length > 0) { if (json.length > 0) {
for (let i = 0; i < (Object.keys(json[0])).length; i++) {//Object.keys(obj) 获取key名称 const jsonObj = Object.keys(json[0]);
let property = (Object.keys(json[0]))[i]; console.log(jsonObj);
if (property != "id" && property != "edgeId" && property != "sensorId" && property != 'sensorLocation' && property != 'datatype' && property != 'collectTime') { for (let i = 0; i < jsonObj.length; i++) {//Object.keys(obj) 获取key名称
columnsArray.push({ let property = jsonObj[i];
field: property, if (property != "id" && property != "edgeId" && property != "sensorId" && property != 'sensorLocation' && property != 'datatype' && property != 'collectTime') {
title: sensorTypeArray.length == 0 ? property : sensorTypeArray.find(array => array.paramTitle === property).paramText, columnsArray.push({
width: property === "imgstr" ? 500 : 160, field: property,
align: "center", 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); formData.append("sensorTypeId", sensorTypeId);
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/base/sysParamConfig/getParameter", url: "/base/sysParamConfig/getParameterNotVisibleFlag",
data: formData, data: formData,
contentType: "application/json;charset=utf-8", contentType: "application/json;charset=utf-8",
dataType: "json", dataType: "json",

@ -417,12 +417,6 @@
</div> </div>
<div class="sensor-Text" id="sensor-text"> <div class="sensor-Text" id="sensor-text">
<!--<p>设备编号:<span>10kv 主变压器001</span></p>
<p>设备型号:<span>SC(B)10型干式电力变压器</span></p>
<p>启用时间:<span>2020年1月20日</span></p>
<p>所属变电站:<span>新疆某某变电站</span></p>
<p>测试参数-1<span>xxxxx</span></p>
<p>测试参数-2<span>xxxxx</span></p>-->
</div> </div>

Loading…
Cancel
Save