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