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/inspectionComplete/index.vue | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue index db27c8a..7069f21 100644 --- a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue +++ b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue @@ -1,11 +1,63 @@ <template> - + <div id="inspectionComplete" style="width:90%;height:360px;margin: 0 auto;"> + </div> </template> <script> - export default { - name: "index" + +import {getInspectComplete} from "../../../../../../api/inspectStatistics"; + +export default { + name: 'index', + data(){ + return{ + numData:[], + timeData:[], + } + }, + mounted() { + }, + 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(){ + let myChart = this.$echarts.init(document.getElementById('inspectionComplete')) + myChart.setOption({ + xAxis: { + type: 'category', + boundaryGap: false, + data:this.timeData + }, + yAxis: { + type: 'value' + }, + color:'#5470c6', + series: [ + { + data: this.numData, + type: 'line', + smooth: true + } + ] + }) + } } +} </script> <style scoped> -- Gitblit v1.9.2