| | |
| | | |
| | | <script> |
| | | |
| | | import {getInspectComplete} from "../../../../../../api/inspectStatistics"; |
| | | |
| | | export default { |
| | | name: 'index', |
| | | data(){ |
| | |
| | | } |
| | | }, |
| | | 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' |
| | |
| | | color:'#5470c6', |
| | | series: [ |
| | | { |
| | | data: [820, 932, 901, 934, 1290, 1330, 1320], |
| | | data: this.numData, |
| | | type: 'line', |
| | | smooth: true |
| | | } |