| | |
| | | value: '小时报', |
| | | }, |
| | | { |
| | | label: '五分钟报', |
| | | value: '五分钟报', |
| | | }, |
| | | { |
| | | label: '日报', |
| | | value: '日报', |
| | | }, |
| | |
| | | } |
| | | // 设备更新后,重新获取因子数据 |
| | | this.getSensor() |
| | | console.log(this.newMac1) |
| | | }, |
| | | // 监听dataType的数据更新 |
| | | select1(nv, ov) { |
| | |
| | | } else if (nv === '小时报') { |
| | | this.dataType = 'HourPicker1' |
| | | this.unit = 'hour' |
| | | } else if (nv === '五分钟报') { |
| | | this.dataType = 'HourPicker1' |
| | | this.unit = 'FiveMinute' |
| | | } else { |
| | | this.dataType = 'CustomPicker' |
| | | this.unit = 'hour' |
| | |
| | | one === 'a34002' || |
| | | one === 'a21004' || |
| | | one === 'a21026' || |
| | | one === 'a05024' || |
| | | one === 'a21001' |
| | | one === 'a05024' |
| | | ) { |
| | | this.selectyz = '(单位:ug/m³)' |
| | | } else if ( |
| | |
| | | this.selectyz = '(单位:pcs/0.1L)' |
| | | } else if (one === 'a00e13') { |
| | | this.selectyz = '(单位:db)' |
| | | } else if (one === 'a21028') { |
| | | } else if ( |
| | | one === 'a21028' || |
| | | one === 'a25002' || |
| | | one === 'a21001' || |
| | | one === 'a25005' || |
| | | one === 'a25003' |
| | | ) { |
| | | this.selectyz = '(单位:ppm)' |
| | | } |
| | | }, |
| | |
| | | methods: { |
| | | // 查询数据 |
| | | selectData() { |
| | | console.log(this.newData) |
| | | var newLineChartData = { |
| | | series: [], |
| | | xAxis: [], |
| | |
| | | }) |
| | | .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) { |
| | | newLineChartData.series.push({ |
| | | data: [], |
| | | name: '', |
| | | type: 'line', |
| | | label: { |
| | | show: true, |
| | | position: 'top', |
| | | }, |
| | | }) |
| | | if (res.data[0].deviceData.length === 1) { |
| | | if (lockLength < data[i].deviceData.length) { |
| | | newLineChartData.series.push({ |
| | | data: [], |
| | | // large: true, |
| | | name: '', |
| | | type: 'line', |
| | | label: { |
| | | show: true, |
| | | position: 'top', |
| | | }, |
| | | }) |
| | | } |
| | | } else { |
| | | newLineChartData.series.push({ |
| | | data: [], |
| | | name: '', |
| | | // large: true, |
| | | type: 'line', |
| | | }) |
| | | } |
| | |
| | | }, |
| | | // 通过设备号获得因子数据 |
| | | getSensor() { |
| | | this.newSensor = [] |
| | | // stringMacs.su |
| | | // var newMac = this.newMac[this.newMac.length - 1][this.newMac[this.newMac.length - 1].length - 1] |
| | | // this.newMac1 = this.newMac[this.newMac.length - 1][this.newMac[this.newMac.length - 1].length - 1] |