zmc
2023-10-12 f3acb8ce787f3df0eda633031473be4e6a9ff448
src/views/analysis/graph/AllRate.vue
@@ -37,7 +37,7 @@
    </el-form-item>
 
       <el-form-item>
        <el-button type="primary" @click="fetchData">展示图</el-button>
        <el-button type="primary" :loading="button.showChartButton" @click="fetchData">展示图</el-button>
     </el-form-item> 
     </el-form>
@@ -58,6 +58,10 @@
export default {
  data() {
    return {
      button:{
        // 展示图的按钮
        showChartButton:false,
      },
      isNoData:false,
      chart:null,
      loading:false,
@@ -218,10 +222,12 @@
        params['end'] = this.end
      }
      this.loading = true
      this.button.showChartButton = true
      axiosInstanceInstance.get('/data/id',{params:params})
        .then(response => {
          this.chartData = response.data.data
          this.loading = false
          this.button.showChartButton = false
        if(response.data.data.length==0){
          alert('该时段无数据')
          this.isNoData = true
@@ -283,10 +289,7 @@
      this.chart = echarts.init(this.$refs.lineChart)
      this.chart.setOption({
        title: {
          text: '比率',
          //left: 'center'
        },
        grid: {
          left: '3%',
          right: '4%',
@@ -297,7 +300,7 @@
  
        legend: {
          data: ['净化器开启率','超标率','数据有效率','日在线率','中午在线率','晚上在线率','重点时段在线率','中午有效率','晚上有效率','重点时段有效率','中午开启率','晚上开启率','重点时段开启率','中午超标率','晚上超标率','重点时段超标率'],
          //type: "scroll"
        },
        toolbox: {    //工具栏
          top:20,