From 0ee16e9f5dd31c6c98df1a5fdcf081c8eb7f80df Mon Sep 17 00:00:00 2001
From: zmc <zmc_li@foxmail.com>
Date: 星期二, 14 十一月 2023 13:15:55 +0800
Subject: [PATCH] 修改了获取风险值的请求接口

---
 src/views/line_graph/SiteComprehensiveRskRanking.vue |   82 ++++++++++++++++++++++++++--------------
 1 files changed, 53 insertions(+), 29 deletions(-)

diff --git a/src/views/line_graph/SiteComprehensiveRskRanking.vue b/src/views/line_graph/SiteComprehensiveRskRanking.vue
index 7a7d908..2d361f6 100644
--- a/src/views/line_graph/SiteComprehensiveRskRanking.vue
+++ b/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')
               
-            })
-
-            })
-            
         })
-    },
+    })
+  },
 
     /**
      * 鍒濆鍔犺浇鍑芥暟

--
Gitblit v1.9.3