fix
guoshipeng
2023-07-26 bfb69728c725d05b580f58e290cbb09b814f6fb0
src/views/contrast/index.vue
@@ -1,5 +1,5 @@
+<template>
  <div style="width: 100%; height: 100%">
  <div style="width: 100%; height: 100%; margin:0 auto">
    <div class="topSelect">
      <el-cascader
        v-model="newMac"
@@ -57,7 +57,7 @@
      <div style="position:absolute">(单位:ug/m³)</div>
      <div style="text-align: center;width: 100%;">{{ newData }}·{{ newMac?newMac[0]:'' }}·{{ newMac?newMac[newMac.length - 1][0]:'' }}·{{ value |sensorFilter }}·趋势图</div>
    </div> -->
    <LineChart :chart-data="lineChartData"  style="height: 23rem"/>
    <LineChart :chart-data="lineChartData"  style="height: 40rem;"/>
  </div>
</template>
@@ -274,6 +274,7 @@
        series: [],
        xAxis: [],
        title: [],
        yAxis:[]
      }
      this.newXData = []
      this.$request({
@@ -289,7 +290,6 @@
      })
        .then((res) => {
          // console.log('获得时间对应因子数据')
          console.log(res, 111)
          const data = res.data
          for (let i = 0; i < data.length; i++) {
            data[i].name = this.$options.filters.sensorFilter(
@@ -300,10 +300,10 @@
            newLineChartData.xAxis.push(data[0].timeValueList[i].time)
          }
          for (var i = 0; i < data.length; i++) {
             newLineChartData.series.push({ data: [], name: '', type: 'line' })
            newLineChartData.series.push({ data: [], name: '', type: 'line' ,yAxisIndex:data[i].code,lineStyle:{width:4}})
            // newLineChartData.yAxis.push({})
            newLineChartData.series[i].name = data[i].name
            newLineChartData.title.push(data[i].name);
            console.log(newLineChartData.series[i].name);
            for (var j = 0; j < data[i].timeValueList.length; j++) {
             newLineChartData.series[i].data.push(data[i].timeValueList[j].value)
            }