| | |
| | | } |
| | | // 设备更新后,重新获取因子数据 |
| | | this.getSensor() |
| | | console.log(this.newMac1) |
| | | }, |
| | | // 监听dataType的数据更新 |
| | | select1(nv, ov) { |
| | |
| | | }) |
| | | .then((res) => { |
| | | // console.log('获得时间对应因子数据') |
| | | console.log(res) |
| | | const data = res.data |
| | | let lockLength = 0 |
| | | for (let i = 0; i < data.length; i++) { |
| | | for (let j = 0; j < data[i].deviceData.length; j++) { |
| | | // console.log(data[i].deviceData); |
| | | if (res.data[0].deviceData.length == 1) { |
| | | if (res.data[0].deviceData.length === 1) { |
| | | if (lockLength < data[i].deviceData.length) { |
| | | newLineChartData.series.push({ |
| | | data: [], |
| | | name: '', |
| | | type: 'line', |
| | | label: { |
| | | show: true, |
| | | position: 'top', |
| | | }, |
| | | }) |
| | | } |
| | | } else if (lockLength < data[i].deviceData.length) { |
| | | newLineChartData.series.push({ |
| | | data: [], |
| | | name: '', |
| | |
| | | newLineChartData.series[j].data.push( |
| | | data[i].deviceData[j].sensorValue |
| | | ) |
| | | |
| | | |
| | | |
| | | } |
| | | newLineChartData.xAxis.push(data[i].time) |
| | | } |