From b1bdac435d4aa9fe34bde1a859490842166b47f7 Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期五, 26 八月 2022 17:30:48 +0800
Subject: [PATCH] statistics

---
 src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue
index 95d33c8..7069f21 100644
--- a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue
+++ b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue
@@ -5,6 +5,8 @@
 
 <script>
 
+import {getInspectComplete} from "../../../../../../api/inspectStatistics";
+
 export default {
     name: 'index',
     data(){
@@ -14,18 +16,32 @@
         }
     },
     mounted() {
-        this.drawTodayLine()
     },
     methods:{
+        async updateData(val){
+            let res = await getInspectComplete(val)
+            if(res.data.code === '200'){
+                this.numData = res.data.data.map(item =>{
+                    return item.num
+                })
+                this.timeData = res.data.data.map(item =>{
+                    return item.taskDate
+                })
+            }else{
+                this.$message({
+                    type:'warning',
+                    message:res.data.message
+                })
+            }
+            this.drawTodayLine()
+        },
         async drawTodayLine(){
-            this.timeData = [1,2,3,4,]
-            this.numData = [2,5,7,9]
             let myChart = this.$echarts.init(document.getElementById('inspectionComplete'))
             myChart.setOption({
                 xAxis: {
                 type: 'category',
                 boundaryGap: false,
-                data: ['2022-4-1', '2022-4-2', '2022-4-4', '2022-4-4', '2022-4-5', '2022-4-6', '2022-4-7']
+                data:this.timeData
                 },
                 yAxis: {
                     type: 'value'
@@ -33,7 +49,7 @@
                 color:'#5470c6',
                 series: [
                     {
-                    data: [820, 932, 901, 934, 1290, 1330, 1320],
+                    data: this.numData,
                     type: 'line',
                     smooth: true
                     }

--
Gitblit v1.9.2