From c819024e241b9f7c54cc3786373ad0d2998f2190 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期五, 05 五月 2023 08:55:46 +0800
Subject: [PATCH] 修改

---
 src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue
index ab48306..439da18 100644
--- a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue
+++ b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue
@@ -5,6 +5,8 @@
 
 <script>
 
+import {getInspectPerson} from "../../../../../../api/inspectStatistics";
+
 export default {
     name: "index",
     data(){
@@ -14,9 +16,25 @@
         }
     },
     mounted(){
-        this.drawLine()
     },
     methods:{
+        async updateData(val){
+            let res = await getInspectPerson(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.drawLine()
+        },
         async drawLine(){
             this.myChart = this.$echarts.init(document.getElementById('inspectionPerson'))
             this.myChart.setOption({
@@ -30,14 +48,14 @@
                 color:'#fac858',
                 xAxis: {
                     type: 'category',
-                    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
+                    data: this.timeData
                 },
                 yAxis: {
                     type: 'value'
                 },
                 series: [
                 {
-                    data: [120, 200, 150, 80, 70, 110, 130],
+                    data: this.numData,
                     type: 'bar',
                     showBackground: true,
                     backgroundStyle: {

--
Gitblit v1.9.2