src/views/averageContrast/index.vue
@@ -20,7 +20,7 @@
        <el-radio-button label="日报" />
        <el-radio-button label="月报" />
      </el-radio-group> -->
      <component :is="dataType" style="padding-left:0;margin-left:20px;width:160px" @sendPickerChild="showPickerChild" />
      <component :is="dataType" style="padding-left:0;margin-left:20px;width:160px" @sendPickerChild="showPickerChild"  />
      <!--查询按钮-->
      <el-button @click="selectData" class="btn1">查询</el-button>
    </div>
@@ -41,6 +41,8 @@
import DatePicker from '@/components/Form/DatePicker'
import MouthPicker from '@/components/Form/MouthPicker'
import HourPicker from '@/components/Form/HourPicker'
import HourPicker2 from '@/components/Form/HourPicker2'
import CustomPicker from '@/components/Form/CustomPicker'
import json from '@/assets/json/sensor.json'
@@ -69,7 +71,8 @@
    DatePicker,
    MouthPicker,
    HourPicker,
    CustomPicker
    HourPicker2,
    CustomPicker,
  },
  filters: {
    sensorFilter: function(value) {
@@ -83,7 +86,7 @@
  data() {
    // 这里存放数据
    return {
      dataType: 'HourPicker',
      dataType: 'HourPicker2',
      lineChartData: lineChartData.purchases,
      props: { multiple: true },
      options: [],
@@ -94,7 +97,7 @@
      // newMac2:'',
      newSensor: [],
      radio1: '日报',
      unit: 1,
      unit: 0,
      type: 'select',
      newLineChartData: {
        series: [],
@@ -120,10 +123,10 @@
    },
    radio1(nv, ov) {
      if (nv === '日报') {
        this.dataType = 'HourPicker'
        this.dataType = 'HourPicker2'
        this.unit = 1
      } else if (nv === '月报') {
        this.dataType = 'DatePicker'
        this.dataType = 'MouthPicker2'
        this.unit = 3
      }
    }
@@ -234,7 +237,7 @@
        }
        this.lineChartData = newLineChartData
      }).catch((err) => {
        console.log(err)
        console.log(err);
      })
    },
    // 获得子组件时间选择器传递的数据
@@ -300,6 +303,7 @@
          return value2 - value1
        }
      }
    },
    // 过滤图表因子名称
    filterSensorName() {