|
|
|
@ -11,19 +11,24 @@ const sensorInfoList = function (sensorTypeId) {
|
|
|
|
|
json: 'callback',
|
|
|
|
|
processData: false,
|
|
|
|
|
contentType: false,
|
|
|
|
|
beforeSend: function () {
|
|
|
|
|
$.modal.loading("正在处理中,请稍候...");
|
|
|
|
|
},
|
|
|
|
|
success: function (json) {
|
|
|
|
|
$.modal.closeLoading();
|
|
|
|
|
const sensorTypeArray = getparamsFunction(sensorTypeId);
|
|
|
|
|
const columnsArray = [];
|
|
|
|
|
if(sensorTypeArray.length > 0){
|
|
|
|
|
columnsArray.push({field: "id", title: "序号", width: 60,height: 60, colspan: 1, rowspan: 1, align: "center"});
|
|
|
|
|
columnsArray.push({field: "sensorId", title: "传感器ID", width: 180,height: 60, colspan: 1, rowspan: 1, align: "center"});
|
|
|
|
|
columnsArray.push({field: "sensorType", title: "设备类型", width: 180,height: 60, colspan: 1, rowspan: 1, 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') {
|
|
|
|
|
if (property != "id" && property != "edgeId" && property != "sensorId" && property != 'sensorLocation' && property != 'datatype' && property != 'collectTime' && property != 'sensorType') {
|
|
|
|
|
columnsArray.push({
|
|
|
|
|
field: property,
|
|
|
|
|
title: typeof(sensorTypeArray.find(x=>x.paramTitle.includes(property))) == "undefined" ? property : sensorTypeArray.find(x=>x.paramTitle.includes(property)).paramText,
|
|
|
|
@ -75,8 +80,8 @@ const sensorInfoList = function (sensorTypeId) {
|
|
|
|
|
pageNumber: 1,
|
|
|
|
|
pagination: true,
|
|
|
|
|
sidePagination: 'client',
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
pageList: [5, 10, 15, 20, 25, 50],
|
|
|
|
|
pageSize: 40,
|
|
|
|
|
pageList: [20, 50, 100, 150, 200, 500],
|
|
|
|
|
showRefresh: false,
|
|
|
|
|
columns: columnsArray
|
|
|
|
|
});
|
|
|
|
|