|
|
|
@ -25,8 +25,7 @@ const getParameter = function (dataType){
|
|
|
|
|
const sensorCollectionRefresh = function (monitorUnitId) {
|
|
|
|
|
/*setInterval(function() {
|
|
|
|
|
|
|
|
|
|
}, 5000);*/
|
|
|
|
|
|
|
|
|
|
}, 500);*/
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/iot/deviceMonitor/getSensorInfo?monitorunitId=" + monitorUnitId,
|
|
|
|
|
type: "get",
|
|
|
|
@ -45,55 +44,57 @@ const sensorCollectionRefresh = function (monitorUnitId) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const createDeviceModule = function (sensor,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: 80%;color: #00f9ff;width: 70%;">${sensor.sensorId}</div>`;
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 80%;color: #00f9ff;width: 70%;height: 15%;;display: flex;flex-direction: column;justify-content: center;">${sensor.sensorId}</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;">';
|
|
|
|
|
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: 80%;color: #00f9ff;width: 70%;">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 80%;color: #00f9ff;width: 70%;" 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;">${sensor['sensorStatus'] == null ? "-" : sensorStatus(sensor['sensorStatus'])}</p>`;
|
|
|
|
|
html+=`<p style="color: #00f9ff;float: left;margin-left: 10%">${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
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 += '</div>';
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "image":
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 80%;color: #00f9ff;width: 100%;border:0px solid #00f9ff;">${sensor.sensorId} ${sensor['sensorStatus'] == null ? "-" : sensorStatus(sensor['sensorStatus'])}</div>`
|
|
|
|
|
html += '<div style="position: absolute;height: 80%;width: 55%;border-right: 1px dashed #1CA2E7;left: 0%">';
|
|
|
|
|
let imgurl = sensor.imgstr.replace("D:/ruoyi/uploadPath","/profile");
|
|
|
|
|
html += '<img src="'+imgurl+'" display="inline-block" vertical-align="middle" width="100%" height="100%">'
|
|
|
|
|
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: 80%;color: #00f9ff;width: 100%;">${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: 80%;color: #00f9ff;width: 100%;">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</p>`;
|
|
|
|
|
}
|
|
|
|
|
html += '<div onclick="imgOnclick(this)" style="position: absolute;width: 100%;height: 100%;border: 0px solid red">';
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 80%;color: #00f9ff;width: 100%;border:0px solid #00f9ff;height: 15%;display: flex;align-items: center;">${sensor.sensorId} <span id=${sensor.sensorId+"sensorStatus"}>${sensor['sensorStatus'] == null ? "-" : sensorStatus(sensor['sensorStatus'])}</span></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+'" 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: 80%;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: 80%;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>';
|
|
|
|
|
}
|
|
|
|
|
html += '</div>';
|
|
|
|
|
html += '</div>';
|
|
|
|
|
|
|
|
|
|
html += `</div>`;
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "smoke":
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 80%;color: #00f9ff;width: 70%;">${sensor.sensorId}</div>`;
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 80%;color: #00f9ff;width: 70%;height: 15%;;display: flex;flex-direction: column;justify-content: center;">${sensor.sensorId}</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;">';
|
|
|
|
|
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: 80%;color: #00f9ff;width: 70%;">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 80%;color: #00f9ff;width: 70%;" 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;">${sensor['sensorStatus'] == null ? "-" : sensorStatus(sensor['sensorStatus'])}</p>`;
|
|
|
|
|
html+=`<p style="color: #00f9ff;float: left;margin-left: 10%">${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
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 += '</div>';
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
@ -101,27 +102,30 @@ const createDeviceModule = function (sensor,params) {
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "platen":
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 80%;color: #00f9ff;width: 70%;">${sensor.sensorId}</div>`;
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 80%;color: #00f9ff;width: 70%;height: 15%;;display: flex;flex-direction: column;justify-content: center;">${sensor.sensorId}</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;">';
|
|
|
|
|
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: 80%;color: #00f9ff;width: 70%;">${params[i].paramText+":"+(sensor[params[i].paramTitle] == null ? "-" : sensor[params[i].paramTitle])}</div>`;
|
|
|
|
|
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 80%;color: #00f9ff;width: 70%;" 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;">${sensor['sensorStatus'] == null ? "-" : sensorStatus(sensor['sensorStatus'])}</p>`;
|
|
|
|
|
html+=`<p style="color: #00f9ff;float: left;margin-left: 10%">${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
|
|
|
|
|
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 += '</div>';
|
|
|
|
|
|
|
|
|
|
$("#sensor-card-group").append(html);
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const imgOnclick = function (com) {
|
|
|
|
|
/*$("#imgWindow").append(com)*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const collectTime = function (time){
|
|
|
|
|
let oldTime = (new Date(time)).getTime();
|
|
|
|
|
let curTime = new Date(oldTime).format("yyyy-MM-dd hh:mm:ss");
|
|
|
|
|