fix:全厂能源电量消耗报表
This commit is contained in:
parent
4b52570a4d
commit
054829996e
|
|
@ -136,43 +136,13 @@ export default {
|
||||||
return {
|
return {
|
||||||
year: "",
|
year: "",
|
||||||
month: "",
|
month: "",
|
||||||
days: "",
|
|
||||||
myChart: null,
|
myChart: null,
|
||||||
search_date: "",
|
search_date: "",
|
||||||
headerLength: 33,
|
headerLength: 33,
|
||||||
itemVisible: false,
|
itemVisible: false,
|
||||||
xAxisData: [],
|
xAxisData: [],
|
||||||
tableDatas: [
|
mpointList: [],
|
||||||
["石灰石破碎", "破碎机", "kw.h"], //0
|
tableDatas: [],
|
||||||
["石灰石破碎", "堆取料机", "kw.h"],
|
|
||||||
["石灰石破碎", "低压变压器柜", "kw.h"],
|
|
||||||
["石灰石破碎", "石灰石破碎合计", "kw.h"],
|
|
||||||
["原料磨", "循环风机", "kw.h"],
|
|
||||||
["原料磨", "辊压机", "kw.h"],
|
|
||||||
["原料磨", "调配变压器", "kw.h"],
|
|
||||||
["原料磨", "低压变压器柜器", "kw.h"],
|
|
||||||
["原料磨", "原料磨系统合计", "kw.h"],
|
|
||||||
["回转窑", "尾排风机", "kw.h"],
|
|
||||||
["回转窑", "高温风机", "kw.h"],
|
|
||||||
["回转窑", "头排风机", "kw.h"],
|
|
||||||
["回转窑", "低压变压器柜", "kw.h"],
|
|
||||||
["回转窑", "回转窑烧成系统合计", "kw.h"],
|
|
||||||
["煤磨", "煤磨主电机", "kw.h"],
|
|
||||||
["煤磨", "煤磨排风机", "kw.h"],
|
|
||||||
["煤磨", "低压变压器柜", "kw.h"],
|
|
||||||
["煤磨", "煤磨系统合计", "kw.h"],
|
|
||||||
["余热发电", "余热发电量", "kw.h"],
|
|
||||||
["余热发电", "余热发电自用电量", "kw.h"],
|
|
||||||
["余热发电", "余热供电量", "kw.h"],
|
|
||||||
["空压机", "1#空压机", "kw.h"],
|
|
||||||
["空压机", "2#空压机", "kw.h"],
|
|
||||||
["空压机", "3#空压机", "kw.h"],
|
|
||||||
["空压机", "4#空压机", "kw.h"],
|
|
||||||
["空压机", "空压机合计", "kw.h"],
|
|
||||||
["富氧燃烧系统", "富氧燃烧耗电设备", "kw.h"],
|
|
||||||
["生产总耗电量", "生产部分总耗电", "kw.h"],
|
|
||||||
["全厂进线", "全厂耗电量", "kw.h"],
|
|
||||||
],
|
|
||||||
timeStamp: null,
|
timeStamp: null,
|
||||||
tableWidth: "3300",
|
tableWidth: "3300",
|
||||||
itemChartTitle: "",
|
itemChartTitle: "",
|
||||||
|
|
@ -275,26 +245,20 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
let that = this;
|
let that = this;
|
||||||
var nowDate = new Date();
|
var nowDate = new Date();
|
||||||
that.year = nowDate.getFullYear();
|
let year = nowDate.getFullYear();
|
||||||
that.month = nowDate.getMonth() + 1;
|
let month = nowDate.getMonth() + 1;
|
||||||
that.days = new Date(that.year, that.month, 0).getDate();
|
month = month > 9 ? month : "0" + month;
|
||||||
|
that.search_date = year + "-" + month;
|
||||||
|
that.year = year;
|
||||||
|
that.month = month;
|
||||||
|
that.days = new Date(year, month, 0).getDate();
|
||||||
that.timeStamp = nowDate.getTime();
|
that.timeStamp = nowDate.getTime();
|
||||||
let month0 = that.month > 9 ? that.month : "0" + that.month;
|
|
||||||
that.search_date = that.year + "-" + month0;
|
|
||||||
that.headerLength = that.days + 4;
|
that.headerLength = that.days + 4;
|
||||||
that.tableWidth = that.headerLength * 100 + "";
|
that.tableWidth = that.headerLength * 100 + "";
|
||||||
let tableDatas = that.tableDatas;
|
|
||||||
for (let i = 0; i < tableDatas.length; i++) {
|
|
||||||
for (let j = 0; j < that.days; j++) {
|
|
||||||
let k = 3 + j;
|
|
||||||
that.tableDatas[i][k] = 0;
|
|
||||||
this.$forceUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let n = 1; n <= that.days; n++) {
|
for (let n = 1; n <= that.days; n++) {
|
||||||
that.xAxisData.push(n + "日");
|
that.xAxisData.push(n + "日");
|
||||||
}
|
}
|
||||||
this.getData();
|
this.getMPoints();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
dateChange(e) {
|
dateChange(e) {
|
||||||
|
|
@ -302,215 +266,263 @@ export default {
|
||||||
let arr = e.split("-");
|
let arr = e.split("-");
|
||||||
that.year = Number(arr[0]);
|
that.year = Number(arr[0]);
|
||||||
that.month = Number(arr[1]);
|
that.month = Number(arr[1]);
|
||||||
for (let i = 0; i < that.tableDatas.length; i++) {
|
|
||||||
for (let j = 0; j < that.days + 1; j++) {
|
|
||||||
let k = 3 + j;
|
|
||||||
that.tableDatas[i][k] = 0;
|
|
||||||
this.$forceUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let nowDate = new Date();
|
let nowDate = new Date();
|
||||||
that.timeStamp = nowDate.getTime();
|
that.timeStamp = nowDate.getTime();
|
||||||
this.getData();
|
this.dataLoop();
|
||||||
},
|
},
|
||||||
getData() {
|
getMPoints() {
|
||||||
let that = this;
|
let that = this;
|
||||||
function dataPush(name) {
|
that.$API.enm.mpoint.list
|
||||||
let index = 0;
|
.req({
|
||||||
if (name == "破碎机") {
|
page: 0,
|
||||||
index = 0;
|
enabled: true,
|
||||||
} else if (name == "堆取料机") {
|
need_display: true,
|
||||||
index = 1;
|
ordering: "report_sortstr",
|
||||||
} else if (name == "低压变压器柜") {
|
mpoint__material__code: "elec",
|
||||||
index = 2;
|
|
||||||
} else if (name == "循环风机") {
|
|
||||||
index = 4;
|
|
||||||
} else if (name == "调配变压器") {
|
|
||||||
index = 6;
|
|
||||||
} else if (name == "低压变压器柜器") {
|
|
||||||
index = 7;
|
|
||||||
} else if (name == "尾排风机") {
|
|
||||||
index = 9;
|
|
||||||
} else if (name == "高温风机") {
|
|
||||||
index = 10;
|
|
||||||
} else if (name == "头排风机") {
|
|
||||||
index = 11;
|
|
||||||
} else if (name == "煤磨主电机") {
|
|
||||||
index = 14;
|
|
||||||
} else if (name == "煤磨排风机") {
|
|
||||||
index = 15;
|
|
||||||
} else if (name == "低压变压器柜") {
|
|
||||||
index = 16;
|
|
||||||
} else if (name == "余热发电量") {
|
|
||||||
index = 18;
|
|
||||||
} else if (name == "余热发电自用电量") {
|
|
||||||
index = 19;
|
|
||||||
} else if (name == "1#空压机") {
|
|
||||||
index = 21;
|
|
||||||
} else if (name == "2#空压机") {
|
|
||||||
index = 22;
|
|
||||||
} else if (name == "3#空压机") {
|
|
||||||
index = 23;
|
|
||||||
} else if (name == "4#空压机") {
|
|
||||||
index = 24;
|
|
||||||
} else if (name == "富氧燃烧耗电设备") {
|
|
||||||
index = 26;
|
|
||||||
}
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
function sumNum(a, b, c, d) {
|
|
||||||
let sum = 0;
|
|
||||||
if (typeof a !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(a);
|
|
||||||
}
|
|
||||||
if (typeof b !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(b);
|
|
||||||
}
|
|
||||||
if (typeof c !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(c);
|
|
||||||
}
|
|
||||||
if (typeof d !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(d);
|
|
||||||
}
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
let obj = {};
|
|
||||||
obj.type = "day_s";
|
|
||||||
obj.year_s = that.year;
|
|
||||||
obj.month_s = that.month;
|
|
||||||
obj.page = 0;
|
|
||||||
obj.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(obj)
|
|
||||||
.then((res) => {
|
|
||||||
let wrapArr = [],
|
|
||||||
innerArr = [];
|
|
||||||
res.forEach((item) => {
|
|
||||||
let day = item.day_s;
|
|
||||||
if (wrapArr[day]) {
|
|
||||||
wrapArr[day].push(item);
|
|
||||||
} else {
|
|
||||||
wrapArr[day] = [];
|
|
||||||
wrapArr[day].push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
wrapArr.forEach((inner, inde) => {
|
|
||||||
inner.forEach((item) => {
|
|
||||||
let i = dataPush(item.mpoint_name);
|
|
||||||
let k = 0;
|
|
||||||
if (
|
|
||||||
i == 0 ||
|
|
||||||
i == 4 ||
|
|
||||||
i == 9 ||
|
|
||||||
i == 14 ||
|
|
||||||
i == 18 ||
|
|
||||||
i == 21 ||
|
|
||||||
i == 26 ||
|
|
||||||
i == 27 ||
|
|
||||||
i == 28
|
|
||||||
) {
|
|
||||||
k = 3 + inde;
|
|
||||||
} else {
|
|
||||||
k = 2 + inde;
|
|
||||||
}
|
|
||||||
that.tableDatas[i][k] = item.val;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
for (let k = 0; k < that.headerLength; k++) {
|
|
||||||
let m = k + 3;
|
|
||||||
let n = k + 1;
|
|
||||||
//石灰石破碎合计
|
|
||||||
|
|
||||||
that.tableDatas[3][m] = sumNum(
|
|
||||||
that.tableDatas[0][m],
|
|
||||||
that.tableDatas[1][m],
|
|
||||||
that.tableDatas[2][m]
|
|
||||||
);
|
|
||||||
//辊压机
|
|
||||||
// that.tableDatas[5][m] = sumNum();
|
|
||||||
//原料磨系统合计
|
|
||||||
that.tableDatas[8][m] =
|
|
||||||
sumNum(
|
|
||||||
that.tableDatas[4][m],
|
|
||||||
// that.tableDatas[5][m],
|
|
||||||
that.tableDatas[6][m],
|
|
||||||
that.tableDatas[7][m]
|
|
||||||
) -
|
|
||||||
sumNum(
|
|
||||||
that.tableDatas[1][m],
|
|
||||||
that.tableDatas[2][m]
|
|
||||||
);
|
|
||||||
//低压变压器柜
|
|
||||||
// that.tableDatas[12][m] = sumNum(
|
|
||||||
// that.tableDatas[9][m],
|
|
||||||
// that.tableDatas[10][m],
|
|
||||||
// that.tableDatas[11][m]
|
|
||||||
// );
|
|
||||||
//回转窑烧成系统合计
|
|
||||||
that.tableDatas[13][m] =
|
|
||||||
typeof that.tableDatas[12][m] !== "undefined"
|
|
||||||
? sumNum(
|
|
||||||
that.tableDatas[9][m],
|
|
||||||
that.tableDatas[10][m],
|
|
||||||
that.tableDatas[11][m],
|
|
||||||
that.tableDatas[12][m]
|
|
||||||
)
|
|
||||||
: sumNum(
|
|
||||||
that.tableDatas[9][m],
|
|
||||||
that.tableDatas[10][m],
|
|
||||||
that.tableDatas[11][m]
|
|
||||||
);
|
|
||||||
//煤磨系统合计
|
|
||||||
let sum17 = sumNum(
|
|
||||||
that.tableDatas[14][m],
|
|
||||||
that.tableDatas[15][m],
|
|
||||||
that.tableDatas[16][m]
|
|
||||||
);
|
|
||||||
that.tableDatas[17][m] =
|
|
||||||
typeof that.tableDatas[21][m] !== "undefined"
|
|
||||||
? sum17 - that.tableDatas[21][m]
|
|
||||||
: sum17;
|
|
||||||
//余热供电量
|
|
||||||
that.tableDatas[20][m] =
|
|
||||||
typeof that.tableDatas[19][m] !== "undefined"
|
|
||||||
? that.tableDatas[18][m] -
|
|
||||||
that.tableDatas[19][m]
|
|
||||||
: that.tableDatas[18][m];
|
|
||||||
//空压机合计
|
|
||||||
that.tableDatas[25][m] = sumNum(
|
|
||||||
that.tableDatas[21][m],
|
|
||||||
that.tableDatas[22][m],
|
|
||||||
that.tableDatas[23][m],
|
|
||||||
that.tableDatas[24][m]
|
|
||||||
);
|
|
||||||
//生产部分总耗电
|
|
||||||
that.tableDatas[27][m] = sumNum(
|
|
||||||
that.tableDatas[3][m],
|
|
||||||
that.tableDatas[8][m],
|
|
||||||
that.tableDatas[13][m],
|
|
||||||
that.tableDatas[17][m],
|
|
||||||
that.tableDatas[18][m],
|
|
||||||
that.tableDatas[25][m],
|
|
||||||
that.tableDatas[26][m]
|
|
||||||
);
|
|
||||||
//全厂耗电量
|
|
||||||
// that.tableDatas[28][m] = sumNum(
|
|
||||||
// that.tableDatas[27][m],
|
|
||||||
// that.tableDatas[26][m]
|
|
||||||
// );
|
|
||||||
}
|
|
||||||
that.tableDatas.forEach((inner, inde) => {
|
|
||||||
let sumlast = 0;
|
|
||||||
inner.forEach((num, ind) => {
|
|
||||||
if (ind > 2 && ind < that.headerLength) {
|
|
||||||
sumlast = sumlast + Number(num);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
inner[that.headerLength] = sumlast;
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.then(() => {});
|
.then((res) => {
|
||||||
|
let data = res.slice(3);
|
||||||
|
that.mpointList = data;
|
||||||
|
that.dataLoop();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
dataLoop() {
|
||||||
|
let that = this;
|
||||||
|
that.tableDatas = [];
|
||||||
|
that.mpointList.forEach((item, index) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] =
|
||||||
|
item.mgroup_name != null
|
||||||
|
? item.mgroup_name
|
||||||
|
: item.nickname != null
|
||||||
|
? item.nickname
|
||||||
|
: item.name;
|
||||||
|
arr[1] = item.nickname != null ? item.nickname : item.name;
|
||||||
|
arr[2] = item.unit;
|
||||||
|
for (let i = 0; i < that.days; i++) {
|
||||||
|
arr[i + 3] = 0;
|
||||||
|
}
|
||||||
|
that.tableDatas.push(arr);
|
||||||
|
that.getData(item.id, index);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getData(id, index) {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.type = "day";
|
||||||
|
obj.year = that.year;
|
||||||
|
obj.month = that.month;
|
||||||
|
obj.mpoint__material__code = "elec";
|
||||||
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.mpoint = id;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
res.forEach((item) => {
|
||||||
|
let ind = item.day + 2;
|
||||||
|
that.tableDatas[index][ind] = item.val;
|
||||||
|
});
|
||||||
|
that.$forceUpdate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// getData() {
|
||||||
|
// let that = this;
|
||||||
|
// function dataPush(name) {
|
||||||
|
// let index = 0;
|
||||||
|
// if (name == "破碎机") {
|
||||||
|
// index = 0;
|
||||||
|
// } else if (name == "堆取料机") {
|
||||||
|
// index = 1;
|
||||||
|
// } else if (name == "低压变压器柜") {
|
||||||
|
// index = 2;
|
||||||
|
// } else if (name == "循环风机") {
|
||||||
|
// index = 4;
|
||||||
|
// } else if (name == "调配变压器") {
|
||||||
|
// index = 6;
|
||||||
|
// } else if (name == "低压变压器柜器") {
|
||||||
|
// index = 7;
|
||||||
|
// } else if (name == "尾排风机") {
|
||||||
|
// index = 9;
|
||||||
|
// } else if (name == "高温风机") {
|
||||||
|
// index = 10;
|
||||||
|
// } else if (name == "头排风机") {
|
||||||
|
// index = 11;
|
||||||
|
// } else if (name == "煤磨主电机") {
|
||||||
|
// index = 14;
|
||||||
|
// } else if (name == "煤磨排风机") {
|
||||||
|
// index = 15;
|
||||||
|
// } else if (name == "低压变压器柜") {
|
||||||
|
// index = 16;
|
||||||
|
// } else if (name == "余热发电量") {
|
||||||
|
// index = 18;
|
||||||
|
// } else if (name == "余热发电自用电量") {
|
||||||
|
// index = 19;
|
||||||
|
// } else if (name == "1#空压机") {
|
||||||
|
// index = 21;
|
||||||
|
// } else if (name == "2#空压机") {
|
||||||
|
// index = 22;
|
||||||
|
// } else if (name == "3#空压机") {
|
||||||
|
// index = 23;
|
||||||
|
// } else if (name == "4#空压机") {
|
||||||
|
// index = 24;
|
||||||
|
// } else if (name == "富氧燃烧耗电设备") {
|
||||||
|
// index = 26;
|
||||||
|
// }
|
||||||
|
// return index;
|
||||||
|
// }
|
||||||
|
// function sumNum(a, b, c, d) {
|
||||||
|
// let sum = 0;
|
||||||
|
// if (typeof a !== "undefined" && a !== "NaN") {
|
||||||
|
// sum = sum + Number(a);
|
||||||
|
// }
|
||||||
|
// if (typeof b !== "undefined" && a !== "NaN") {
|
||||||
|
// sum = sum + Number(b);
|
||||||
|
// }
|
||||||
|
// if (typeof c !== "undefined" && a !== "NaN") {
|
||||||
|
// sum = sum + Number(c);
|
||||||
|
// }
|
||||||
|
// if (typeof d !== "undefined" && a !== "NaN") {
|
||||||
|
// sum = sum + Number(d);
|
||||||
|
// }
|
||||||
|
// return sum;
|
||||||
|
// }
|
||||||
|
// let obj = {};
|
||||||
|
// obj.type = "day_s";
|
||||||
|
// obj.year_s = that.year;
|
||||||
|
// obj.month_s = that.month;
|
||||||
|
// obj.page = 0;
|
||||||
|
// obj.mpoint__ep_monitored__power_kw__gte = 100;
|
||||||
|
// this.$API.enm.mpoint.stat
|
||||||
|
// .req(obj)
|
||||||
|
// .then((res) => {
|
||||||
|
// let wrapArr = [],
|
||||||
|
// innerArr = [];
|
||||||
|
// res.forEach((item) => {
|
||||||
|
// let day = item.day_s;
|
||||||
|
// if (wrapArr[day]) {
|
||||||
|
// wrapArr[day].push(item);
|
||||||
|
// } else {
|
||||||
|
// wrapArr[day] = [];
|
||||||
|
// wrapArr[day].push(item);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// wrapArr.forEach((inner, inde) => {
|
||||||
|
// inner.forEach((item) => {
|
||||||
|
// let i = dataPush(item.mpoint_name);
|
||||||
|
// let k = 0;
|
||||||
|
// if (
|
||||||
|
// i == 0 ||
|
||||||
|
// i == 4 ||
|
||||||
|
// i == 9 ||
|
||||||
|
// i == 14 ||
|
||||||
|
// i == 18 ||
|
||||||
|
// i == 21 ||
|
||||||
|
// i == 26 ||
|
||||||
|
// i == 27 ||
|
||||||
|
// i == 28
|
||||||
|
// ) {
|
||||||
|
// k = 3 + inde;
|
||||||
|
// } else {
|
||||||
|
// k = 2 + inde;
|
||||||
|
// }
|
||||||
|
// that.tableDatas[i][k] = item.val;
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// for (let k = 0; k < that.headerLength; k++) {
|
||||||
|
// let m = k + 3;
|
||||||
|
// let n = k + 1;
|
||||||
|
// //石灰石破碎合计
|
||||||
|
|
||||||
|
// that.tableDatas[3][m] = sumNum(
|
||||||
|
// that.tableDatas[0][m],
|
||||||
|
// that.tableDatas[1][m],
|
||||||
|
// that.tableDatas[2][m]
|
||||||
|
// );
|
||||||
|
// //辊压机
|
||||||
|
// // that.tableDatas[5][m] = sumNum();
|
||||||
|
// //原料磨系统合计
|
||||||
|
// that.tableDatas[8][m] =
|
||||||
|
// sumNum(
|
||||||
|
// that.tableDatas[4][m],
|
||||||
|
// // that.tableDatas[5][m],
|
||||||
|
// that.tableDatas[6][m],
|
||||||
|
// that.tableDatas[7][m]
|
||||||
|
// ) -
|
||||||
|
// sumNum(
|
||||||
|
// that.tableDatas[1][m],
|
||||||
|
// that.tableDatas[2][m]
|
||||||
|
// );
|
||||||
|
// //低压变压器柜
|
||||||
|
// // that.tableDatas[12][m] = sumNum(
|
||||||
|
// // that.tableDatas[9][m],
|
||||||
|
// // that.tableDatas[10][m],
|
||||||
|
// // that.tableDatas[11][m]
|
||||||
|
// // );
|
||||||
|
// //回转窑烧成系统合计
|
||||||
|
// that.tableDatas[13][m] =
|
||||||
|
// typeof that.tableDatas[12][m] !== "undefined"
|
||||||
|
// ? sumNum(
|
||||||
|
// that.tableDatas[9][m],
|
||||||
|
// that.tableDatas[10][m],
|
||||||
|
// that.tableDatas[11][m],
|
||||||
|
// that.tableDatas[12][m]
|
||||||
|
// )
|
||||||
|
// : sumNum(
|
||||||
|
// that.tableDatas[9][m],
|
||||||
|
// that.tableDatas[10][m],
|
||||||
|
// that.tableDatas[11][m]
|
||||||
|
// );
|
||||||
|
// //煤磨系统合计
|
||||||
|
// let sum17 = sumNum(
|
||||||
|
// that.tableDatas[14][m],
|
||||||
|
// that.tableDatas[15][m],
|
||||||
|
// that.tableDatas[16][m]
|
||||||
|
// );
|
||||||
|
// that.tableDatas[17][m] =
|
||||||
|
// typeof that.tableDatas[21][m] !== "undefined"
|
||||||
|
// ? sum17 - that.tableDatas[21][m]
|
||||||
|
// : sum17;
|
||||||
|
// //余热供电量
|
||||||
|
// that.tableDatas[20][m] =
|
||||||
|
// typeof that.tableDatas[19][m] !== "undefined"
|
||||||
|
// ? that.tableDatas[18][m] -
|
||||||
|
// that.tableDatas[19][m]
|
||||||
|
// : that.tableDatas[18][m];
|
||||||
|
// //空压机合计
|
||||||
|
// that.tableDatas[25][m] = sumNum(
|
||||||
|
// that.tableDatas[21][m],
|
||||||
|
// that.tableDatas[22][m],
|
||||||
|
// that.tableDatas[23][m],
|
||||||
|
// that.tableDatas[24][m]
|
||||||
|
// );
|
||||||
|
// //生产部分总耗电
|
||||||
|
// that.tableDatas[27][m] = sumNum(
|
||||||
|
// that.tableDatas[3][m],
|
||||||
|
// that.tableDatas[8][m],
|
||||||
|
// that.tableDatas[13][m],
|
||||||
|
// that.tableDatas[17][m],
|
||||||
|
// that.tableDatas[18][m],
|
||||||
|
// that.tableDatas[25][m],
|
||||||
|
// that.tableDatas[26][m]
|
||||||
|
// );
|
||||||
|
// //全厂耗电量
|
||||||
|
// // that.tableDatas[28][m] = sumNum(
|
||||||
|
// // that.tableDatas[27][m],
|
||||||
|
// // that.tableDatas[26][m]
|
||||||
|
// // );
|
||||||
|
// }
|
||||||
|
// that.tableDatas.forEach((inner, inde) => {
|
||||||
|
// let sumlast = 0;
|
||||||
|
// inner.forEach((num, ind) => {
|
||||||
|
// if (ind > 2 && ind < that.headerLength) {
|
||||||
|
// sumlast = sumlast + Number(num);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// inner[that.headerLength] = sumlast;
|
||||||
|
// });
|
||||||
|
// })
|
||||||
|
// .then(() => {});
|
||||||
|
// },
|
||||||
itemClick(item, index) {
|
itemClick(item, index) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let lineData = that.tableDatas[index].slice(3, that.headerLength);
|
let lineData = that.tableDatas[index].slice(3, that.headerLength);
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
<th>设备</th>
|
<th>设备</th>
|
||||||
<th>单位</th>
|
<th>单位</th>
|
||||||
<th v-for="item in 24" :key="item">
|
<th v-for="item in 24" :key="item">
|
||||||
{{ item }}时
|
{{ item - 1 }}时
|
||||||
</th>
|
</th>
|
||||||
<th>本日合计</th>
|
<th>本日合计</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -135,11 +135,11 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
day: "",
|
||||||
year: "",
|
year: "",
|
||||||
month: "",
|
month: "",
|
||||||
day: "",
|
|
||||||
search_date: "",
|
search_date: "",
|
||||||
tableDatas: [
|
tableDatas1: [
|
||||||
["石灰石破碎", "破碎机", "kw.h"], //0
|
["石灰石破碎", "破碎机", "kw.h"], //0
|
||||||
["石灰石破碎", "堆取料机", "kw.h"],
|
["石灰石破碎", "堆取料机", "kw.h"],
|
||||||
["石灰石破碎", "低压变压器柜", "kw.h"],
|
["石灰石破碎", "低压变压器柜", "kw.h"],
|
||||||
|
|
@ -170,10 +170,30 @@ export default {
|
||||||
["生产总耗电量", "生产部分总耗电", "kw.h"],
|
["生产总耗电量", "生产部分总耗电", "kw.h"],
|
||||||
["全厂进线", "全厂耗电量", "kw.h"],
|
["全厂进线", "全厂耗电量", "kw.h"],
|
||||||
],
|
],
|
||||||
|
mpointList: [],
|
||||||
|
tableDatas: [],
|
||||||
hours: [
|
hours: [
|
||||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
|
||||||
19, 20, 21, 22, 23, 24,
|
19, 20, 21, 22, 23, 24,
|
||||||
],
|
],
|
||||||
|
mgroupList: [
|
||||||
|
"石灰石破碎",
|
||||||
|
"原料磨",
|
||||||
|
"回转窑",
|
||||||
|
"煤磨",
|
||||||
|
"余热发电",
|
||||||
|
"空压机",
|
||||||
|
"富氧燃烧系统",
|
||||||
|
"生产总耗电量",
|
||||||
|
"全厂进线",
|
||||||
|
],
|
||||||
|
mgroup: "石灰石破碎",
|
||||||
|
itemChartTitle: "",
|
||||||
|
itemChartData: [],
|
||||||
|
itemChartXData: [],
|
||||||
|
itemChartYData: [],
|
||||||
|
itemChartLegend: [],
|
||||||
|
itemChartSeries: [],
|
||||||
timeStamp: null,
|
timeStamp: null,
|
||||||
itemVisible: false,
|
itemVisible: false,
|
||||||
exportLoading: false,
|
exportLoading: false,
|
||||||
|
|
@ -269,12 +289,16 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
let that = this;
|
let that = this;
|
||||||
var nowDate = new Date();
|
var nowDate = new Date();
|
||||||
that.year = nowDate.getFullYear();
|
let year = nowDate.getFullYear();
|
||||||
that.month = nowDate.getMonth() + 1;
|
let month = nowDate.getMonth() + 1;
|
||||||
that.day = nowDate.getDate();
|
let day = nowDate.getDate();
|
||||||
that.timeStamp = nowDate.getTime();
|
that.timeStamp = nowDate.getTime();
|
||||||
let month0 = that.month > 9 ? that.month : "0" + that.month;
|
month = month > 9 ? month : "0" + month;
|
||||||
that.search_date = that.year + "-" + month0 + "-" + that.day;
|
day = day > 9 ? day : "0" + day;
|
||||||
|
that.day = day;
|
||||||
|
that.year = year;
|
||||||
|
that.month = month;
|
||||||
|
that.search_date = year + "-" + month + "-" + day;
|
||||||
for (let i = 0; i < that.tableDatas.length; i++) {
|
for (let i = 0; i < that.tableDatas.length; i++) {
|
||||||
for (let j = 0; j < 24; j++) {
|
for (let j = 0; j < 24; j++) {
|
||||||
let k = 3 + j;
|
let k = 3 + j;
|
||||||
|
|
@ -285,224 +309,292 @@ export default {
|
||||||
for (let n = 0; n < 24; n++) {
|
for (let n = 0; n < 24; n++) {
|
||||||
that.xAxisData.push(n + "时");
|
that.xAxisData.push(n + "时");
|
||||||
}
|
}
|
||||||
this.getData();
|
this.getMPoints();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
dateChange(e) {
|
dateChange(e) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let arr = e.split("-");
|
that.tableDatas = [];
|
||||||
|
let arr = that.search_date.split("-");
|
||||||
that.year = Number(arr[0]);
|
that.year = Number(arr[0]);
|
||||||
that.month = Number(arr[1]);
|
that.month = Number(arr[1]);
|
||||||
that.day = Number(arr[2]);
|
that.day = Number(arr[2]);
|
||||||
for (let i = 0; i < that.tableDatas.length; i++) {
|
// for (let i = 0; i < that.tableDatas.length; i++) {
|
||||||
for (let j = 0; j < 25; j++) {
|
// for (let j = 0; j < 25; j++) {
|
||||||
let k = 3 + j;
|
// let k = 3 + j;
|
||||||
that.tableDatas[i][k] = 0;
|
// that.tableDatas[i][k] = 0;
|
||||||
this.$forceUpdate();
|
// this.$forceUpdate();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
let nowDate = new Date();
|
let nowDate = new Date();
|
||||||
that.timeStamp = nowDate.getTime();
|
that.timeStamp = nowDate.getTime();
|
||||||
this.getData();
|
that.dataLoop();
|
||||||
},
|
},
|
||||||
getData() {
|
getMPoints() {
|
||||||
let that = this;
|
let that = this;
|
||||||
function dataPush(name) {
|
that.$API.enm.mpoint.list
|
||||||
let index = 0;
|
.req({
|
||||||
if (name == "破碎机") {
|
page: 0,
|
||||||
index = 0;
|
enabled: true,
|
||||||
} else if (name == "堆取料机") {
|
need_display: true,
|
||||||
index = 1;
|
ordering: "report_sortstr",
|
||||||
} else if (name == "低压变压器柜") {
|
mpoint__material__code: "elec",
|
||||||
index = 2;
|
|
||||||
} else if (name == "循环风机") {
|
|
||||||
index = 4;
|
|
||||||
} else if (name == "调配变压器") {
|
|
||||||
index = 6;
|
|
||||||
} else if (name == "低压变压器柜器") {
|
|
||||||
index = 7;
|
|
||||||
} else if (name == "尾排风机") {
|
|
||||||
index = 9;
|
|
||||||
} else if (name == "高温风机") {
|
|
||||||
index = 10;
|
|
||||||
} else if (name == "头排风机") {
|
|
||||||
index = 11;
|
|
||||||
} else if (name == "煤磨主电机") {
|
|
||||||
index = 14;
|
|
||||||
} else if (name == "煤磨排风机") {
|
|
||||||
index = 15;
|
|
||||||
} else if (name == "低压变压器柜") {
|
|
||||||
index = 16;
|
|
||||||
} else if (name == "余热发电量") {
|
|
||||||
index = 18;
|
|
||||||
} else if (name == "余热发电自用电量") {
|
|
||||||
index = 19;
|
|
||||||
} else if (name == "1#空压机") {
|
|
||||||
index = 21;
|
|
||||||
} else if (name == "2#空压机") {
|
|
||||||
index = 22;
|
|
||||||
} else if (name == "3#空压机") {
|
|
||||||
index = 23;
|
|
||||||
} else if (name == "4#空压机") {
|
|
||||||
index = 24;
|
|
||||||
} else if (name == "富氧燃烧耗电设备") {
|
|
||||||
index = 26;
|
|
||||||
}
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
function sumNum(a, b, c, d) {
|
|
||||||
let sum = 0;
|
|
||||||
if (typeof a !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(a);
|
|
||||||
}
|
|
||||||
if (typeof b !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(b);
|
|
||||||
}
|
|
||||||
if (typeof c !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(c);
|
|
||||||
}
|
|
||||||
if (typeof d !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(d);
|
|
||||||
}
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
let obj = {};
|
|
||||||
obj.type = "hour_s";
|
|
||||||
obj.year_s = that.year;
|
|
||||||
obj.month_s = that.month;
|
|
||||||
obj.day_s = that.day;
|
|
||||||
obj.page = 0;
|
|
||||||
obj.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(obj)
|
|
||||||
.then((res) => {
|
|
||||||
let wrapArr = [],
|
|
||||||
innerArr = [];
|
|
||||||
res.forEach((item) => {
|
|
||||||
let hour = item.hour;
|
|
||||||
if (wrapArr[hour]) {
|
|
||||||
wrapArr[hour].push(item);
|
|
||||||
} else {
|
|
||||||
wrapArr[hour] = [];
|
|
||||||
wrapArr[hour].push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
wrapArr.forEach((inner, inde) => {
|
|
||||||
inner.forEach((item) => {
|
|
||||||
let i = dataPush(item.mpoint_name);
|
|
||||||
let k = 0;
|
|
||||||
if (
|
|
||||||
i == 0 ||
|
|
||||||
i == 4 ||
|
|
||||||
i == 9 ||
|
|
||||||
i == 14 ||
|
|
||||||
i == 18 ||
|
|
||||||
i == 21 ||
|
|
||||||
i == 26 ||
|
|
||||||
i == 27 ||
|
|
||||||
i == 28
|
|
||||||
) {
|
|
||||||
k = 3 + inde;
|
|
||||||
} else {
|
|
||||||
k = 2 + inde;
|
|
||||||
}
|
|
||||||
that.tableDatas[i][k] = item.val;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
for (let k = 0; k < 24; k++) {
|
|
||||||
let m = k + 3;
|
|
||||||
let n = k + 1;
|
|
||||||
//石灰石破碎合计
|
|
||||||
|
|
||||||
that.tableDatas[3][m] = sumNum(
|
|
||||||
that.tableDatas[0][m],
|
|
||||||
that.tableDatas[1][m],
|
|
||||||
that.tableDatas[2][m]
|
|
||||||
);
|
|
||||||
//辊压机
|
|
||||||
// that.tableDatas[5][m] = sumNum();
|
|
||||||
//原料磨系统合计
|
|
||||||
that.tableDatas[8][m] =
|
|
||||||
sumNum(
|
|
||||||
that.tableDatas[4][m],
|
|
||||||
// that.tableDatas[5][m],
|
|
||||||
that.tableDatas[6][m],
|
|
||||||
that.tableDatas[7][m]
|
|
||||||
) -
|
|
||||||
sumNum(
|
|
||||||
that.tableDatas[1][m],
|
|
||||||
that.tableDatas[2][m]
|
|
||||||
);
|
|
||||||
//低压变压器柜
|
|
||||||
// that.tableDatas[12][m] = sumNum(
|
|
||||||
// that.tableDatas[9][m],
|
|
||||||
// that.tableDatas[10][m],
|
|
||||||
// that.tableDatas[11][m]
|
|
||||||
// );
|
|
||||||
//回转窑烧成系统合计
|
|
||||||
that.tableDatas[13][m] =
|
|
||||||
typeof that.tableDatas[12][m] !== "undefined"
|
|
||||||
? sumNum(
|
|
||||||
that.tableDatas[9][m],
|
|
||||||
that.tableDatas[10][m],
|
|
||||||
that.tableDatas[11][m],
|
|
||||||
that.tableDatas[12][m]
|
|
||||||
)
|
|
||||||
: sumNum(
|
|
||||||
that.tableDatas[9][m],
|
|
||||||
that.tableDatas[10][m],
|
|
||||||
that.tableDatas[11][m]
|
|
||||||
);
|
|
||||||
//煤磨系统合计
|
|
||||||
let sum17 = sumNum(
|
|
||||||
that.tableDatas[14][m],
|
|
||||||
that.tableDatas[15][m],
|
|
||||||
that.tableDatas[16][m]
|
|
||||||
);
|
|
||||||
that.tableDatas[17][m] =
|
|
||||||
typeof that.tableDatas[21][m] !== "undefined"
|
|
||||||
? sum17 - that.tableDatas[21][m]
|
|
||||||
: sum17;
|
|
||||||
//余热供电量
|
|
||||||
that.tableDatas[20][m] =
|
|
||||||
typeof that.tableDatas[19][m] !== "undefined"
|
|
||||||
? that.tableDatas[18][m] -
|
|
||||||
that.tableDatas[19][m]
|
|
||||||
: that.tableDatas[18][m];
|
|
||||||
//空压机合计
|
|
||||||
that.tableDatas[25][m] = sumNum(
|
|
||||||
that.tableDatas[21][m],
|
|
||||||
that.tableDatas[22][m],
|
|
||||||
that.tableDatas[23][m],
|
|
||||||
that.tableDatas[24][m]
|
|
||||||
);
|
|
||||||
//生产部分总耗电
|
|
||||||
that.tableDatas[27][m] = sumNum(
|
|
||||||
that.tableDatas[3][m],
|
|
||||||
that.tableDatas[8][m],
|
|
||||||
that.tableDatas[13][m],
|
|
||||||
that.tableDatas[17][m],
|
|
||||||
that.tableDatas[18][m],
|
|
||||||
that.tableDatas[25][m],
|
|
||||||
that.tableDatas[26][m]
|
|
||||||
);
|
|
||||||
//全厂耗电量
|
|
||||||
// that.tableDatas[28][m] = sumNum(
|
|
||||||
// that.tableDatas[27][m],
|
|
||||||
// that.tableDatas[26][m]
|
|
||||||
// );
|
|
||||||
}
|
|
||||||
that.tableDatas.forEach((inner, inde) => {
|
|
||||||
let sum27 = 0;
|
|
||||||
inner.forEach((num, ind) => {
|
|
||||||
if (ind > 2 && ind < 27) {
|
|
||||||
sum27 = sum27 + Number(num);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
inner[27] = sum27;
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.then(() => {});
|
.then((res) => {
|
||||||
|
let data = res.slice(3);
|
||||||
|
that.mpointList = data;
|
||||||
|
that.dataLoop();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dataLoop() {
|
||||||
|
let that = this;
|
||||||
|
that.tableDatas = [];
|
||||||
|
that.mpointList.forEach((item, index) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] =
|
||||||
|
item.mgroup_name != null
|
||||||
|
? item.mgroup_name
|
||||||
|
: item.nickname != null
|
||||||
|
? item.nickname
|
||||||
|
: item.name;
|
||||||
|
arr[1] = item.nickname != null ? item.nickname : item.name;
|
||||||
|
arr[2] = item.unit;
|
||||||
|
for (let i = 0; i < 24; i++) {
|
||||||
|
arr[i + 3] = 0;
|
||||||
|
}
|
||||||
|
that.tableDatas.push(arr);
|
||||||
|
that.getData(item.id, index);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getData(id, index) {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.type = "hour";
|
||||||
|
obj.year = that.year;
|
||||||
|
obj.month = that.month;
|
||||||
|
obj.day = that.day;
|
||||||
|
obj.mpoint__material__code = "elec";
|
||||||
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.mpoint = id;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
res.forEach((item) => {
|
||||||
|
let ind = item.hour + 3;
|
||||||
|
that.tableDatas[index][ind] = item.val;
|
||||||
|
});
|
||||||
|
that.$forceUpdate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// getData(id) {
|
||||||
|
// let that = this;
|
||||||
|
// function dataPush(name) {
|
||||||
|
// let index = 0;
|
||||||
|
// if (name == "破碎机") {
|
||||||
|
// index = 0;
|
||||||
|
// } else if (name == "堆取料机") {
|
||||||
|
// index = 1;
|
||||||
|
// } else if (name == "低压变压器柜") {
|
||||||
|
// index = 2;
|
||||||
|
// } else if (name == "循环风机") {
|
||||||
|
// index = 4;
|
||||||
|
// } else if (name == "调配变压器") {
|
||||||
|
// index = 6;
|
||||||
|
// } else if (name == "低压变压器柜器") {
|
||||||
|
// index = 7;
|
||||||
|
// } else if (name == "尾排风机") {
|
||||||
|
// index = 9;
|
||||||
|
// } else if (name == "高温风机") {
|
||||||
|
// index = 10;
|
||||||
|
// } else if (name == "头排风机") {
|
||||||
|
// index = 11;
|
||||||
|
// } else if (name == "煤磨主电机") {
|
||||||
|
// index = 14;
|
||||||
|
// } else if (name == "煤磨排风机") {
|
||||||
|
// index = 15;
|
||||||
|
// } else if (name == "低压变压器柜") {
|
||||||
|
// index = 16;
|
||||||
|
// } else if (name == "余热发电量") {
|
||||||
|
// index = 18;
|
||||||
|
// } else if (name == "余热发电自用电量") {
|
||||||
|
// index = 19;
|
||||||
|
// } else if (name == "1#空压机") {
|
||||||
|
// index = 21;
|
||||||
|
// } else if (name == "2#空压机") {
|
||||||
|
// index = 22;
|
||||||
|
// } else if (name == "3#空压机") {
|
||||||
|
// index = 23;
|
||||||
|
// } else if (name == "4#空压机") {
|
||||||
|
// index = 24;
|
||||||
|
// } else if (name == "富氧燃烧耗电设备") {
|
||||||
|
// index = 26;
|
||||||
|
// }
|
||||||
|
// return index;
|
||||||
|
// }
|
||||||
|
// function sumNum(a, b, c, d) {
|
||||||
|
// let sum = 0;
|
||||||
|
// if (typeof a !== "undefined" && a !== "NaN") {
|
||||||
|
// sum = sum + Number(a);
|
||||||
|
// }
|
||||||
|
// if (typeof b !== "undefined" && a !== "NaN") {
|
||||||
|
// sum = sum + Number(b);
|
||||||
|
// }
|
||||||
|
// if (typeof c !== "undefined" && a !== "NaN") {
|
||||||
|
// sum = sum + Number(c);
|
||||||
|
// }
|
||||||
|
// if (typeof d !== "undefined" && a !== "NaN") {
|
||||||
|
// sum = sum + Number(d);
|
||||||
|
// }
|
||||||
|
// return sum;
|
||||||
|
// }
|
||||||
|
// let obj = {};
|
||||||
|
// obj.type = "hour_s";
|
||||||
|
// obj.year_s = that.year;
|
||||||
|
// obj.month_s = that.month;
|
||||||
|
// obj.day_s = that.day;
|
||||||
|
// obj.page = 0;
|
||||||
|
// obj.mpoint__ep_monitored__power_kw__gte = 100;
|
||||||
|
// this.$API.enm.mpoint.stat
|
||||||
|
// .req(obj)
|
||||||
|
// .then((res) => {
|
||||||
|
// let wrapArr = [],
|
||||||
|
// innerArr = [];
|
||||||
|
// res.forEach((item) => {
|
||||||
|
// let hour = item.hour;
|
||||||
|
// if (wrapArr[hour]) {
|
||||||
|
// wrapArr[hour].push(item);
|
||||||
|
// } else {
|
||||||
|
// wrapArr[hour] = [];
|
||||||
|
// wrapArr[hour].push(item);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// wrapArr.forEach((inner, inde) => {
|
||||||
|
// inner.forEach((item) => {
|
||||||
|
// let i = dataPush(item.mpoint_name);
|
||||||
|
// let k = 0;
|
||||||
|
// if (
|
||||||
|
// i == 0 ||
|
||||||
|
// i == 4 ||
|
||||||
|
// i == 9 ||
|
||||||
|
// i == 14 ||
|
||||||
|
// i == 18 ||
|
||||||
|
// i == 21 ||
|
||||||
|
// i == 26 ||
|
||||||
|
// i == 27 ||
|
||||||
|
// i == 28
|
||||||
|
// ) {
|
||||||
|
// k = 3 + inde;
|
||||||
|
// } else {
|
||||||
|
// k = 2 + inde;
|
||||||
|
// }
|
||||||
|
// that.tableDatas[i][k] = item.val;
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// for (let k = 0; k < 24; k++) {
|
||||||
|
// let m = k + 3;
|
||||||
|
// let n = k + 1;
|
||||||
|
// //石灰石破碎合计
|
||||||
|
|
||||||
|
// that.tableDatas[3][m] = sumNum(
|
||||||
|
// that.tableDatas[0][m],
|
||||||
|
// that.tableDatas[1][m],
|
||||||
|
// that.tableDatas[2][m]
|
||||||
|
// );
|
||||||
|
// //辊压机
|
||||||
|
// // that.tableDatas[5][m] = sumNum();
|
||||||
|
// //原料磨系统合计
|
||||||
|
// that.tableDatas[8][m] =
|
||||||
|
// sumNum(
|
||||||
|
// that.tableDatas[4][m],
|
||||||
|
// // that.tableDatas[5][m],
|
||||||
|
// that.tableDatas[6][m],
|
||||||
|
// that.tableDatas[7][m]
|
||||||
|
// ) -
|
||||||
|
// sumNum(
|
||||||
|
// that.tableDatas[1][m],
|
||||||
|
// that.tableDatas[2][m]
|
||||||
|
// );
|
||||||
|
// //低压变压器柜
|
||||||
|
// // that.tableDatas[12][m] = sumNum(
|
||||||
|
// // that.tableDatas[9][m],
|
||||||
|
// // that.tableDatas[10][m],
|
||||||
|
// // that.tableDatas[11][m]
|
||||||
|
// // );
|
||||||
|
// //回转窑烧成系统合计
|
||||||
|
// that.tableDatas[13][m] =
|
||||||
|
// typeof that.tableDatas[12][m] !== "undefined"
|
||||||
|
// ? sumNum(
|
||||||
|
// that.tableDatas[9][m],
|
||||||
|
// that.tableDatas[10][m],
|
||||||
|
// that.tableDatas[11][m],
|
||||||
|
// that.tableDatas[12][m]
|
||||||
|
// )
|
||||||
|
// : sumNum(
|
||||||
|
// that.tableDatas[9][m],
|
||||||
|
// that.tableDatas[10][m],
|
||||||
|
// that.tableDatas[11][m]
|
||||||
|
// );
|
||||||
|
// //煤磨系统合计
|
||||||
|
// let sum17 = sumNum(
|
||||||
|
// that.tableDatas[14][m],
|
||||||
|
// that.tableDatas[15][m],
|
||||||
|
// that.tableDatas[16][m]
|
||||||
|
// );
|
||||||
|
// that.tableDatas[17][m] =
|
||||||
|
// typeof that.tableDatas[21][m] !== "undefined"
|
||||||
|
// ? sum17 - that.tableDatas[21][m]
|
||||||
|
// : sum17;
|
||||||
|
// //余热供电量
|
||||||
|
// that.tableDatas[20][m] =
|
||||||
|
// typeof that.tableDatas[19][m] !== "undefined"
|
||||||
|
// ? that.tableDatas[18][m] -
|
||||||
|
// that.tableDatas[19][m]
|
||||||
|
// : that.tableDatas[18][m];
|
||||||
|
// //空压机合计
|
||||||
|
// that.tableDatas[25][m] = sumNum(
|
||||||
|
// that.tableDatas[21][m],
|
||||||
|
// that.tableDatas[22][m],
|
||||||
|
// that.tableDatas[23][m],
|
||||||
|
// that.tableDatas[24][m]
|
||||||
|
// );
|
||||||
|
// //生产部分总耗电
|
||||||
|
// that.tableDatas[27][m] = sumNum(
|
||||||
|
// that.tableDatas[3][m],
|
||||||
|
// that.tableDatas[8][m],
|
||||||
|
// that.tableDatas[13][m],
|
||||||
|
// that.tableDatas[17][m],
|
||||||
|
// that.tableDatas[18][m],
|
||||||
|
// that.tableDatas[25][m],
|
||||||
|
// that.tableDatas[26][m]
|
||||||
|
// );
|
||||||
|
// //全厂耗电量
|
||||||
|
// // that.tableDatas[28][m] = sumNum(
|
||||||
|
// // that.tableDatas[27][m],
|
||||||
|
// // that.tableDatas[26][m]
|
||||||
|
// // );
|
||||||
|
// }
|
||||||
|
// that.tableDatas.forEach((inner, inde) => {
|
||||||
|
// let sum27 = 0;
|
||||||
|
// inner.forEach((num, ind) => {
|
||||||
|
// if (ind > 2 && ind < 27) {
|
||||||
|
// sum27 = sum27 + Number(num);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// inner[27] = sum27;
|
||||||
|
// });
|
||||||
|
// })
|
||||||
|
// .then(() => {});
|
||||||
|
// },
|
||||||
|
getHourData() {
|
||||||
|
let that = this;
|
||||||
|
let m = 0;
|
||||||
|
let date = new Date();
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let day = date.getDate();
|
||||||
|
let hour = date.getHours();
|
||||||
|
let minute = date.getMinutes();
|
||||||
|
let second = date.getSeconds();
|
||||||
},
|
},
|
||||||
getTableData() {
|
getTableData() {
|
||||||
for (let i = 0; i < this.tableDatas.length; i++) {
|
for (let i = 0; i < this.tableDatas.length; i++) {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
<th>工段</th>
|
<th>工段</th>
|
||||||
<th>设备</th>
|
<th>设备</th>
|
||||||
<th>单位</th>
|
<th>单位</th>
|
||||||
<th v-for="item in 12" :key="item">
|
<th v-for="item in months" :key="item">
|
||||||
{{ item }}月
|
{{ item }}月
|
||||||
</th>
|
</th>
|
||||||
<th>本年合计</th>
|
<th>本年合计</th>
|
||||||
|
|
@ -135,40 +135,9 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
year: "",
|
year: "",
|
||||||
month: "",
|
|
||||||
day: "",
|
|
||||||
search_date: "",
|
search_date: "",
|
||||||
tableDatas: [
|
mpointList: [],
|
||||||
["石灰石破碎", "破碎机", "kw.h"], //0
|
tableDatas: [],
|
||||||
["石灰石破碎", "堆取料机", "kw.h"],
|
|
||||||
["石灰石破碎", "低压变压器柜", "kw.h"],
|
|
||||||
["石灰石破碎", "石灰石破碎合计", "kw.h"],
|
|
||||||
["原料磨", "循环风机", "kw.h"],
|
|
||||||
["原料磨", "辊压机", "kw.h"],
|
|
||||||
["原料磨", "调配变压器", "kw.h"],
|
|
||||||
["原料磨", "低压变压器柜器", "kw.h"],
|
|
||||||
["原料磨", "原料磨系统合计", "kw.h"],
|
|
||||||
["回转窑", "尾排风机", "kw.h"],
|
|
||||||
["回转窑", "高温风机", "kw.h"],
|
|
||||||
["回转窑", "头排风机", "kw.h"],
|
|
||||||
["回转窑", "低压变压器柜", "kw.h"],
|
|
||||||
["回转窑", "回转窑烧成系统合计", "kw.h"],
|
|
||||||
["煤磨", "煤磨主电机", "kw.h"],
|
|
||||||
["煤磨", "煤磨排风机", "kw.h"],
|
|
||||||
["煤磨", "低压变压器柜", "kw.h"],
|
|
||||||
["煤磨", "煤磨系统合计", "kw.h"],
|
|
||||||
["余热发电", "余热发电量", "kw.h"],
|
|
||||||
["余热发电", "余热发电自用电量", "kw.h"],
|
|
||||||
["余热发电", "余热供电量", "kw.h"],
|
|
||||||
["空压机", "1#空压机", "kw.h"],
|
|
||||||
["空压机", "2#空压机", "kw.h"],
|
|
||||||
["空压机", "3#空压机", "kw.h"],
|
|
||||||
["空压机", "4#空压机", "kw.h"],
|
|
||||||
["空压机", "空压机合计", "kw.h"],
|
|
||||||
["富氧燃烧系统", "富氧燃烧耗电设备", "kw.h"],
|
|
||||||
["生产总耗电量", "生产部分总耗电", "kw.h"],
|
|
||||||
["全厂进线", "全厂耗电量", "kw.h"],
|
|
||||||
],
|
|
||||||
timeStamp: null,
|
timeStamp: null,
|
||||||
itemVisible: false,
|
itemVisible: false,
|
||||||
months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
||||||
|
|
@ -278,228 +247,72 @@ export default {
|
||||||
let that = this;
|
let that = this;
|
||||||
var nowDate = new Date();
|
var nowDate = new Date();
|
||||||
that.year = nowDate.getFullYear();
|
that.year = nowDate.getFullYear();
|
||||||
that.search_date = that.year + "";
|
that.search_date = that.year;
|
||||||
that.timeStamp = nowDate.getTime();
|
that.timeStamp = nowDate.getTime();
|
||||||
let tableDatas = that.tableDatas;
|
this.getMPoints();
|
||||||
for (let i = 0; i < tableDatas.length; i++) {
|
|
||||||
for (let j = 0; j < 12; j++) {
|
|
||||||
let k = 3 + j;
|
|
||||||
that.tableDatas[i][k] = 0;
|
|
||||||
this.$forceUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.getData();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
dateChange() {
|
dateChange() {
|
||||||
let that = this;
|
let that = this;
|
||||||
for (let i = 0; i < that.tableDatas.length; i++) {
|
that.tableDatas = [];
|
||||||
for (let j = 0; j < 13; j++) {
|
that.year = that.search_date;
|
||||||
let k = 3 + j;
|
|
||||||
that.tableDatas[i][k] = 0;
|
|
||||||
this.$forceUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let nowDate = new Date();
|
let nowDate = new Date();
|
||||||
that.timeStamp = nowDate.getTime();
|
that.timeStamp = nowDate.getTime();
|
||||||
this.getData();
|
that.dataLoop();
|
||||||
},
|
},
|
||||||
getData() {
|
getMPoints() {
|
||||||
let that = this;
|
let that = this;
|
||||||
function dataPush(name) {
|
that.$API.enm.mpoint.list
|
||||||
let index = 0;
|
.req({
|
||||||
if (name == "破碎机") {
|
page: 0,
|
||||||
index = 0;
|
enabled: true,
|
||||||
} else if (name == "堆取料机") {
|
need_display: true,
|
||||||
index = 1;
|
ordering: "report_sortstr",
|
||||||
} else if (name == "低压变压器柜") {
|
mpoint__material__code: "elec",
|
||||||
index = 2;
|
|
||||||
} else if (name == "循环风机") {
|
|
||||||
index = 4;
|
|
||||||
} else if (name == "调配变压器") {
|
|
||||||
index = 6;
|
|
||||||
} else if (name == "低压变压器柜器") {
|
|
||||||
index = 7;
|
|
||||||
} else if (name == "尾排风机") {
|
|
||||||
index = 9;
|
|
||||||
} else if (name == "高温风机") {
|
|
||||||
index = 10;
|
|
||||||
} else if (name == "头排风机") {
|
|
||||||
index = 11;
|
|
||||||
} else if (name == "煤磨主电机") {
|
|
||||||
index = 14;
|
|
||||||
} else if (name == "煤磨排风机") {
|
|
||||||
index = 15;
|
|
||||||
} else if (name == "低压变压器柜") {
|
|
||||||
index = 16;
|
|
||||||
} else if (name == "余热发电量") {
|
|
||||||
index = 18;
|
|
||||||
} else if (name == "余热发电自用电量") {
|
|
||||||
index = 19;
|
|
||||||
} else if (name == "1#空压机") {
|
|
||||||
index = 21;
|
|
||||||
} else if (name == "2#空压机") {
|
|
||||||
index = 22;
|
|
||||||
} else if (name == "3#空压机") {
|
|
||||||
index = 23;
|
|
||||||
} else if (name == "4#空压机") {
|
|
||||||
index = 24;
|
|
||||||
} else if (name == "富氧燃烧耗电设备") {
|
|
||||||
index = 26;
|
|
||||||
}
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
function sumNum(a, b, c, d) {
|
|
||||||
let sum = 0;
|
|
||||||
if (typeof a !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(a);
|
|
||||||
}
|
|
||||||
if (typeof b !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(b);
|
|
||||||
}
|
|
||||||
if (typeof c !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(c);
|
|
||||||
}
|
|
||||||
if (typeof d !== "undefined" && a !== "NaN") {
|
|
||||||
sum = sum + Number(d);
|
|
||||||
}
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
let obj = {};
|
|
||||||
|
|
||||||
obj.type = "month_s";
|
|
||||||
obj.year_s = that.year;
|
|
||||||
obj.page = 0;
|
|
||||||
obj.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(obj)
|
|
||||||
.then((res) => {
|
|
||||||
let wrapArr = [],
|
|
||||||
innerArr = [];
|
|
||||||
res.forEach((item) => {
|
|
||||||
let month = item.month;
|
|
||||||
if (wrapArr[month]) {
|
|
||||||
wrapArr[month].push(item);
|
|
||||||
} else {
|
|
||||||
wrapArr[month] = [];
|
|
||||||
wrapArr[month].push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
wrapArr.forEach((inner, inde) => {
|
|
||||||
inner.forEach((item) => {
|
|
||||||
let i = dataPush(item.mpoint_name);
|
|
||||||
let k = 0;
|
|
||||||
if (
|
|
||||||
i == 0 ||
|
|
||||||
i == 4 ||
|
|
||||||
i == 9 ||
|
|
||||||
i == 14 ||
|
|
||||||
i == 18 ||
|
|
||||||
i == 21 ||
|
|
||||||
i == 26 ||
|
|
||||||
i == 27 ||
|
|
||||||
i == 28
|
|
||||||
) {
|
|
||||||
k = 3 + inde;
|
|
||||||
} else {
|
|
||||||
k = 2 + inde;
|
|
||||||
}
|
|
||||||
that.tableDatas[i][k] = item.val;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
for (let k = 0; k < 24; k++) {
|
|
||||||
let m = k + 3;
|
|
||||||
let n = k + 1;
|
|
||||||
//石灰石破碎合计
|
|
||||||
that.tableDatas[3][m] = sumNum(
|
|
||||||
that.tableDatas[0][m],
|
|
||||||
that.tableDatas[1][m],
|
|
||||||
that.tableDatas[2][m]
|
|
||||||
);
|
|
||||||
//辊压机
|
|
||||||
// that.tableDatas[5][m] = sumNum();
|
|
||||||
//原料磨系统合计
|
|
||||||
that.tableDatas[8][m] =
|
|
||||||
sumNum(
|
|
||||||
that.tableDatas[4][m],
|
|
||||||
// that.tableDatas[5][m],
|
|
||||||
that.tableDatas[6][m],
|
|
||||||
that.tableDatas[7][m]
|
|
||||||
) -
|
|
||||||
sumNum(
|
|
||||||
that.tableDatas[1][m],
|
|
||||||
that.tableDatas[2][m]
|
|
||||||
);
|
|
||||||
//低压变压器柜
|
|
||||||
// that.tableDatas[12][m] = sumNum(
|
|
||||||
// that.tableDatas[9][m],
|
|
||||||
// that.tableDatas[10][m],
|
|
||||||
// that.tableDatas[11][m]
|
|
||||||
// );
|
|
||||||
//回转窑烧成系统合计
|
|
||||||
that.tableDatas[13][m] =
|
|
||||||
typeof that.tableDatas[12][m] !== "undefined"
|
|
||||||
? sumNum(
|
|
||||||
that.tableDatas[9][m],
|
|
||||||
that.tableDatas[10][m],
|
|
||||||
that.tableDatas[11][m],
|
|
||||||
that.tableDatas[12][m]
|
|
||||||
)
|
|
||||||
: sumNum(
|
|
||||||
that.tableDatas[9][m],
|
|
||||||
that.tableDatas[10][m],
|
|
||||||
that.tableDatas[11][m]
|
|
||||||
);
|
|
||||||
//煤磨系统合计
|
|
||||||
let sum17 = sumNum(
|
|
||||||
that.tableDatas[14][m],
|
|
||||||
that.tableDatas[15][m],
|
|
||||||
that.tableDatas[16][m]
|
|
||||||
);
|
|
||||||
that.tableDatas[17][m] =
|
|
||||||
typeof that.tableDatas[21][m] !== "undefined"
|
|
||||||
? sum17 - that.tableDatas[21][m]
|
|
||||||
: sum17;
|
|
||||||
//余热供电量
|
|
||||||
that.tableDatas[20][m] =
|
|
||||||
typeof that.tableDatas[19][m] !== "undefined"
|
|
||||||
? that.tableDatas[18][m] -
|
|
||||||
that.tableDatas[19][m]
|
|
||||||
: that.tableDatas[18][m];
|
|
||||||
//空压机合计
|
|
||||||
that.tableDatas[25][m] = sumNum(
|
|
||||||
that.tableDatas[21][m],
|
|
||||||
that.tableDatas[22][m],
|
|
||||||
that.tableDatas[23][m],
|
|
||||||
that.tableDatas[24][m]
|
|
||||||
);
|
|
||||||
//生产部分总耗电
|
|
||||||
that.tableDatas[27][m] = sumNum(
|
|
||||||
that.tableDatas[3][m],
|
|
||||||
that.tableDatas[8][m],
|
|
||||||
that.tableDatas[13][m],
|
|
||||||
that.tableDatas[17][m],
|
|
||||||
that.tableDatas[18][m],
|
|
||||||
that.tableDatas[25][m],
|
|
||||||
that.tableDatas[26][m]
|
|
||||||
);
|
|
||||||
//全厂耗电量
|
|
||||||
// that.tableDatas[28][m] = sumNum(
|
|
||||||
// that.tableDatas[27][m],
|
|
||||||
// that.tableDatas[26][m]
|
|
||||||
// );
|
|
||||||
}
|
|
||||||
that.tableDatas.forEach((inner, inde) => {
|
|
||||||
let sum15 = 0;
|
|
||||||
inner.forEach((num, ind) => {
|
|
||||||
if (ind > 2 && ind < 15) {
|
|
||||||
sum15 = sum15 + Number(num);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
inner[15] = sum15;
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.then(() => {});
|
.then((res) => {
|
||||||
|
let data = res.slice(3);
|
||||||
|
that.mpointList = data;
|
||||||
|
that.dataLoop();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dataLoop() {
|
||||||
|
let that = this;
|
||||||
|
that.tableDatas = [];
|
||||||
|
that.mpointList.forEach((item, index) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] =
|
||||||
|
item.mgroup_name != null
|
||||||
|
? item.mgroup_name
|
||||||
|
: item.nickname != null
|
||||||
|
? item.nickname
|
||||||
|
: item.name;
|
||||||
|
arr[1] = item.nickname != null ? item.nickname : item.name;
|
||||||
|
arr[2] = item.unit;
|
||||||
|
for (let i = 0; i < 12; i++) {
|
||||||
|
arr[i + 3] = 0;
|
||||||
|
}
|
||||||
|
that.tableDatas.push(arr);
|
||||||
|
that.getData(item.id, index);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getData(id, index) {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.type = "month";
|
||||||
|
obj.year = that.year;
|
||||||
|
obj.mpoint__material__code = "elec";
|
||||||
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.mpoint = id;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
res.forEach((item) => {
|
||||||
|
let ind = item.month + 2;
|
||||||
|
that.tableDatas[index][ind] = item.val;
|
||||||
|
});
|
||||||
|
that.$forceUpdate();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
itemClick(item, index) {
|
itemClick(item, index) {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue