|
@@ -55,6 +55,8 @@
|
|
|
newHazard:0,
|
|
|
refreshNum:0,
|
|
|
maxData:[],
|
|
|
+ maxNum:[],
|
|
|
+ mxaText:[],
|
|
|
dataIndex:0,
|
|
|
}
|
|
|
},
|
|
@@ -97,30 +99,53 @@
|
|
|
this.$set(this,'newHazard',response.data.newHazard?response.data.newHazard:0);
|
|
|
let maxList = [];
|
|
|
let list = [];
|
|
|
+ let maxNum = [];
|
|
|
+ let numList = [];
|
|
|
+ let mxaText = [];
|
|
|
+ let textList = [];
|
|
|
let num = 0;
|
|
|
for(let i=0;i<response.data.hazardTotalSortSubs.length;i++){
|
|
|
if(num < 5){
|
|
|
list.push(response.data.hazardTotalSortSubs[i])
|
|
|
+ numList.unshift(response.data.hazardTotalSortSubs[i].ratio)
|
|
|
+ textList.push(response.data.hazardTotalSortSubs[i].ratio+'%')
|
|
|
num++
|
|
|
+ if((i+1)==response.data.hazardTotalSortSubs.length){
|
|
|
+ maxList.push(list);
|
|
|
+ maxList = JSON.parse(JSON.stringify(maxList));
|
|
|
+ maxNum.push(numList);
|
|
|
+ maxNum = JSON.parse(JSON.stringify(maxNum));
|
|
|
+ mxaText.push(textList);
|
|
|
+ mxaText = JSON.parse(JSON.stringify(mxaText));
|
|
|
+ list = [response.data.hazardTotalSortSubs[i]];
|
|
|
+ numList = [response.data.hazardTotalSortSubs[i].ratio];
|
|
|
+ textList = [response.data.hazardTotalSortSubs[i].ratio+'%'];
|
|
|
+ }
|
|
|
}else{
|
|
|
maxList.push(list);
|
|
|
maxList = JSON.parse(JSON.stringify(maxList));
|
|
|
+ maxNum.push(numList);
|
|
|
+ maxNum = JSON.parse(JSON.stringify(maxNum));
|
|
|
+ mxaText.push(textList);
|
|
|
+ mxaText = JSON.parse(JSON.stringify(mxaText));
|
|
|
list = [response.data.hazardTotalSortSubs[i]];
|
|
|
+ numList = [response.data.hazardTotalSortSubs[i].ratio];
|
|
|
+ textList = [response.data.hazardTotalSortSubs[i].ratio+'%'];
|
|
|
num = 1;
|
|
|
}
|
|
|
}
|
|
|
- maxList.push(list);
|
|
|
- maxList = JSON.parse(JSON.stringify(maxList));
|
|
|
this.$set(this,'maxData',maxList);
|
|
|
+ this.$set(this,'maxNum',maxNum);
|
|
|
+ this.$set(this,'mxaText',mxaText);
|
|
|
this.$set(this,'dataIndex',0);
|
|
|
this.setData();
|
|
|
});
|
|
|
},
|
|
|
- eChartsMethod() {
|
|
|
+ eChartsMethod(list,text) {
|
|
|
let msg = {
|
|
|
- data: [25, 35.5, 46.5, 56.5, 63.5],
|
|
|
+ data: this.maxNum[this.dataIndex],
|
|
|
total: 100,
|
|
|
- percentdata: ['32%', '40%', '50%', '65%', '70%'],
|
|
|
+ percentdata: this.mxaText[this.dataIndex],
|
|
|
leftname: [
|
|
|
'',
|
|
|
'',
|
|
@@ -134,8 +159,8 @@
|
|
|
let totaldata = []
|
|
|
let percentdata = []
|
|
|
msg.data.forEach((value)=>{
|
|
|
- totaldata.push(81.3)
|
|
|
- data.push((81.3 * value) / 100)
|
|
|
+ totaldata.push(100)
|
|
|
+ data.push((55 * value) / 100)
|
|
|
data2.push(100)
|
|
|
percentdata.push(Math.round((value / msg.total) * 100) + '%')
|
|
|
})
|