|
|
|
@ -130,13 +130,13 @@
|
|
|
|
|
$.post(ctx + 'system/TVibrationsensorData/realTimeMonitor', {sensorId: treeNode.id}, (e) => {
|
|
|
|
|
if (e.code === 0) {
|
|
|
|
|
let data = e.data || []
|
|
|
|
|
let html = ''
|
|
|
|
|
data.forEach(v => {
|
|
|
|
|
html += `
|
|
|
|
|
$("#chartDivs").html('')
|
|
|
|
|
data.forEach((v, k) => {
|
|
|
|
|
let html = `
|
|
|
|
|
<div class="chartDiv" id="chartDiv">
|
|
|
|
|
<div class="title">${v.monitorName}</div>
|
|
|
|
|
<div class="time">${v.collectTime}</div>
|
|
|
|
|
<div class="chart" id="chart">
|
|
|
|
|
<div class="chart" id="chart${k}">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mileage">
|
|
|
|
|
${v.displacement.toString().split('').map(vv => {
|
|
|
|
@ -146,63 +146,64 @@
|
|
|
|
|
<div class="text">位移(um)</div>
|
|
|
|
|
</div>
|
|
|
|
|
`
|
|
|
|
|
})
|
|
|
|
|
$("#chartDivs").html(html)
|
|
|
|
|
|
|
|
|
|
let chart = echarts.init(document.getElementById('chart'))
|
|
|
|
|
|
|
|
|
|
let option = {
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Pressure',
|
|
|
|
|
type: 'gauge',
|
|
|
|
|
detail: {
|
|
|
|
|
formatter: '{value}',
|
|
|
|
|
offsetCenter: [0, '20%'],
|
|
|
|
|
// offsetCenter: [0, '-40%'] ,
|
|
|
|
|
},
|
|
|
|
|
center: ['25%', '50%'],
|
|
|
|
|
radius: '90%',
|
|
|
|
|
data: [
|
|
|
|
|
{
|
|
|
|
|
value: 21,
|
|
|
|
|
name: '速度(mm/s)',
|
|
|
|
|
title: {
|
|
|
|
|
offsetCenter: [0, '-20%'],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Pressure',
|
|
|
|
|
type: 'gauge',
|
|
|
|
|
detail: {
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
formatter: '{value}'
|
|
|
|
|
$("#chartDivs").append(html)
|
|
|
|
|
|
|
|
|
|
let chart = echarts.init(document.getElementById(`chart${k}`))
|
|
|
|
|
|
|
|
|
|
let option = {
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Pressure',
|
|
|
|
|
type: 'gauge',
|
|
|
|
|
detail: {
|
|
|
|
|
formatter: '{value}',
|
|
|
|
|
offsetCenter: [0, '20%'],
|
|
|
|
|
// offsetCenter: [0, '-40%'] ,
|
|
|
|
|
},
|
|
|
|
|
center: ['25%', '50%'],
|
|
|
|
|
radius: '90%',
|
|
|
|
|
max: Math.ceil(v.speed / 100) * 100,
|
|
|
|
|
data: [
|
|
|
|
|
{
|
|
|
|
|
value: v.speed,
|
|
|
|
|
name: '速度(mm/s)',
|
|
|
|
|
title: {
|
|
|
|
|
offsetCenter: [0, '-20%'],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
center: ['60%', '70%'],
|
|
|
|
|
radius: '65%',
|
|
|
|
|
axisTick: {
|
|
|
|
|
|
|
|
|
|
distance: 4
|
|
|
|
|
{
|
|
|
|
|
name: 'Pressure',
|
|
|
|
|
type: 'gauge',
|
|
|
|
|
detail: {
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
formatter: '{value}'
|
|
|
|
|
},
|
|
|
|
|
center: ['60%', '70%'],
|
|
|
|
|
radius: '65%',
|
|
|
|
|
axisTick: {
|
|
|
|
|
|
|
|
|
|
distance: 4
|
|
|
|
|
},
|
|
|
|
|
pointer: {
|
|
|
|
|
length: '50%',
|
|
|
|
|
width: 4
|
|
|
|
|
},
|
|
|
|
|
data: [
|
|
|
|
|
{
|
|
|
|
|
value: v.temperature,
|
|
|
|
|
name: '温度(℃)',
|
|
|
|
|
detail: {
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
pointer: {
|
|
|
|
|
length: '50%',
|
|
|
|
|
width: 4
|
|
|
|
|
},
|
|
|
|
|
data: [
|
|
|
|
|
{
|
|
|
|
|
value: 32,
|
|
|
|
|
name: '温度(℃)',
|
|
|
|
|
detail: {
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
chart.setOption(option)
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
chart.setOption(option)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|