|
|
@@ -121,8 +121,8 @@
|
|
|
}
|
|
|
for (let i = 0; i < res.data.monthlyUsage.length; i++) {
|
|
|
if(i==0){
|
|
|
- dataList.push(res.data.monthlyUsage[i].equTypeName)
|
|
|
- color.push({
|
|
|
+ dataList.unshift(res.data.monthlyUsage[i].equTypeName)
|
|
|
+ color.unshift({
|
|
|
type: 'linear',
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
@@ -144,8 +144,8 @@
|
|
|
color3: res.data.monthlyUsage[i].color?this.changeAlpha(res.data.monthlyUsage[i].color,'0.2'):'rgba(255, 255, 255, 0.2)',
|
|
|
});
|
|
|
}else if(i==1){
|
|
|
- dataList.push(res.data.monthlyUsage[i].equTypeName)
|
|
|
- color.push({
|
|
|
+ dataList.unshift(res.data.monthlyUsage[i].equTypeName)
|
|
|
+ color.unshift({
|
|
|
type: 'linear',
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
@@ -167,8 +167,8 @@
|
|
|
color3: res.data.monthlyUsage[i].color?this.changeAlpha(res.data.monthlyUsage[i].color,'0.2'):'rgba(255, 255, 255, 0.2)',
|
|
|
});
|
|
|
}else if(i==2){
|
|
|
- dataList.push(res.data.monthlyUsage[i].equTypeName)
|
|
|
- color.push({
|
|
|
+ dataList.unshift(res.data.monthlyUsage[i].equTypeName)
|
|
|
+ color.unshift({
|
|
|
type: 'linear',
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
@@ -190,8 +190,8 @@
|
|
|
color3: res.data.monthlyUsage[i].color?this.changeAlpha(res.data.monthlyUsage[i].color,'0.2'):'rgba(255, 255, 255, 0.2)',
|
|
|
});
|
|
|
}else if(i==3){
|
|
|
- dataList.push(res.data.monthlyUsage[i].equTypeName)
|
|
|
- color.push({
|
|
|
+ dataList.unshift(res.data.monthlyUsage[i].equTypeName)
|
|
|
+ color.unshift({
|
|
|
type: 'linear',
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
@@ -213,8 +213,8 @@
|
|
|
color3: res.data.monthlyUsage[i].color?this.changeAlpha(res.data.monthlyUsage[i].color,'0.2'):'rgba(255, 255, 255, 0.2)',
|
|
|
});
|
|
|
}else if(i==4){
|
|
|
- dataList.push(res.data.monthlyUsage[i].equTypeName)
|
|
|
- color.push({
|
|
|
+ dataList.unshift(res.data.monthlyUsage[i].equTypeName)
|
|
|
+ color.unshift({
|
|
|
type: 'linear',
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
@@ -236,8 +236,8 @@
|
|
|
color3: res.data.monthlyUsage[i].color?this.changeAlpha(res.data.monthlyUsage[i].color,'0.2'):'rgba(255, 255, 255, 0.2)',
|
|
|
});
|
|
|
}else if(i==5){
|
|
|
- dataList.push(res.data.monthlyUsage[i].equTypeName)
|
|
|
- color.push({
|
|
|
+ dataList.unshift(res.data.monthlyUsage[i].equTypeName)
|
|
|
+ color.unshift({
|
|
|
type: 'linear',
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
@@ -275,27 +275,27 @@
|
|
|
let newData = {
|
|
|
deptName: [],
|
|
|
data1:{
|
|
|
- name:'',
|
|
|
+ name:dataList[0],
|
|
|
list:[]
|
|
|
},
|
|
|
data2:{
|
|
|
- name:'',
|
|
|
+ name:dataList[1],
|
|
|
list:[]
|
|
|
},
|
|
|
data3:{
|
|
|
- name:'',
|
|
|
+ name:dataList[2],
|
|
|
list:[]
|
|
|
},
|
|
|
data4:{
|
|
|
- name:'',
|
|
|
+ name:dataList[3],
|
|
|
list:[]
|
|
|
},
|
|
|
data5:{
|
|
|
- name:'',
|
|
|
+ name:dataList[4],
|
|
|
list:[]
|
|
|
},
|
|
|
data6:{
|
|
|
- name:'',
|
|
|
+ name:dataList[5],
|
|
|
list:[]
|
|
|
},
|
|
|
}
|
|
|
@@ -303,7 +303,33 @@
|
|
|
for(let i=0;i<res.data.unitStats.length;i++){
|
|
|
if(newData.deptName[4]){
|
|
|
list.push(JSON.parse(JSON.stringify(newData)))
|
|
|
- newData = JSON.parse(JSON.stringify({deptName: [],list1: [],list2: [],list3: [],list4: [],list5: [],list6: []}))
|
|
|
+ newData = JSON.parse(JSON.stringify({
|
|
|
+ deptName: [],
|
|
|
+ data1:{
|
|
|
+ name:dataList[0],
|
|
|
+ list:[]
|
|
|
+ },
|
|
|
+ data2:{
|
|
|
+ name:dataList[1],
|
|
|
+ list:[]
|
|
|
+ },
|
|
|
+ data3:{
|
|
|
+ name:dataList[2],
|
|
|
+ list:[]
|
|
|
+ },
|
|
|
+ data4:{
|
|
|
+ name:dataList[3],
|
|
|
+ list:[]
|
|
|
+ },
|
|
|
+ data5:{
|
|
|
+ name:dataList[4],
|
|
|
+ list:[]
|
|
|
+ },
|
|
|
+ data6:{
|
|
|
+ name:dataList[5],
|
|
|
+ list:[]
|
|
|
+ },
|
|
|
+ }))
|
|
|
newData.deptName.push(res.data.unitStats[i].unit);
|
|
|
for(let o=0;o<dataList.length;o++){
|
|
|
let num = 0;
|
|
|
@@ -311,22 +337,16 @@
|
|
|
if(dataList[o] == res.data.unitStats[i].types[x].type){
|
|
|
num++
|
|
|
if(o==0){
|
|
|
- newData.data1.name = dataList[o];
|
|
|
newData.data1.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}else if(o==1){
|
|
|
- newData.data2.name = dataList[o];
|
|
|
newData.data2.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}else if(o==2){
|
|
|
- newData.data3.name = dataList[o];
|
|
|
newData.data3.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}else if(o==3){
|
|
|
- newData.data4.name = dataList[o];
|
|
|
newData.data4.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}else if(o==4){
|
|
|
- newData.data5.name = dataList[o];
|
|
|
newData.data5.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}else if(o==5){
|
|
|
- newData.data6.name = dataList[o];
|
|
|
newData.data6.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}
|
|
|
}
|
|
|
@@ -355,22 +375,16 @@
|
|
|
if(dataList[o] == res.data.unitStats[i].types[x].type){
|
|
|
num++
|
|
|
if(o==0){
|
|
|
- newData.data1.name = dataList[o];
|
|
|
newData.data1.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}else if(o==1){
|
|
|
- newData.data2.name = dataList[o];
|
|
|
newData.data2.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}else if(o==2){
|
|
|
- newData.data3.name = dataList[o];
|
|
|
newData.data3.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}else if(o==3){
|
|
|
- newData.data4.name = dataList[o];
|
|
|
newData.data4.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}else if(o==4){
|
|
|
- newData.data5.name = dataList[o];
|
|
|
newData.data5.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}else if(o==5){
|
|
|
- newData.data6.name = dataList[o];
|
|
|
newData.data6.list.push(res.data.unitStats[i].types[x].count);
|
|
|
}
|
|
|
}
|