zmc
2023-11-14 0ee16e9f5dd31c6c98df1a5fdcf081c8eb7f80df
src/views/line_graph/SiteComprehensiveRskRanking.vue
@@ -11,6 +11,8 @@
import SiteDetail from '@/views/line_graph/components/SiteDetail.vue'
import { useLoadingStore } from '@/stores/loadingStore';
import { mapStores } from 'pinia';
import riskApi from '@/api/risk/riskApi.js';
import riskValue from '@/utils/risk_estimate_common_function/riskValue.js';
export default {
  components: {
    AreaAndmonitorType,
@@ -109,47 +111,69 @@
      this.tableHeight = `calc(100vh - ${h1}px  - 40px - 40px - var(--el-main-padding) * 2`
    },
    // 点击风险排名按钮
    fetchData() {
    // fetchData() {
    //   this.loading = true
    //   this.queryButton = true
    //   exceptionApi
    //     .analysisdataByType(this.form.month, 'month')
    //     .then((response) => {
    //       this.chartData = response.data.data
    //       this.queryButton = false
    //       this.isNoData = false
    //       if (response.data.data.length == 0) {
    //         this.isNoData = true
    //         return
    //       }
    //       exceptionApi
    //         .exceptiondata1({
    //           siteName: '',
    //           beginTime: this.form.beginTime,
    //           endTime: this.form.endTime
    //         })
    //         .then((res) => {
    //           this.isNoData = false
    //           this.table = index.merge(
    //             this.chartData,
    //             res.data.data,
    //             this.form.beginTime,
    //             this.form.endTime
    //           )
    //           this.loading = false
    //           this.$nextTick(()=>{
    //           this.$refs.table.sort('riskValue','descending')
    //         })
    //         })
    //     })
    // },
     // 点击风险排名按钮
     fetchData() {
      this.loading = true
      this.queryButton = true
      exceptionApi
        .analysisdataByType(this.form.month, 'month')
      riskApi
        .queryRiskValue('',this.form.month, 'month')
        .then((response) => {
          this.chartData = response.data.data
          this.queryButton = false
          this.isNoData = false
          if (response.data.data.length == 0) {
            this.isNoData = true
            return
          }
          exceptionApi
            .exceptiondata1({
              siteName: '',
              beginTime: this.form.beginTime,
              endTime: this.form.endTime
            })
            .then((res) => {
              this.isNoData = false
              this.table = index.merge(
                this.chartData,
                res.data.data,
                this.form.beginTime,
                this.form.endTime
              )
              this.loading = false
          this.table = riskValue.calMonthlyRiskValue(response.data.data)
          this.queryButton = false
          this.isNoData = false
              this.$nextTick(()=>{
              this.$refs.table.sort('riskValue','descending')
              
            })
            })
        })
    },
    })
  },
    /**
     * 初始加载函数
@@ -195,7 +219,10 @@
      }
    },
    openDetail(row){
      this.$router.push(`/detail/${row.siteName}/${this.form.month}`)
      const encodedSiteName = encodeURIComponent(row.siteName);
      this.$router.push(`/detail/${encodedSiteName}/${this.form.month}`)
      // this.$router.push(`/detail/${row.siteName}/${this.form.month}`)
    }
  }
}