|
|
|
|
@ -9,11 +9,19 @@
|
|
|
|
|
<style>
|
|
|
|
|
.chartDiv {
|
|
|
|
|
width: 24.5%;
|
|
|
|
|
height: 22vw;
|
|
|
|
|
position: relative;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.height {
|
|
|
|
|
height: 22vw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.border {
|
|
|
|
|
border: 1px solid #0002;
|
|
|
|
|
padding: 0 1vw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chartDiv .chart {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: calc(100% - 50px);
|
|
|
|
|
@ -50,6 +58,11 @@
|
|
|
|
|
transform: translateX(-50%);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chartDiv .text1 {
|
|
|
|
|
font-size: 1.4vw;
|
|
|
|
|
line-height: 3vw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chartDiv .mileage .num {
|
|
|
|
|
font-size: 1vw;
|
|
|
|
|
margin: 0 0.1vw;
|
|
|
|
|
@ -118,16 +131,55 @@
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let time1 = null
|
|
|
|
|
let time2 = null
|
|
|
|
|
|
|
|
|
|
function queryDeptTree() {
|
|
|
|
|
var url = ctx + "system/Monitor/treeData?monitorType=" + 20;
|
|
|
|
|
var options = {
|
|
|
|
|
url: url,
|
|
|
|
|
expandLevel: 1,
|
|
|
|
|
onClick: zOnClick
|
|
|
|
|
check: {
|
|
|
|
|
enable: true,
|
|
|
|
|
nocheckInherit: false,
|
|
|
|
|
},
|
|
|
|
|
// onClick: zOnClick,
|
|
|
|
|
onCheck: onCheck
|
|
|
|
|
};
|
|
|
|
|
$.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) {
|
|
|
|
|
$.post(ctx + 'system/TVibrationsensorData/realTimeMonitor', {sensorId: treeNode.id}, (e) => {
|
|
|
|
|
if (e.code === 0) {
|
|
|
|
|
@ -135,7 +187,7 @@
|
|
|
|
|
$("#chartDivs").html('')
|
|
|
|
|
data.forEach((v, k) => {
|
|
|
|
|
let html = `
|
|
|
|
|
<div class="chartDiv" id="chartDiv">
|
|
|
|
|
<div class="chartDiv height" id="chartDiv">
|
|
|
|
|
<div class="title">${v.monitorName}</div>
|
|
|
|
|
<div class="time">${v.collectTime}</div>
|
|
|
|
|
<div class="chart" id="chart${k}">
|
|
|
|
|
@ -233,7 +285,7 @@
|
|
|
|
|
$("#chartDivs").html('')
|
|
|
|
|
data.forEach((v, k) => {
|
|
|
|
|
let html = `
|
|
|
|
|
<div class="chartDiv" id="chartDiv">
|
|
|
|
|
<div class="chartDiv height" id="chartDiv">
|
|
|
|
|
<div class="title">${v.monitorName}</div>
|
|
|
|
|
<div class="time">${v.collectTime}</div>
|
|
|
|
|
<div class="chart" id="chart${k}">
|
|
|
|
|
|