| | |
| | | import * as echarts from 'echarts' |
| | | export default { |
| | | name: 'comparativeAnalysisBar', |
| | | propa:{}, |
| | | props:{ |
| | | dataList:'' |
| | | |
| | | }, |
| | | data(){ |
| | | return{ |
| | | openRate:0, |
| | | utilizationRate:0, |
| | | openLong:0, |
| | | closeLong:0 |
| | | OpenCloseList:[], |
| | | openRate:[], |
| | | utilizationRate:[], |
| | | openLong:[], |
| | | closeLong:[], |
| | | equipmentList:[] |
| | | } |
| | | }, |
| | | created(){ |
| | | |
| | | }, |
| | | watch:{ |
| | | dataList(val){ |
| | | this.OpenCloseList = val |
| | | this.drawTu() |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.drawTu() |
| | |
| | | } |
| | | ] |
| | | }; |
| | | compAnalBar1.setOption(compAnalBarOption1); |
| | | compAnalBar2.setOption(compAnalBarOption2); |
| | | |
| | | if(this.OpenCloseList != null){ |
| | | this.equipmentList = [] |
| | | this.openRate =[] |
| | | this.utilizationRate =[] |
| | | this.openLong = [] |
| | | this.closeLong = [] |
| | | for(var i = 0;i<this.OpenCloseList.length;i++){ |
| | | this.equipmentList.push(this.OpenCloseList[i].equipmentId) |
| | | this.openRate.push(this.OpenCloseList[i].openRate) |
| | | this.utilizationRate.push(this.OpenCloseList[i].utilizationRate) |
| | | this.openLong.push(this.OpenCloseList[i].openLong) |
| | | this.closeLong.push(this.OpenCloseList[i].closeLong) |
| | | } |
| | | compAnalBarOption1.xAxis[0].data = this.equipmentList |
| | | compAnalBarOption1.series[0].data = this.openRate |
| | | compAnalBarOption1.series[1].data = this.utilizationRate |
| | | compAnalBarOption2.xAxis[0].data = this.equipmentList |
| | | compAnalBarOption2.series[0].data = this.openLong |
| | | compAnalBarOption2.series[1].data = this.closeLong |
| | | compAnalBar1.setOption(compAnalBarOption1); |
| | | compAnalBar2.setOption(compAnalBarOption2); |
| | | }else{ |
| | | compAnalBar1.setOption(compAnalBarOption1); |
| | | compAnalBar2.setOption(compAnalBarOption2); |
| | | } |
| | | window.addEventListener('resize', function() { |
| | | compAnalBar1.resize() |
| | | compAnalBar2.resize() |