|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
const getParameter = function (dataType){
|
|
|
|
|
const getParameter = async function (dataType) {
|
|
|
|
|
var returnData;
|
|
|
|
|
let formData = new FormData();
|
|
|
|
|
formData.append("sensorTypeId", dataType);
|
|
|
|
|
$.ajax({
|
|
|
|
|
await $.ajax({
|
|
|
|
|
type: "post",
|
|
|
|
|
url: "/base/sysParamConfig/getParameter",
|
|
|
|
|
data: formData,
|
|
|
|
@ -11,31 +11,33 @@ const getParameter = function (dataType){
|
|
|
|
|
json: 'callback',
|
|
|
|
|
processData: false,
|
|
|
|
|
contentType: false,
|
|
|
|
|
async: false,
|
|
|
|
|
async: true,
|
|
|
|
|
success: function (json) {
|
|
|
|
|
returnData = json;
|
|
|
|
|
return returnData;
|
|
|
|
|
},
|
|
|
|
|
error: function () {
|
|
|
|
|
alert("错误");
|
|
|
|
|
// alert("错误");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return returnData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const sensorCollectionRefresh = function (monitorUnitId) {
|
|
|
|
|
/*setInterval(function() {
|
|
|
|
|
|
|
|
|
|
}, 500);*/
|
|
|
|
|
const sensorCollectionRefresh = function (monitorUnitId,params) {
|
|
|
|
|
console.log(params)
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/iot/deviceMonitor/getSensorInfo?monitorunitId=" + monitorUnitId,
|
|
|
|
|
url: "/iot/deviceMonitor/getSensorInfo?monitorunitId=" + monitorUnitId+'&pageNum='+(params?.pageNum||1)+'&pageSize='+(params?.pageSize||10),
|
|
|
|
|
type: "get",
|
|
|
|
|
dataType: 'JSON',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
if (params.pageNum === 1) {
|
|
|
|
|
$("#sensor-card-group").html("");
|
|
|
|
|
res.map(x=>{
|
|
|
|
|
let params = getParameter(x.datatype);
|
|
|
|
|
createDeviceModule(x,params);
|
|
|
|
|
}
|
|
|
|
|
res.map(async (x) => {
|
|
|
|
|
let params = await getParameter(x.datatype);
|
|
|
|
|
createDeviceModule(x, params);
|
|
|
|
|
})
|
|
|
|
|
loading = false
|
|
|
|
|
},
|
|
|
|
|
error: () => {
|
|
|
|
|
console.log("失败");
|
|
|
|
@ -43,21 +45,23 @@ const sensorCollectionRefresh = function (monitorUnitId) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const createDeviceModule = function (sensor,params) {
|
|
|
|
|
const createDeviceModule = function (sensor, params) {
|
|
|
|
|
// console.log(sensor)
|
|
|
|
|
// console.log(params)
|
|
|
|
|
let html = '<div class="card sensor-card" style="border: 0px solid red;margin-right: 2%;margin-top:2%;overflow-x: hidden; overflow-y: auto;">';
|
|
|
|
|
switch (sensor.datatype) {
|
|
|
|
|
case "temperature":
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;height: 15%;;display: flex;flex-direction: column;justify-content: center;">${sensor.sensorName}</div>`;
|
|
|
|
|
|
|
|
|
|
html += '<div style="position: absolute;width: 98%;height: 65%;border-top: 1px dashed #1CA2E7;border-bottom: 1px dashed #1CA2E7;left:1%;overflow-x: hidden; overflow-y: auto;display: flex;flex-direction: column;justify-content: center;">';
|
|
|
|
|
for (let i=0; i<params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId+params[i].paramTitle}">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
for (let i = 0; i < params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId + params[i].paramTitle}">${params[i].paramText + ":" + (sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
}
|
|
|
|
|
html += '</div>';
|
|
|
|
|
html += '<div style="position: absolute;left: 0%;width: 98%;height: 18%;border: 0px solid red;bottom: 1%; padding-top: 3%;padding-left: 0%">';
|
|
|
|
|
//html+=`<p style="color: #00f9ff;float: left;" id=${sensor.sensorId+"sensorStatus"}>${sensor['sensorStatus'] == null ? "-" : sensorStatus(sensor['sensorStatus'])}</p>`;
|
|
|
|
|
html+=`<p style="color: #00f9ff;float: left;margin-left: 3%" id=${sensor.sensorId+"collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += '<button onclick="temperatureTrend(\''+sensor.sensorId+",temperature"+ '\')" style="color: #00f9ff;float:right;margin-right: 1%;margin-top: -1%;background-color: #1C84C6;border: 1px solid #1C84C6;border-radius:3px;">趋势分析</button>'
|
|
|
|
|
html += `<p style="color: #00f9ff;float: left;margin-left: 3%" id=${sensor.sensorId + "collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += '<button onclick="temperatureTrend(\'' + sensor.sensorId + ",temperature" + '\')" style="color: #00f9ff;float:right;margin-right: 1%;margin-top: -1%;background-color: #1C84C6;border: 1px solid #1C84C6;border-radius:3px;">趋势分析</button>'
|
|
|
|
|
html += '</div>';
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
@ -67,12 +71,12 @@ const createDeviceModule = function (sensor,params) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;height: 15%;;display: flex;flex-direction: column;justify-content: center;">${sensor.sensorName}</div>`;
|
|
|
|
|
|
|
|
|
|
html += '<div style="position: absolute;width: 98%;height: 65%;border-top: 1px dashed #1CA2E7;border-bottom: 1px dashed #1CA2E7;left:1%;overflow-x: hidden; overflow-y: auto;display: flex;flex-direction: column;justify-content: center;">';
|
|
|
|
|
for (let i=0; i<params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId+params[i].paramTitle}">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
for (let i = 0; i < params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId + params[i].paramTitle}">${params[i].paramText + ":" + (sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
}
|
|
|
|
|
html += '</div>';
|
|
|
|
|
html += '<div style="position: absolute;left: 0%;width: 98%;height: 18%;border: 0px solid red;bottom: 1%; padding-top: 3%;padding-left: 0%">';
|
|
|
|
|
html+=`<p style="color: #00f9ff;float: left;margin-left: 3%" id=${sensor.sensorId+"collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += `<p style="color: #00f9ff;float: left;margin-left: 3%" id=${sensor.sensorId + "collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += '</div>';
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
@ -82,14 +86,14 @@ const createDeviceModule = function (sensor,params) {
|
|
|
|
|
html += '<div style="position: absolute;width: 100%;height: 100%;border: 0px solid red">';
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;border:0px solid #00f9ff;height: 15%;display: flex;align-items: center;">${sensor.sensorName}</div>`
|
|
|
|
|
html += '<div class="example" style="position: absolute;height: 80%;width: 52%;border-right: 1px dashed #1CA2E7;left: 1%;display: flex;align-items: center;justify-content: center;">';
|
|
|
|
|
let imgurl = sensor.imgstr.replace("D:/ruoyi/uploadPath","/profile");
|
|
|
|
|
html += '<img id="'+sensor.sensorId+"imgstr"+'" src="'+imgurl+'" onclick="imgOnclick(this)" display="inline-block" vertical-align="middle" width="100%" height="80%">'
|
|
|
|
|
let imgurl = sensor.imgstr.replace("D:/ruoyi/uploadPath", "/profile");
|
|
|
|
|
html += '<img id="' + sensor.sensorId + "imgstr" + '" src="' + imgurl + '" onclick=\'imgOnclick(this,"' + imgurl + '")\' display="inline-block" vertical-align="middle" width="100%" height="80%">'
|
|
|
|
|
html += '</div>'
|
|
|
|
|
html += '<div style="position: absolute;width: 45%;height: 80%;border: 0px dashed #1CA2E7;right:0%;overflow-x: hidden; overflow-y: auto;">';
|
|
|
|
|
html += `<p style="padding-top: 1px;font-size: 105%;color: #00f9ff;width: 100%;" id=${sensor.sensorId+"collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
for (let i=0; i<params.length; i++) {
|
|
|
|
|
if(!params[i].paramTitle.includes("img")) {
|
|
|
|
|
html += `<p style="padding-top: 1px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId+params[i].paramTitle}">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</p>`;
|
|
|
|
|
html += `<p style="padding-top: 1px;font-size: 105%;color: #00f9ff;width: 100%;" id=${sensor.sensorId + "collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
for (let i = 0; i < params.length; i++) {
|
|
|
|
|
if (!params[i].paramTitle.includes("img")) {
|
|
|
|
|
html += `<p style="padding-top: 1px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId + params[i].paramTitle}">${params[i].paramText + ":" + (sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</p>`;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
html += '</div>';
|
|
|
|
@ -104,12 +108,12 @@ const createDeviceModule = function (sensor,params) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;height: 15%;;display: flex;flex-direction: column;justify-content: center;">${sensor.sensorName}</div>`;
|
|
|
|
|
|
|
|
|
|
html += '<div style="position: absolute;width: 98%;height: 65%;border-top: 1px dashed #1CA2E7;border-bottom: 1px dashed #1CA2E7;left:1%;overflow-x: hidden; overflow-y: auto;display: flex;flex-direction: column;justify-content: center;">';
|
|
|
|
|
for (let i=0; i<params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId+params[i].paramTitle}">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
for (let i = 0; i < params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId + params[i].paramTitle}">${params[i].paramText + ":" + (sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
}
|
|
|
|
|
html += '</div>';
|
|
|
|
|
html += '<div style="position: absolute;left: 1%;width: 98%;height: 18%;border: 0px solid red;bottom: 1%; padding-top: 2%;padding-left: 25%">';
|
|
|
|
|
html+=`<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId+"collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += `<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId + "collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += '</div>';
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
@ -119,12 +123,12 @@ const createDeviceModule = function (sensor,params) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;height: 15%;;display: flex;flex-direction: column;justify-content: center;">${sensor.sensorName}</div>`;
|
|
|
|
|
|
|
|
|
|
html += '<div style="position: absolute;width: 98%;height: 65%;border-top: 1px dashed #1CA2E7;border-bottom: 1px dashed #1CA2E7;left:1%;overflow-x: hidden; overflow-y: auto;display: flex;flex-direction: column;justify-content: center;">';
|
|
|
|
|
for (let i=0; i<params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId+params[i].paramTitle}">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
for (let i = 0; i < params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId + params[i].paramTitle}">${params[i].paramText + ":" + (sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
}
|
|
|
|
|
html += '</div>';
|
|
|
|
|
html += '<div style="position: absolute;left: 1%;width: 98%;height: 18%;border: 0px solid red;bottom: 1%; padding-top: 2%;padding-left: 25%">';
|
|
|
|
|
html+=`<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId+"collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += `<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId + "collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += '</div>';
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
@ -134,12 +138,12 @@ const createDeviceModule = function (sensor,params) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;height: 15%;;display: flex;flex-direction: column;justify-content: center;">${sensor.sensorName}</div>`;
|
|
|
|
|
|
|
|
|
|
html += '<div style="position: absolute;width: 98%;height: 65%;border-top: 1px dashed #1CA2E7;border-bottom: 1px dashed #1CA2E7;left:1%;overflow-x: hidden; overflow-y: auto;display: flex;flex-direction: column;justify-content: center;">';
|
|
|
|
|
for (let i=0; i<params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId+params[i].paramTitle}">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
for (let i = 0; i < params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId + params[i].paramTitle}">${params[i].paramText + ":" + (sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
}
|
|
|
|
|
html += '</div>';
|
|
|
|
|
html += '<div style="position: absolute;left: 1%;width: 98%;height: 18%;border: 0px solid red;bottom: 1%; padding-top: 2%;padding-left: 25%">';
|
|
|
|
|
html+=`<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId+"collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += `<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId + "collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += '</div>';
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
@ -149,12 +153,12 @@ const createDeviceModule = function (sensor,params) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;height: 15%;;display: flex;flex-direction: column;justify-content: center;">${sensor.sensorName}</div>`;
|
|
|
|
|
|
|
|
|
|
html += '<div style="position: absolute;width: 98%;height: 65%;border-top: 1px dashed #1CA2E7;border-bottom: 1px dashed #1CA2E7;left:1%;overflow-x: hidden; overflow-y: auto;display: flex;flex-direction: column;justify-content: center;">';
|
|
|
|
|
for (let i=0; i<params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId+params[i].paramTitle}">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
for (let i = 0; i < params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId + params[i].paramTitle}">${params[i].paramText + ":" + (sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
}
|
|
|
|
|
html += '</div>';
|
|
|
|
|
html += '<div style="position: absolute;left: 1%;width: 98%;height: 18%;border: 0px solid red;bottom: 1%; padding-top: 2%;padding-left: 25%">';
|
|
|
|
|
html+=`<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId+"collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += `<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId + "collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += '</div>';
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
@ -164,13 +168,13 @@ const createDeviceModule = function (sensor,params) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;height: 15%;;display: flex;flex-direction: column;justify-content: center;">${sensor.sensorName}</div>`;
|
|
|
|
|
|
|
|
|
|
html += '<div style="position: absolute;width: 98%;height: 65%;border-top: 1px dashed #1CA2E7;border-bottom: 1px dashed #1CA2E7;left:1%;overflow-x: hidden; overflow-y: auto;display: flex;flex-direction: column;justify-content: center;">';
|
|
|
|
|
for (let i=0; i<params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId+params[i].paramTitle}">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
for (let i = 0; i < params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId + params[i].paramTitle}">${params[i].paramText + ":" + (sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
}
|
|
|
|
|
html += '</div>';
|
|
|
|
|
html += '<div style="position: absolute;left: 1%;width: 98%;height: 18%;border: 0px solid red;bottom: 1%; padding-top: 2%;padding-left: 25%">';
|
|
|
|
|
//html+=`<p style="color: #00f9ff;float: left;" id=${sensor.sensorId+"sensorStatus"}>${sensor['sensorStatus'] == null ? "-" : sensorStatus(sensor['sensorStatus'])}</p>`;
|
|
|
|
|
html+=`<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId+"collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += `<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId + "collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += '</div>';
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
@ -180,12 +184,12 @@ const createDeviceModule = function (sensor,params) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;height: 15%;;display: flex;flex-direction: column;justify-content: center;">${sensor.sensorName}</div>`;
|
|
|
|
|
|
|
|
|
|
html += '<div style="position: absolute;width: 98%;height: 65%;border-top: 1px dashed #1CA2E7;border-bottom: 1px dashed #1CA2E7;left:1%;overflow-x: hidden; overflow-y: auto;display: flex;flex-direction: column;justify-content: center;">';
|
|
|
|
|
for (let i=0; i<params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId+params[i].paramTitle}">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
for (let i = 0; i < params.length; i++) {
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;" id="${sensor.sensorId + params[i].paramTitle}">${params[i].paramText + ":" + (sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
}
|
|
|
|
|
html += '</div>';
|
|
|
|
|
html += '<div style="position: absolute;left: 1%;width: 98%;height: 18%;border: 0px solid red;bottom: 1%; padding-top: 2%;padding-left: 25%">';
|
|
|
|
|
html+=`<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId+"collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += `<p style="color: #00f9ff;float: left;margin-left: 10%" id=${sensor.sensorId + "collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
html += '</div>';
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
@ -193,21 +197,33 @@ const createDeviceModule = function (sensor,params) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const imgOnclick = function (com) {
|
|
|
|
|
Dialog({
|
|
|
|
|
title: '图像详情',
|
|
|
|
|
width: 600,
|
|
|
|
|
imageContent: {
|
|
|
|
|
src: com.src,
|
|
|
|
|
height: 480
|
|
|
|
|
},
|
|
|
|
|
showButton: false,
|
|
|
|
|
showTitle: true,
|
|
|
|
|
maskClose: true
|
|
|
|
|
});
|
|
|
|
|
const imgOnclick = function (com, e) {
|
|
|
|
|
$('#imgMagnification').css({
|
|
|
|
|
display:'block',
|
|
|
|
|
})
|
|
|
|
|
$('#imgMagnification #center #centerImg').attr('src',e)
|
|
|
|
|
$('#imgMagnification #center #centerImg').css({
|
|
|
|
|
transform:`scale(1.5,1.5)`
|
|
|
|
|
})
|
|
|
|
|
$('#imgMagnification #closeBtn').click(function (){
|
|
|
|
|
$('#imgMagnification').css({
|
|
|
|
|
display:'none',
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
// Dialog({
|
|
|
|
|
// title: '图像详情',
|
|
|
|
|
// width: 1920,
|
|
|
|
|
// imageContent: {
|
|
|
|
|
// src: com.src,
|
|
|
|
|
// height: 940
|
|
|
|
|
// },
|
|
|
|
|
// showButton: false,
|
|
|
|
|
// showTitle: true,
|
|
|
|
|
// maskClose: true
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const collectTime = function (time){
|
|
|
|
|
const collectTime = function (time) {
|
|
|
|
|
let oldTime = (new Date(time)).getTime();
|
|
|
|
|
let curTime = new Date(oldTime).format("yyyy-MM-dd hh:mm:ss");
|
|
|
|
|
return curTime;
|
|
|
|
@ -232,22 +248,22 @@ const sensorStatus = function (status) {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Date.prototype.format = function(fmt) {
|
|
|
|
|
Date.prototype.format = function (fmt) {
|
|
|
|
|
var o = {
|
|
|
|
|
"M+" : this.getMonth()+1, //月份
|
|
|
|
|
"d+" : this.getDate(), //日
|
|
|
|
|
"h+" : this.getHours(), //小时
|
|
|
|
|
"m+" : this.getMinutes(), //分
|
|
|
|
|
"s+" : this.getSeconds(), //秒
|
|
|
|
|
"q+" : Math.floor((this.getMonth()+3)/3), //季度
|
|
|
|
|
"S" : this.getMilliseconds() //毫秒
|
|
|
|
|
"M+": this.getMonth() + 1, //月份
|
|
|
|
|
"d+": this.getDate(), //日
|
|
|
|
|
"h+": this.getHours(), //小时
|
|
|
|
|
"m+": this.getMinutes(), //分
|
|
|
|
|
"s+": this.getSeconds(), //秒
|
|
|
|
|
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
|
|
|
|
"S": this.getMilliseconds() //毫秒
|
|
|
|
|
};
|
|
|
|
|
if(/(y+)/.test(fmt)) {
|
|
|
|
|
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
|
|
|
|
|
if (/(y+)/.test(fmt)) {
|
|
|
|
|
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
|
|
|
}
|
|
|
|
|
for(var k in o) {
|
|
|
|
|
if(new RegExp("("+ k +")").test(fmt)){
|
|
|
|
|
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
|
|
|
|
|
for (var k in o) {
|
|
|
|
|
if (new RegExp("(" + k + ")").test(fmt)) {
|
|
|
|
|
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return fmt;
|
|
|
|
@ -259,7 +275,7 @@ const temperatureTrend = function (sensorId) {
|
|
|
|
|
title: "趋势分析",
|
|
|
|
|
width: 1100,
|
|
|
|
|
iframeContent: {
|
|
|
|
|
src: "/record/recordSensorData/getTemperatureTrend?id="+sensorId,
|
|
|
|
|
src: "/record/recordSensorData/getTemperatureTrend?id=" + sensorId,
|
|
|
|
|
height: 600
|
|
|
|
|
},
|
|
|
|
|
showButton: false
|
|
|
|
|