|
@@ -68,12 +68,22 @@ import {
|
|
|
let notRectifyNum = [];
|
|
|
let rectifyNum = [];
|
|
|
let tempNum = [];
|
|
|
+ let num = 0;
|
|
|
if (response.data[0]){
|
|
|
for(let i=0;i<response.data.length;i++){
|
|
|
deptSortName.push(response.data[i].deptSortName)
|
|
|
notRectifyNum.push(response.data[i].notRectifyNum)
|
|
|
rectifyNum.push(response.data[i].rectifyNum)
|
|
|
tempNum.push(response.data[i].tempNum)
|
|
|
+ if(response.data[i].notRectifyNum > num){
|
|
|
+ num = response.data[i].notRectifyNum;
|
|
|
+ }
|
|
|
+ if(response.data[i].rectifyNum > num){
|
|
|
+ num = response.data[i].rectifyNum;
|
|
|
+ }
|
|
|
+ if(response.data[i].tempNum > num){
|
|
|
+ num = response.data[i].tempNum;
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
deptSortName = [''];
|
|
@@ -81,7 +91,7 @@ import {
|
|
|
rectifyNum = [0];
|
|
|
tempNum = [0];
|
|
|
}
|
|
|
- this.eChartsMethod(deptSortName,notRectifyNum,rectifyNum,tempNum);
|
|
|
+ this.eChartsMethod(deptSortName,notRectifyNum,rectifyNum,tempNum,num);
|
|
|
});
|
|
|
},
|
|
|
checkButton(type){
|
|
@@ -91,7 +101,7 @@ import {
|
|
|
}
|
|
|
},
|
|
|
//
|
|
|
- eChartsMethod(deptSortName,notRectifyNum,rectifyNum,tempNum){
|
|
|
+ eChartsMethod(deptSortName,notRectifyNum,rectifyNum,tempNum,num){
|
|
|
let option = {
|
|
|
tooltip: {
|
|
|
trigger: "axis",
|
|
@@ -269,6 +279,13 @@ import {
|
|
|
},
|
|
|
],
|
|
|
};
|
|
|
+ if(num < 5){
|
|
|
+ option.yAxis[0].max = 5;
|
|
|
+ }else{
|
|
|
+ option.yAxis[0].min= 0;
|
|
|
+ option.yAxis[0].max= num; // 计算最大值
|
|
|
+ option.yAxis[0].interval= Math.ceil(num / 5); // 平均分为5份
|
|
|
+ }
|
|
|
let echartsBox = this.$echarts.init(document.getElementById('troubleRankingComponentsECharts'));
|
|
|
echartsBox.clear();
|
|
|
echartsBox.setOption(option);
|