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 | 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