修改振动实时监控

master
suixy 5 days ago
parent b92786862d
commit c2cd58cebd

@ -9,11 +9,19 @@
<style> <style>
.chartDiv { .chartDiv {
width: 24.5%; width: 24.5%;
height: 22vw;
position: relative; position: relative;
display: inline-block; display: inline-block;
} }
.height {
height: 22vw;
}
.border {
border: 1px solid #0002;
padding: 0 1vw;
}
.chartDiv .chart { .chartDiv .chart {
width: 100%; width: 100%;
height: calc(100% - 50px); height: calc(100% - 50px);
@ -50,6 +58,11 @@
transform: translateX(-50%); transform: translateX(-50%);
} }
.chartDiv .text1 {
font-size: 1.4vw;
line-height: 3vw;
}
.chartDiv .mileage .num { .chartDiv .mileage .num {
font-size: 1vw; font-size: 1vw;
margin: 0 0.1vw; margin: 0 0.1vw;
@ -118,16 +131,55 @@
}); });
let time1 = null let time1 = null
let time2 = null
function queryDeptTree() { function queryDeptTree() {
var url = ctx + "system/Monitor/treeData?monitorType=" + 20; var url = ctx + "system/Monitor/treeData?monitorType=" + 20;
var options = { var options = {
url: url, url: url,
expandLevel: 1, expandLevel: 1,
onClick: zOnClick check: {
enable: true,
nocheckInherit: false,
},
// onClick: zOnClick,
onCheck: onCheck
}; };
$.tree.init(options); $.tree.init(options);
function onCheck(event, treeId, treeNode) {
const intervalFun = () => {
$.post(ctx + 'system/TVibrationsensorData/realTimeMonitor', {sensorId: $.tree.getCheckedNodes()}, (e) => {
let data = e.data || []
// let data = [{}, {}, {}]
$("#chartDivs").html('')
data.forEach((v, k) => {
let html = `
<div class="chartDiv border" id="chartDiv">
<div class="title">${v.monitorName}</div>
<div class="time">${v.collectTime}</div>
<div class="text1">速度:${v.speed}mm/s</div>
<div class="text1">位移:${v.displacement}um</div>
<div class="text1">温度:${v.temperature}℃</div>
</div>
`
$("#chartDivs").append(html)
})
})
}
intervalFun()
if (time2) {
clearInterval(time2)
time2 = null
}
time1 = setInterval(() => {
intervalFun()
}, 1000 * 60)
}
function zOnClick(event, treeId, treeNode) { function zOnClick(event, treeId, treeNode) {
$.post(ctx + 'system/TVibrationsensorData/realTimeMonitor', {sensorId: treeNode.id}, (e) => { $.post(ctx + 'system/TVibrationsensorData/realTimeMonitor', {sensorId: treeNode.id}, (e) => {
if (e.code === 0) { if (e.code === 0) {
@ -135,7 +187,7 @@
$("#chartDivs").html('') $("#chartDivs").html('')
data.forEach((v, k) => { data.forEach((v, k) => {
let html = ` let html = `
<div class="chartDiv" id="chartDiv"> <div class="chartDiv height" id="chartDiv">
<div class="title">${v.monitorName}</div> <div class="title">${v.monitorName}</div>
<div class="time">${v.collectTime}</div> <div class="time">${v.collectTime}</div>
<div class="chart" id="chart${k}"> <div class="chart" id="chart${k}">
@ -233,7 +285,7 @@
$("#chartDivs").html('') $("#chartDivs").html('')
data.forEach((v, k) => { data.forEach((v, k) => {
let html = ` let html = `
<div class="chartDiv" id="chartDiv"> <div class="chartDiv height" id="chartDiv">
<div class="title">${v.monitorName}</div> <div class="title">${v.monitorName}</div>
<div class="time">${v.collectTime}</div> <div class="time">${v.collectTime}</div>
<div class="chart" id="chart${k}"> <div class="chart" id="chart${k}">

Loading…
Cancel
Save