|
|
@ -11,19 +11,24 @@ const sensorInfoList = function (sensorTypeId) {
|
|
|
|
json: 'callback',
|
|
|
|
json: 'callback',
|
|
|
|
processData: false,
|
|
|
|
processData: false,
|
|
|
|
contentType: false,
|
|
|
|
contentType: false,
|
|
|
|
|
|
|
|
beforeSend: function () {
|
|
|
|
|
|
|
|
$.modal.loading("正在处理中,请稍候...");
|
|
|
|
|
|
|
|
},
|
|
|
|
success: function (json) {
|
|
|
|
success: function (json) {
|
|
|
|
|
|
|
|
$.modal.closeLoading();
|
|
|
|
const sensorTypeArray = getparamsFunction(sensorTypeId);
|
|
|
|
const sensorTypeArray = getparamsFunction(sensorTypeId);
|
|
|
|
const columnsArray = [];
|
|
|
|
const columnsArray = [];
|
|
|
|
if(sensorTypeArray.length > 0){
|
|
|
|
if(sensorTypeArray.length > 0){
|
|
|
|
columnsArray.push({field: "id", title: "序号", width: 60,height: 60, colspan: 1, rowspan: 1, align: "center"});
|
|
|
|
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: "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) {
|
|
|
|
if (json.length > 0) {
|
|
|
|
const jsonObj = Object.keys(json[0]);
|
|
|
|
const jsonObj = Object.keys(json[0]);
|
|
|
|
console.log(jsonObj);
|
|
|
|
console.log(jsonObj);
|
|
|
|
for (let i = 0; i < jsonObj.length; i++) {//Object.keys(obj) 获取key名称
|
|
|
|
for (let i = 0; i < jsonObj.length; i++) {//Object.keys(obj) 获取key名称
|
|
|
|
let property = jsonObj[i];
|
|
|
|
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({
|
|
|
|
columnsArray.push({
|
|
|
|
field: property,
|
|
|
|
field: property,
|
|
|
|
title: typeof(sensorTypeArray.find(x=>x.paramTitle.includes(property))) == "undefined" ? property : sensorTypeArray.find(x=>x.paramTitle.includes(property)).paramText,
|
|
|
|
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,
|
|
|
|
pageNumber: 1,
|
|
|
|
pagination: true,
|
|
|
|
pagination: true,
|
|
|
|
sidePagination: 'client',
|
|
|
|
sidePagination: 'client',
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 40,
|
|
|
|
pageList: [5, 10, 15, 20, 25, 50],
|
|
|
|
pageList: [20, 50, 100, 150, 200, 500],
|
|
|
|
showRefresh: false,
|
|
|
|
showRefresh: false,
|
|
|
|
columns: columnsArray
|
|
|
|
columns: columnsArray
|
|
|
|
});
|
|
|
|
});
|
|
|
|