|
|
|
@ -12,10 +12,9 @@ const sensorInfoList = function (sensorTypeId) {
|
|
|
|
|
processData: false,
|
|
|
|
|
contentType: false,
|
|
|
|
|
success: function (json) {
|
|
|
|
|
|
|
|
|
|
let sensorTypeArray = getparamsFunction(sensorTypeId);
|
|
|
|
|
|
|
|
|
|
const sensorTypeArray = getparamsFunction(sensorTypeId);
|
|
|
|
|
const columnsArray = [];
|
|
|
|
|
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"});
|
|
|
|
@ -38,18 +37,21 @@ const sensorInfoList = function (sensorTypeId) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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];
|
|
|
|
|
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: sensorTypeArray.length == 0 ? property : sensorTypeArray.find(array => array.paramTitle === property).paramText,
|
|
|
|
|
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",
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('#table').bootstrapTable('destroy');
|
|
|
|
|
$('#table').bootstrapTable({
|
|
|
|
@ -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",
|
|
|
|
|