guoshipeng
2023-07-31 8b1000ebcfabd9484ac07645ee91e726fd7812bd
src/views/charts/index.vue
@@ -194,8 +194,7 @@
        one === 'a34002' ||
        one === 'a21004' ||
        one === 'a21026' ||
        one === 'a05024' ||
        one === 'a21001'
        one === 'a05024'
      ) {
        this.selectyz = '(单位:ug/m³)'
      } else if (
@@ -223,7 +222,13 @@
        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)'
      }
    },
@@ -247,6 +252,7 @@
  methods: {
    // 查询数据
    selectData() {
      console.log(this.newData)
      var newLineChartData = {
        series: [],
        xAxis: [],
@@ -282,32 +288,24 @@
                    },
                  })
                }
              } else if (lockLength < data[i].deviceData.length) {
              } else {
                newLineChartData.series.push({
                  data: [],
                  name: '',
                  type: 'line',
                  label: {
                    show: false,
                    position: 'top',
                  },
                })
              }
              newLineChartData.series[j].name = data[i].deviceData[j].name
              newLineChartData.title.push(data[i].deviceData[j].name)
              lockLength++
              newLineChartData.series[j].data.push(
                data[i].deviceData[j].sensorValue
              )
            }
            newLineChartData.xAxis.push(data[i].time)
          }
          // newLineChartData.title = this.value
          this.lineChartData = newLineChartData
          // console.log(newLineChartData, 'newLineChartData')
          console.log(lineChartData, 'newLineChartData')
        })
        .catch((err) => {
          console.log(err)
@@ -349,6 +347,7 @@
    },
    // 通过设备号获得因子数据
    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]