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

main
wenjy 3 years ago
parent 298f07888f
commit 521a677b6f

@ -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<SysParamConfig> sysParamConfigs =
sysParamConfigService.selectSysParamConfigList(sysParamConfig);
return JSONArray.toJSONString(sysParamConfigs);
}
/** 导出传感器参数配置列表 */
@RequiresPermissions("base:sysParamConfig:export")
@Log(title = "传感器参数配置", businessType = BusinessType.EXPORT)

@ -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);

@ -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",

@ -417,12 +417,6 @@
</div>
<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>

Loading…
Cancel
Save