From 771e0da9c6082c78a28f5286f89f4f36b05689d3 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期二, 27 十二月 2022 14:31:45 +0800
Subject: [PATCH] 默认更改列表

---
 src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue |   70 ++++++++++++++++++++++++++++++++---
 1 files changed, 64 insertions(+), 6 deletions(-)

diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue
index db27c8a..439da18 100644
--- a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue
+++ b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue
@@ -1,13 +1,71 @@
 <template>
-
+    <div id="inspectionPerson" style="width:90%;height:360px;margin: 0 auto;">
+    </div>
 </template>
 
 <script>
-    export default {
-        name: "index"
+
+import {getInspectPerson} from "../../../../../../api/inspectStatistics";
+
+export default {
+    name: "index",
+    data(){
+        return{
+            barData:[],
+            myChart:'',
+        }
+    },
+    mounted(){
+    },
+    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({
+                tooltip: {
+                    trigger: 'item'
+                },
+                legend: {
+                    left: 'center',
+                    top: '84%',
+                },
+                color:'#fac858',
+                xAxis: {
+                    type: 'category',
+                    data: this.timeData
+                },
+                yAxis: {
+                    type: 'value'
+                },
+                series: [
+                {
+                    data: this.numData,
+                    type: 'bar',
+                    showBackground: true,
+                    backgroundStyle: {
+                        color: '#5470c6'
+                    }
+                }]
+            })
+        },
     }
+}
 </script>
-
-<style scoped>
-
+<style scoped lang="scss">
 </style>

--
Gitblit v1.9.2