zmc
2023-12-22 c7e4dd9bd50cf6e6426598753c796ec1a27f333f
src/views/HistoryFume.vue
@@ -5,7 +5,6 @@
import axiosInstanceInstance from '../utils/request.js'
import TimeSelect from '../sfc/TimeSelect.vue';
// import ShopNameAndID from '../sfc/TimeSelect.vue';
const ShopNameAndID = defineAsyncComponent(() =>
  import('../sfc/../sfc/ShopNameAndID.vue')
@@ -23,6 +22,10 @@
},
  data() {
    return {
      button:{
        // 查询的按钮
        queryButton:false,
      },
      // 空状态
      isNoData:false,
      // 下拉框一开始展示的名字
@@ -159,7 +162,6 @@
            }
          ]
        }
        console.log('option为:',this.options);
      }
      else if (this.radio == 2) {
         // x轴日期时间
@@ -197,7 +199,6 @@
         
        ]
        }
        console.log('option为:',this.options);
      }
      else {
        // x轴日期时间
@@ -241,11 +242,8 @@
        ]
        }
      }
      console.log('option为:',this.options);
      }
      else{
        console.log('exceedingData无数据');
      }
      
    
  },
@@ -262,7 +260,6 @@
    this.exportBeginTime =this.beginTime
    this.exportEndTime = this.endTime
    console.log(this.currentDateTime, this.oneWeekAgoDateTime);
    let params = {};
    params['devId'] = 'qinshi_31010320210010';
@@ -285,9 +282,6 @@
        this.total = this.exceedingData.length;
        // 默认显示第一页
        this.handleCurrentChange(1);
        // this.drawChart();
        this.loading = false;
        console.log('历史数据为:', this.exceedingData);
      })
  
  },
@@ -312,6 +306,7 @@
      params['endTime'] = this.endTime;
    }
    this.loading=true
    this.button.queryButton = true
    axiosInstanceInstance
      .get('/fume/history', { params: params })
      .then((response) => {
@@ -319,7 +314,7 @@
        // 保存返回的
        this.exceedingData = response.data.data;
        this.loading=false
        this.button.queryButton = false
        if(response.data.data.length==0){
          ElMessage('该时段无数据')
          this.isNoData = true
@@ -327,13 +322,10 @@
        }
        // 移除空数据状态
        this.isNoData = false
        // this.displayData = response.data.data   //表格渲染
        // 分页
        this.total = this.exceedingData.length;
        // 默认显示第一页
        this.handleCurrentChange(1);
        // 展示折线图
        // this.drawChart();
      })
  },
@@ -368,7 +360,6 @@
    axiosInstanceInstance.get('/fume/export', { params: params }).then((result) => {
      this.exportData = result.data.data;
      console.log(this.exportData);
    });
  },
  exportExcel() {
@@ -432,7 +423,6 @@
    const year2 = date2.getFullYear();
    const month2 = date2.getMonth();
    const day2 = date2.getDate();
    console.log(month1, month2);
    // 判断两个日期是否相差一个月
    if (year1 === year2) {
@@ -488,7 +478,7 @@
      <!-- <el-date-picker v-model="beginTime" type="datetime" placeholder="开始时间" value-format="YYYY-MM-DD HH:mm:ss" />
      <el-date-picker v-model="endTime" type="datetime" placeholder="结束时间" value-format="YYYY-MM-DD HH:mm:ss" /> -->
      <TimeSelect @submit-time="giveTime"></TimeSelect>
      <el-button type="primary" plain @click="lineChart">查询</el-button>
      <el-button type="primary" plain :loading="button.queryButton" @click="lineChart">查询</el-button>
      <el-tooltip
@@ -680,4 +670,8 @@
.el-table {
  color: #000000;
}
.chart-container {
  height: 60vh;
  width:80vw
}
</style>