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