fix:enm单位产品电耗更改引用接口
This commit is contained in:
parent
32252eb850
commit
ca7a62fbbc
|
|
@ -238,6 +238,7 @@ export default {
|
||||||
["煤磨排风机主电机", "", "KW·h/t", "", "", ""],
|
["煤磨排风机主电机", "", "KW·h/t", "", "", ""],
|
||||||
["煤磨主电机", "", "KW·h/t", "", "", ""],
|
["煤磨主电机", "", "KW·h/t", "", "", ""],
|
||||||
],
|
],
|
||||||
|
tableData: [],
|
||||||
modelValue: true,
|
modelValue: true,
|
||||||
type: "hour_s",
|
type: "hour_s",
|
||||||
title: "煤磨工段",
|
title: "煤磨工段",
|
||||||
|
|
@ -346,148 +347,42 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
mpoints: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let that = this;
|
let that = this;
|
||||||
var myDate = new Date();
|
var myDate = new Date();
|
||||||
let year = myDate.getFullYear();
|
that.year = myDate.getFullYear();
|
||||||
let month = myDate.getMonth() + 1;
|
that.month = myDate.getMonth() + 1;
|
||||||
let days = myDate.getDate();
|
that.days = myDate.getDate();
|
||||||
let hours = myDate.getHours();
|
that.hours = myDate.getHours();
|
||||||
let timeDate = myDate.getTime();
|
that.getMpoints();
|
||||||
let dayTime = 24 * 60 * 60 * 1000;
|
that.getTableHourData();
|
||||||
//昨天的计算
|
that.getHourData(that.year, that.month, that.days);
|
||||||
let year_d = year,
|
that.getDayData(that.year, that.month);
|
||||||
month_d = month,
|
that.getMonthData(that.year);
|
||||||
days_d = days;
|
|
||||||
if (hours < 21) {
|
|
||||||
//21点前,查找昨日数据为前一天数据
|
|
||||||
let newDate = timeDate - dayTime;
|
|
||||||
let lastDate = new Date(newDate);
|
|
||||||
year_d = lastDate.getFullYear();
|
|
||||||
month_d = lastDate.getMonth() + 1;
|
|
||||||
days_d = lastDate.getDate();
|
|
||||||
}
|
|
||||||
//上一小时的计算
|
|
||||||
let hourTime = timeDate - 3600000;
|
|
||||||
let hourDate = new Date(hourTime);
|
|
||||||
let year_h = hourDate.getFullYear();
|
|
||||||
let month_h = hourDate.getMonth() + 1;
|
|
||||||
let days_h = hourDate.getDate();
|
|
||||||
let hours_h = hourDate.getHours();
|
|
||||||
this.$API.mtm.mgroup.list
|
|
||||||
.req({ page: 0, search: "煤磨" })
|
|
||||||
.then((res) => {
|
|
||||||
console.log("煤磨", res);
|
|
||||||
that.query.mgroup = res[0].id;
|
|
||||||
//本月
|
|
||||||
let params2 = {};
|
|
||||||
params2.page = 0;
|
|
||||||
params2.year_s = year;
|
|
||||||
params2.month_s = month;
|
|
||||||
params2.type = "month_s";
|
|
||||||
params2.mgroup = that.query.mgroup;
|
|
||||||
that.$API.enm.enstat
|
|
||||||
.req(params2)
|
|
||||||
.then((res2) => {
|
|
||||||
if (res2.length > 0) {
|
|
||||||
let hourProduct = (that.allValMonth =
|
|
||||||
res2[0].total_production); //当前条件下的总产量
|
|
||||||
params2.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
that.$API.enm.mpoint.stat
|
|
||||||
.req(params2)
|
|
||||||
.then((res) => {
|
|
||||||
let data2 = res;
|
|
||||||
for (let i = 0; i < data2.length; i++) {
|
|
||||||
that.tableDatas[i] = [];
|
|
||||||
that.tableDatas[i][0] =
|
|
||||||
data2[i].ep_monitored_name;
|
|
||||||
that.tableDatas[i][1] =
|
|
||||||
data2[i].ep_monitored_number;
|
|
||||||
that.tableDatas[i][2] = "KW·h/t";
|
|
||||||
let val =
|
|
||||||
hourProduct == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data2[i].val /
|
|
||||||
hourProduct
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[i][5] = val;
|
|
||||||
that.tableDatas[i][6] = data2[i].mpoint;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then((res2) => {
|
|
||||||
//昨日
|
|
||||||
let params3 = {};
|
|
||||||
params3.page = 0;
|
|
||||||
params3.year_s = year_d;
|
|
||||||
params3.month_s = month_d;
|
|
||||||
params3.day_s = days_d;
|
|
||||||
params3.type = "day_s";
|
|
||||||
params3.mgroup = that.query.mgroup;
|
|
||||||
that.$API.enm.enstat.req(params3).then((res3) => {
|
|
||||||
if (res3.length > 0) {
|
|
||||||
let hourProduct = (that.allValDays =
|
|
||||||
res3[0].total_production);
|
|
||||||
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
that.$API.enm.mpoint.stat
|
|
||||||
.req(params3)
|
|
||||||
.then((res) => {
|
|
||||||
let data3 = res3;
|
|
||||||
for (let j = 0; j < data3.length; j++) {
|
|
||||||
let val =
|
|
||||||
hourProduct == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data3[j].val /
|
|
||||||
hourProduct
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[j][4] = val;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//上小时
|
|
||||||
let params4 = {};
|
|
||||||
params4.page = 0;
|
|
||||||
params4.year = year_h;
|
|
||||||
params4.month = month_h;
|
|
||||||
params4.day = days_h;
|
|
||||||
params4.hour = hours_h;
|
|
||||||
params4.type = "hour_s";
|
|
||||||
params4.mgroup = that.query.mgroup;
|
|
||||||
that.$API.enm.enstat.req(params4).then((res4) => {
|
|
||||||
if (res4.length > 0) {
|
|
||||||
let hourProduct = (that.allValHour =
|
|
||||||
res4[0].total_production);
|
|
||||||
params4.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
that.$API.enm.mpoint.stat
|
|
||||||
.req(params4)
|
|
||||||
.then((res) => {
|
|
||||||
let data4 = res4;
|
|
||||||
for (let k = 0; k < data4.length; k++) {
|
|
||||||
let val =
|
|
||||||
hourProduct == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data4[k].val /
|
|
||||||
hourProduct
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[k][3] = val;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
that.getHourData();
|
|
||||||
that.getDayData();
|
|
||||||
that.getMonthData();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getMpoints() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.mgroup__name = "煤磨";
|
||||||
|
obj.page = 0;
|
||||||
|
obj.enabled = 1;
|
||||||
|
obj.need_display = 1;
|
||||||
|
obj.ordering = "report_sortstr";
|
||||||
|
obj.material__code__in = "elec,elec_0";
|
||||||
|
this.$API.enm.mpoint.list.req(obj).then((res) => {
|
||||||
|
console.log("mpoints", res);
|
||||||
|
let arr = [];
|
||||||
|
res.forEach((item) => {
|
||||||
|
arr.push(item.nickname);
|
||||||
|
});
|
||||||
|
console.log("arr", arr);
|
||||||
|
that.mpoints = arr;
|
||||||
|
});
|
||||||
|
},
|
||||||
typeRadioChange() {
|
typeRadioChange() {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
|
|
@ -505,39 +400,154 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.getMonthData(val);
|
this.getMonthData(val);
|
||||||
}
|
}
|
||||||
|
this.searchDate;
|
||||||
},
|
},
|
||||||
//获取小时数据
|
getTableHourData() {
|
||||||
getHourData() {
|
|
||||||
let that = this;
|
let that = this;
|
||||||
let query = {};
|
that.tableDatas = [];
|
||||||
query.page = 0;
|
let timeDate = new Date().getTime();
|
||||||
query.year_s = that.year;
|
let hourTime = timeDate - 3600000;
|
||||||
query.month_s = that.month;
|
let hourDate = new Date(hourTime);
|
||||||
query.day_s = that.days;
|
let year_h = hourDate.getFullYear();
|
||||||
query.type = "hour_s";
|
let month_h = hourDate.getMonth() + 1;
|
||||||
query.mgroup = that.query.mgroup;
|
let days_h = hourDate.getDate();
|
||||||
query.mpoint__ep_monitored__power_kw__gte = 100;
|
let hours_h = hourDate.getHours();
|
||||||
this.$API.enm.mpoint.stat.req(query).then((response) => {
|
let minutes = hourDate.getMinutes();
|
||||||
let seriesData0 = [],
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
seriesData1 = [];
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
let data = response;
|
if (hours_h > 5) {
|
||||||
data.forEach((item) => {
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
let ind = item.hour;
|
|
||||||
let val = 0;
|
|
||||||
if (that.allValHour == 0) {
|
|
||||||
val = "";
|
|
||||||
} else {
|
} else {
|
||||||
val = (item.val / that.allValHour).toFixed(2);
|
hours_h = hours_h - 1;
|
||||||
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
}
|
}
|
||||||
if (item.equip_name == "煤磨排风机主电机") {
|
let obj = {};
|
||||||
seriesData0[ind] = val;
|
obj.type = "hour_s";
|
||||||
} else if (item.equip_name == "煤磨主电机") {
|
obj.year = year_h;
|
||||||
seriesData1[ind] = val;
|
obj.month = month_h;
|
||||||
|
obj.day = days_h;
|
||||||
|
obj.hour = hours_h;
|
||||||
|
obj.mgroup__name = "煤磨";
|
||||||
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat
|
||||||
|
.req(obj)
|
||||||
|
.then((res) => {
|
||||||
|
that.tableData = res;
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item) => {
|
||||||
|
let index = that.mpoints.indexOf(item.mpoint_nickname);
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[3] = item.elec_consume_unit;
|
||||||
|
obj[4] = 0;
|
||||||
|
obj[5] = 0;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index] = obj;
|
||||||
|
});
|
||||||
|
let yetTime = timeDate - 3600000 * 24;
|
||||||
|
let ystDate = new Date(yetTime);
|
||||||
|
let year_h = ystDate.getFullYear();
|
||||||
|
let month_h = ystDate.getMonth() + 1;
|
||||||
|
let days_h = ystDate.getDate();
|
||||||
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
|
let obj_d = {};
|
||||||
|
obj_d.type = "day_s";
|
||||||
|
obj_d.year_s = year_h;
|
||||||
|
obj_d.month_s = month_h;
|
||||||
|
obj_d.day_s = days_h;
|
||||||
|
obj_d.mgroup__name = "煤磨";
|
||||||
|
obj_d.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj_d.mpoint__need_display = 1;
|
||||||
|
obj_d.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj_d).then((res) => {
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item, index) => {
|
||||||
|
let index_d = that.mpoints.indexOf(
|
||||||
|
item.mpoint_nickname
|
||||||
|
);
|
||||||
|
if (that.tableDatas[index_d]) {
|
||||||
|
that.tableDatas[index_d][3] =
|
||||||
|
item.elec_consume_unit;
|
||||||
|
} else {
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[4] = item.elec_consume_unit;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index_d] = obj;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
let obj_m = {};
|
||||||
|
obj_m.type = "month_s";
|
||||||
|
obj_m.year_s = that.year;
|
||||||
|
obj_m.month_s = that.month;
|
||||||
|
obj_m.mgroup__name = "煤磨";
|
||||||
|
obj_m.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj_m.mpoint__need_display = 1;
|
||||||
|
obj_m.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj_m).then((res) => {
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item, index) => {
|
||||||
|
let index_m = that.mpoints.indexOf(
|
||||||
|
item.mpoint_nickname
|
||||||
|
);
|
||||||
|
if (that.tableDatas[index_m]) {
|
||||||
|
that.tableDatas[index_m][4] =
|
||||||
|
item.elec_consume_unit;
|
||||||
|
} else {
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[5] = item.elec_consume_unit;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index_m] = obj;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then(() => {});
|
||||||
|
},
|
||||||
|
//获取小时数据
|
||||||
|
getHourData(year, month, days) {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.type = "hour_s";
|
||||||
|
obj.year_s = year;
|
||||||
|
obj.month_s = month;
|
||||||
|
obj.day_s = days;
|
||||||
|
obj.mgroup__name = "煤磨";
|
||||||
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
|
let seriesData = [];
|
||||||
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
|
seriesData.push([]);
|
||||||
|
}
|
||||||
|
let data = response;
|
||||||
|
data.forEach((item) => {
|
||||||
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
|
let ind = item.hour; //xAxis
|
||||||
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
|
});
|
||||||
let options = { ...that.option1 };
|
let options = { ...that.option1 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
|
chartItem.name = that.mpoints[j];
|
||||||
|
chartItem.type = "bar";
|
||||||
|
chartItem.data = seriesData[j];
|
||||||
|
options.series.push(chartItem);
|
||||||
|
}
|
||||||
|
options.legend.data = that.mpoints;
|
||||||
let hourXAxis = [];
|
let hourXAxis = [];
|
||||||
for (let i = 0; i < 24; i++) {
|
for (let i = 0; i < 24; i++) {
|
||||||
let item = i + "时";
|
let item = i + "时";
|
||||||
|
|
@ -548,39 +558,40 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取天数据
|
//获取天数据
|
||||||
getDayData() {
|
getDayData(year, month) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query1 = {};
|
let obj = {};
|
||||||
query1.page = 0;
|
obj.type = "day_s";
|
||||||
query1.year_s = that.year;
|
obj.year_s = year;
|
||||||
query1.month_s = that.month;
|
obj.month_s = month;
|
||||||
query1.type = "day_s";
|
obj.mgroup__name = "煤磨";
|
||||||
query1.mgroup = this.query.mgroup;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
query1.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
this.$API.enm.enstat.req(query1).then((response) => {
|
obj.mpoint__need_display = 1;
|
||||||
let seriesData0 = [],
|
obj.page = 0;
|
||||||
seriesData1 = [];
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
|
let seriesData = [];
|
||||||
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
|
seriesData.push([]);
|
||||||
|
}
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
// debugger;
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
let ind = item.day_s;
|
let ind = item.day_s - 1;
|
||||||
let val = 0;
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
if (that.allValDays == 0) {
|
|
||||||
val = "";
|
|
||||||
} else {
|
|
||||||
val = (item.val / that.allValDays).toFixed(2);
|
|
||||||
}
|
|
||||||
if (item.equip_name == "煤磨排风机主电机") {
|
|
||||||
seriesData0[ind] = val;
|
|
||||||
} else if (item.equip_name == "煤磨主电机") {
|
|
||||||
seriesData1[ind] = val;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
let options = { ...that.option2 };
|
let options = { ...that.option2 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
|
chartItem.name = that.mpoints[j];
|
||||||
|
chartItem.type = "bar";
|
||||||
|
chartItem.data = seriesData[j];
|
||||||
|
options.series.push(chartItem);
|
||||||
|
}
|
||||||
|
options.legend.data = that.mpoints;
|
||||||
let dayXAxis = [];
|
let dayXAxis = [];
|
||||||
for (let i = 1; i <= that.days; i++) {
|
let dayss = new Date(year, month, 0).getDate();
|
||||||
|
for (let i = 1; i <= dayss; i++) {
|
||||||
let item = i + "日";
|
let item = i + "日";
|
||||||
dayXAxis.push(item);
|
dayXAxis.push(item);
|
||||||
}
|
}
|
||||||
|
|
@ -589,37 +600,38 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取月数据
|
//获取月数据
|
||||||
getMonthData() {
|
getMonthData(year) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query2 = {};
|
let obj = {};
|
||||||
query2.page = 0;
|
obj.type = "month_s";
|
||||||
query2.year_s = that.year;
|
obj.year_s = year;
|
||||||
query2.type = "month_s";
|
obj.mgroup__name = "煤磨";
|
||||||
query2.mgroup = that.query.mgroup;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
query2.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
this.$API.enm.enstat.req(query2).then((response) => {
|
obj.mpoint__need_display = 1;
|
||||||
let seriesData0 = [],
|
obj.page = 0;
|
||||||
seriesData1 = [];
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
|
let seriesData = [];
|
||||||
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
|
seriesData.push([]);
|
||||||
|
}
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
let ind = item.month_s;
|
let ind = item.month_s - 1;
|
||||||
let val = 0;
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
if (that.allValMonth == 0) {
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
val = "";
|
|
||||||
} else {
|
|
||||||
val = (item.val / that.allValMonth).toFixed(2);
|
|
||||||
}
|
|
||||||
if (item.equip_name == "煤磨排风机主电机") {
|
|
||||||
seriesData0[ind] = val;
|
|
||||||
} else if (item.equip_name == "煤磨主电机") {
|
|
||||||
seriesData1[ind] = val;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
let options = { ...that.option3 };
|
let options = { ...that.option3 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
|
chartItem.name = that.mpoints[j];
|
||||||
|
chartItem.type = "bar";
|
||||||
|
chartItem.data = seriesData[j];
|
||||||
|
options.series.push(chartItem);
|
||||||
|
}
|
||||||
|
options.legend.data = that.mpoints;
|
||||||
let monthXAxis = [];
|
let monthXAxis = [];
|
||||||
for (let i = 1; i <= that.month; i++) {
|
for (let i = 1; i < 13; i++) {
|
||||||
let item = i + "月";
|
let item = i + "月";
|
||||||
monthXAxis.push(item);
|
monthXAxis.push(item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,7 @@ export default {
|
||||||
["高温风机", "", "KW·h/t", "", "", ""],
|
["高温风机", "", "KW·h/t", "", "", ""],
|
||||||
["窑主电机", "", "KW·h/t", "", "", ""],
|
["窑主电机", "", "KW·h/t", "", "", ""],
|
||||||
],
|
],
|
||||||
|
tableData: [],
|
||||||
modelValue: true,
|
modelValue: true,
|
||||||
type: "hour_s",
|
type: "hour_s",
|
||||||
title: "回转窑工段",
|
title: "回转窑工段",
|
||||||
|
|
@ -460,148 +461,43 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
mpoints: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
//回转窑
|
||||||
let that = this;
|
let that = this;
|
||||||
var myDate = new Date();
|
var myDate = new Date();
|
||||||
let year = myDate.getFullYear();
|
that.year = myDate.getFullYear();
|
||||||
let month = myDate.getMonth() + 1;
|
that.month = myDate.getMonth() + 1;
|
||||||
let days = myDate.getDate();
|
that.days = myDate.getDate();
|
||||||
let hours = myDate.getHours();
|
that.hours = myDate.getHours();
|
||||||
let timeDate = myDate.getTime();
|
that.getMpoints();
|
||||||
let dayTime = 24 * 60 * 60 * 1000;
|
that.getTableHourData();
|
||||||
//昨天的计算
|
that.getHourData(that.year, that.month, that.days);
|
||||||
let year_d = year,
|
that.getDayData(that.year, that.month);
|
||||||
month_d = month,
|
that.getMonthData(that.year);
|
||||||
days_d = days;
|
|
||||||
if (hours < 21) {
|
|
||||||
//21点前,查找昨日数据为前一天数据
|
|
||||||
let newDate = timeDate - dayTime;
|
|
||||||
let lastDate = new Date(newDate);
|
|
||||||
year_d = lastDate.getFullYear();
|
|
||||||
month_d = lastDate.getMonth() + 1;
|
|
||||||
days_d = lastDate.getDate();
|
|
||||||
}
|
|
||||||
//上一小时的计算
|
|
||||||
let hourTime = timeDate - 3600000;
|
|
||||||
let hourDate = new Date(hourTime);
|
|
||||||
let year_h = hourDate.getFullYear();
|
|
||||||
let month_h = hourDate.getMonth() + 1;
|
|
||||||
let days_h = hourDate.getDate();
|
|
||||||
let hours_h = hourDate.getHours();
|
|
||||||
that.$API.mtm.mgroup.list
|
|
||||||
.req({ page: 0, search: "回转窑" })
|
|
||||||
.then((res) => {
|
|
||||||
console.log("回转窑", res);
|
|
||||||
that.query.mgroup = res[0].id;
|
|
||||||
//本月
|
|
||||||
let params2 = {};
|
|
||||||
params2.page = 0;
|
|
||||||
params2.year_s = year;
|
|
||||||
params2.month_s = month;
|
|
||||||
params2.type = "month_s";
|
|
||||||
params2.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat
|
|
||||||
.req(params2)
|
|
||||||
.then((res2) => {
|
|
||||||
if (res2.length > 0) {
|
|
||||||
let allValMonth = (that.allValMonth =
|
|
||||||
res2[0].total_production); //当前条件下的总产量
|
|
||||||
params2.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(params2)
|
|
||||||
.then((res) => {
|
|
||||||
let data2 = res;
|
|
||||||
for (let i = 0; i < data2.length; i++) {
|
|
||||||
that.tableDatas[i] = [];
|
|
||||||
that.tableDatas[i][0] =
|
|
||||||
data2[i].ep_monitored_name;
|
|
||||||
that.tableDatas[i][1] =
|
|
||||||
data2[i].ep_monitored_number;
|
|
||||||
that.tableDatas[i][2] = "KW·h/t";
|
|
||||||
let val =
|
|
||||||
allValMonth == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data2[i].val /
|
|
||||||
allValMonth
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[i][5] = val;
|
|
||||||
that.tableDatas[i][6] = data2[i].mpoint;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then((res2) => {
|
|
||||||
//昨日
|
|
||||||
let params3 = {};
|
|
||||||
params3.page = 0;
|
|
||||||
params3.year_s = year_d;
|
|
||||||
params3.month_s = month_d;
|
|
||||||
params3.day_s = days_d;
|
|
||||||
params3.type = "day_s";
|
|
||||||
params3.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat.req(params3).then((res3) => {
|
|
||||||
if (res3.length > 0) {
|
|
||||||
let allValDays = (that.allValDays =
|
|
||||||
res3[0].total_production);
|
|
||||||
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(params3)
|
|
||||||
.then((res) => {
|
|
||||||
let data3 = res3;
|
|
||||||
for (let j = 0; j < data3.length; j++) {
|
|
||||||
let val =
|
|
||||||
allValDays == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data3[j].val /
|
|
||||||
allValDays
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[j][4] = val;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//上小时
|
|
||||||
let params4 = {};
|
|
||||||
params4.page = 0;
|
|
||||||
params4.year = year_h;
|
|
||||||
params4.month = month_h;
|
|
||||||
params4.day = days_h;
|
|
||||||
params4.hour = hours_h;
|
|
||||||
params4.type = "hour_s";
|
|
||||||
params4.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat.req(params4).then((res4) => {
|
|
||||||
if (res4.length > 0) {
|
|
||||||
let hourProduct = (that.allValHour =
|
|
||||||
res4[0].total_production);
|
|
||||||
params4.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(params4)
|
|
||||||
.then((res) => {
|
|
||||||
let data4 = res4;
|
|
||||||
for (let k = 0; k < data4.length; k++) {
|
|
||||||
let val =
|
|
||||||
hourProduct == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data4[k].val /
|
|
||||||
hourProduct
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[k][3] = val;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
that.getHourData();
|
|
||||||
that.getDayData();
|
|
||||||
that.getMonthData();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getMpoints() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.mgroup__name = "回转窑";
|
||||||
|
obj.page = 0;
|
||||||
|
obj.enabled = 1;
|
||||||
|
obj.need_display = 1;
|
||||||
|
obj.ordering = "report_sortstr";
|
||||||
|
obj.material__code__in = "elec,elec_0";
|
||||||
|
this.$API.enm.mpoint.list.req(obj).then((res) => {
|
||||||
|
console.log("mpoints", res);
|
||||||
|
let arr = [];
|
||||||
|
res.forEach((item) => {
|
||||||
|
arr.push(item.nickname);
|
||||||
|
});
|
||||||
|
console.log("arr", arr);
|
||||||
|
that.mpoints = arr;
|
||||||
|
});
|
||||||
|
},
|
||||||
typeRadioChange() {
|
typeRadioChange() {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
|
|
@ -621,66 +517,152 @@ export default {
|
||||||
}
|
}
|
||||||
this.searchDate;
|
this.searchDate;
|
||||||
},
|
},
|
||||||
//获取小时数据
|
getTableHourData() {
|
||||||
getHourData() {
|
|
||||||
let that = this;
|
let that = this;
|
||||||
let query = {};
|
that.tableDatas = [];
|
||||||
query.page = 0;
|
let timeDate = new Date().getTime();
|
||||||
query.year_s = that.year;
|
let hourTime = timeDate - 3600000;
|
||||||
query.month_s = that.month;
|
let hourDate = new Date(hourTime);
|
||||||
query.day_s = that.days;
|
let year_h = hourDate.getFullYear();
|
||||||
query.type = "hour_s";
|
let month_h = hourDate.getMonth() + 1;
|
||||||
query.mgroup = that.query.mgroup;
|
let days_h = hourDate.getDate();
|
||||||
query.mpoint__ep_monitored__power_kw__gte = 100;
|
let hours_h = hourDate.getHours();
|
||||||
this.$API.enm.mpoint.stat.req(query).then((response) => {
|
let minutes = hourDate.getMinutes();
|
||||||
let seriesData0 = [],
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
seriesData1 = [],
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
seriesData2 = [],
|
if (hours_h > 5) {
|
||||||
seriesData3 = [],
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
seriesData4 = [],
|
|
||||||
seriesData5 = [],
|
|
||||||
seriesData6 = [],
|
|
||||||
seriesData7 = [];
|
|
||||||
let data = response;
|
|
||||||
data.forEach((item) => {
|
|
||||||
let ind = item.hour;
|
|
||||||
let val = 0;
|
|
||||||
if (that.allValHour == 0) {
|
|
||||||
val = "";
|
|
||||||
} else {
|
} else {
|
||||||
val = (item.val / that.allValHour).toFixed(2);
|
hours_h = hours_h - 1;
|
||||||
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
}
|
}
|
||||||
if (item.equip_name == "高温风机") {
|
let obj = {};
|
||||||
seriesData0[ind] = val;
|
obj.type = "hour_s";
|
||||||
} else if (item.equip_name == "窑主电机") {
|
obj.year = year_h;
|
||||||
seriesData1[ind] = val;
|
obj.month = month_h;
|
||||||
} else if (item.equip_name == "篦冷机一室风机电机") {
|
obj.day = days_h;
|
||||||
seriesData2[ind] = val;
|
obj.hour = hours_h;
|
||||||
} else if (item.equip_name == "篦冷机二室风机电机") {
|
obj.mgroup__name = "回转窑";
|
||||||
seriesData3[ind] = val;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
} else if (item.equip_name == "篦冷机三室风机电机") {
|
obj.mpoint__need_display = 1;
|
||||||
seriesData4[ind] = val;
|
obj.page = 0;
|
||||||
} else if (item.equip_name == "窑头排风机主电机") {
|
this.$API.enm.mpoint.stat
|
||||||
seriesData5[ind] = val;
|
.req(obj)
|
||||||
} else if (
|
.then((res) => {
|
||||||
item.equip_name == "篦冷机一室充气梁风机(左)电机"
|
that.tableData = res;
|
||||||
) {
|
console.log("getTableHourData", res);
|
||||||
seriesData6[ind] = val;
|
res.forEach((item) => {
|
||||||
} else if (
|
let index = that.mpoints.indexOf(item.mpoint_nickname);
|
||||||
item.equip_name == "篦冷机一室充气梁风机(右)电机"
|
let obj = [];
|
||||||
) {
|
obj[0] = item.mpoint_nickname;
|
||||||
seriesData7[ind] = val;
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[3] = item.elec_consume_unit;
|
||||||
|
obj[4] = 0;
|
||||||
|
obj[5] = 0;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index] = obj;
|
||||||
|
});
|
||||||
|
let yetTime = timeDate - 3600000 * 24;
|
||||||
|
let ystDate = new Date(yetTime);
|
||||||
|
let year_h = ystDate.getFullYear();
|
||||||
|
let month_h = ystDate.getMonth() + 1;
|
||||||
|
let days_h = ystDate.getDate();
|
||||||
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
|
let obj_d = {};
|
||||||
|
obj_d.type = "day_s";
|
||||||
|
obj_d.year_s = year_h;
|
||||||
|
obj_d.month_s = month_h;
|
||||||
|
obj_d.day_s = days_h;
|
||||||
|
obj_d.mgroup__name = "回转窑";
|
||||||
|
obj_d.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj_d.mpoint__need_display = 1;
|
||||||
|
obj_d.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj_d).then((res) => {
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item, index) => {
|
||||||
|
let index_d = that.mpoints.indexOf(
|
||||||
|
item.mpoint_nickname
|
||||||
|
);
|
||||||
|
if (that.tableDatas[index_d]) {
|
||||||
|
that.tableDatas[index_d][3] =
|
||||||
|
item.elec_consume_unit;
|
||||||
|
} else {
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[4] = item.elec_consume_unit;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index_d] = obj;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
let obj_m = {};
|
||||||
|
obj_m.type = "month_s";
|
||||||
|
obj_m.year_s = that.year;
|
||||||
|
obj_m.month_s = that.month;
|
||||||
|
obj_m.mgroup__name = "回转窑";
|
||||||
|
obj_m.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj_m.mpoint__need_display = 1;
|
||||||
|
obj_m.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj_m).then((res) => {
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item, index) => {
|
||||||
|
let index_m = that.mpoints.indexOf(
|
||||||
|
item.mpoint_nickname
|
||||||
|
);
|
||||||
|
if (that.tableDatas[index_m]) {
|
||||||
|
that.tableDatas[index_m][4] =
|
||||||
|
item.elec_consume_unit;
|
||||||
|
} else {
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[5] = item.elec_consume_unit;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index_m] = obj;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then(() => {});
|
||||||
|
},
|
||||||
|
//获取小时数据
|
||||||
|
getHourData(year, month, days) {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.type = "hour_s";
|
||||||
|
obj.year_s = year;
|
||||||
|
obj.month_s = month;
|
||||||
|
obj.day_s = days;
|
||||||
|
obj.mgroup__name = "回转窑";
|
||||||
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
|
let seriesData = [];
|
||||||
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
|
seriesData.push([]);
|
||||||
|
}
|
||||||
|
let data = response;
|
||||||
|
data.forEach((item) => {
|
||||||
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
|
let ind = item.hour; //xAxis
|
||||||
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
|
});
|
||||||
let options = { ...that.option1 };
|
let options = { ...that.option1 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
options.series[2].data = seriesData2;
|
chartItem.name = that.mpoints[j];
|
||||||
options.series[3].data = seriesData3;
|
chartItem.type = "bar";
|
||||||
options.series[4].data = seriesData4;
|
chartItem.data = seriesData[j];
|
||||||
options.series[5].data = seriesData4;
|
options.series.push(chartItem);
|
||||||
options.series[6].data = seriesData4;
|
}
|
||||||
options.series[7].data = seriesData4;
|
options.legend.data = that.mpoints;
|
||||||
let hourXAxis = [];
|
let hourXAxis = [];
|
||||||
for (let i = 0; i < 24; i++) {
|
for (let i = 0; i < 24; i++) {
|
||||||
let item = i + "时";
|
let item = i + "时";
|
||||||
|
|
@ -691,67 +673,40 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取天数据
|
//获取天数据
|
||||||
getDayData() {
|
getDayData(year, month) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query1 = {};
|
let obj = {};
|
||||||
query1.page = 0;
|
obj.type = "day_s";
|
||||||
query1.year_s = that.year;
|
obj.year_s = year;
|
||||||
query1.month_s = that.month;
|
obj.month_s = month;
|
||||||
query1.type = "day_s";
|
obj.mgroup__name = "回转窑";
|
||||||
query1.mgroup = this.query.mgroup;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
query1.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
this.$API.enm.enstat.req(query1).then((response) => {
|
obj.mpoint__need_display = 1;
|
||||||
let seriesData0 = [],
|
obj.page = 0;
|
||||||
seriesData1 = [],
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
seriesData2 = [],
|
let seriesData = [];
|
||||||
seriesData3 = [],
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
seriesData4 = [],
|
seriesData.push([]);
|
||||||
seriesData5 = [],
|
}
|
||||||
seriesData6 = [],
|
|
||||||
seriesData7 = [];
|
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
// debugger;
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
let ind = item.day_s;
|
let ind = item.day_s - 1;
|
||||||
let val = 0;
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
if (that.allValDays == 0) {
|
|
||||||
val = "";
|
|
||||||
} else {
|
|
||||||
val = (item.val / that.allValDays).toFixed(2);
|
|
||||||
}
|
|
||||||
if (item.equip_name == "高温风机") {
|
|
||||||
seriesData0[ind] = val;
|
|
||||||
} else if (item.equip_name == "窑主电机") {
|
|
||||||
seriesData1[ind] = val;
|
|
||||||
} else if (item.equip_name == "篦冷机一室风机电机") {
|
|
||||||
seriesData2[ind] = val;
|
|
||||||
} else if (item.equip_name == "篦冷机二室风机电机") {
|
|
||||||
seriesData3[ind] = val;
|
|
||||||
} else if (item.equip_name == "篦冷机三室风机电机") {
|
|
||||||
seriesData4[ind] = val;
|
|
||||||
} else if (item.equip_name == "窑头排风机主电机") {
|
|
||||||
seriesData5[ind] = val;
|
|
||||||
} else if (
|
|
||||||
item.equip_name == "篦冷机一室充气梁风机(左)电机"
|
|
||||||
) {
|
|
||||||
seriesData6[ind] = val;
|
|
||||||
} else if (
|
|
||||||
item.equip_name == "篦冷机一室充气梁风机(右)电机"
|
|
||||||
) {
|
|
||||||
seriesData7[ind] = val;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
let options = { ...that.option2 };
|
let options = { ...that.option2 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
options.series[2].data = seriesData2;
|
chartItem.name = that.mpoints[j];
|
||||||
options.series[3].data = seriesData3;
|
chartItem.type = "bar";
|
||||||
options.series[4].data = seriesData4;
|
chartItem.data = seriesData[j];
|
||||||
options.series[5].data = seriesData4;
|
options.series.push(chartItem);
|
||||||
options.series[6].data = seriesData4;
|
}
|
||||||
options.series[7].data = seriesData4;
|
options.legend.data = that.mpoints;
|
||||||
let dayXAxis = [];
|
let dayXAxis = [];
|
||||||
for (let i = 1; i <= that.days; i++) {
|
let dayss = new Date(year, month, 0).getDate();
|
||||||
|
for (let i = 1; i <= dayss; i++) {
|
||||||
let item = i + "日";
|
let item = i + "日";
|
||||||
dayXAxis.push(item);
|
dayXAxis.push(item);
|
||||||
}
|
}
|
||||||
|
|
@ -760,65 +715,38 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取月数据
|
//获取月数据
|
||||||
getMonthData() {
|
getMonthData(year) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query2 = {};
|
let obj = {};
|
||||||
query2.page = 0;
|
obj.type = "month_s";
|
||||||
query2.year_s = that.year;
|
obj.year_s = year;
|
||||||
query2.type = "month_s";
|
obj.mgroup__name = "回转窑";
|
||||||
query2.mgroup = that.query.mgroup;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
query2.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
this.$API.enm.enstat.req(query2).then((response) => {
|
obj.mpoint__need_display = 1;
|
||||||
let seriesData0 = [],
|
obj.page = 0;
|
||||||
seriesData1 = [],
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
seriesData2 = [],
|
let seriesData = [];
|
||||||
seriesData3 = [],
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
seriesData4 = [],
|
seriesData.push([]);
|
||||||
seriesData5 = [],
|
}
|
||||||
seriesData6 = [],
|
|
||||||
seriesData7 = [];
|
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
let ind = item.month_s;
|
let ind = item.month_s - 1;
|
||||||
let val = 0;
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
if (that.allValMonth == 0) {
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
val = "";
|
|
||||||
} else {
|
|
||||||
val = (item.val / that.allValMonth).toFixed(2);
|
|
||||||
}
|
|
||||||
if (item.equip_name == "高温风机") {
|
|
||||||
seriesData0[ind] = val;
|
|
||||||
} else if (item.equip_name == "窑主电机") {
|
|
||||||
seriesData1[ind] = val;
|
|
||||||
} else if (item.equip_name == "篦冷机一室风机电机") {
|
|
||||||
seriesData2[ind] = val;
|
|
||||||
} else if (item.equip_name == "篦冷机二室风机电机") {
|
|
||||||
seriesData3[ind] = val;
|
|
||||||
} else if (item.equip_name == "篦冷机三室风机电机") {
|
|
||||||
seriesData4[ind] = val;
|
|
||||||
} else if (item.equip_name == "窑头排风机主电机") {
|
|
||||||
seriesData5[ind] = val;
|
|
||||||
} else if (
|
|
||||||
item.equip_name == "篦冷机一室充气梁风机(左)电机"
|
|
||||||
) {
|
|
||||||
seriesData6[ind] = val;
|
|
||||||
} else if (
|
|
||||||
item.equip_name == "篦冷机一室充气梁风机(右)电机"
|
|
||||||
) {
|
|
||||||
seriesData7[ind] = val;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
let options = { ...that.option3 };
|
let options = { ...that.option3 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
options.series[2].data = seriesData2;
|
chartItem.name = that.mpoints[j];
|
||||||
options.series[3].data = seriesData3;
|
chartItem.type = "bar";
|
||||||
options.series[4].data = seriesData4;
|
chartItem.data = seriesData[j];
|
||||||
options.series[5].data = seriesData4;
|
options.series.push(chartItem);
|
||||||
options.series[6].data = seriesData4;
|
}
|
||||||
options.series[7].data = seriesData4;
|
options.legend.data = that.mpoints;
|
||||||
let monthXAxis = [];
|
let monthXAxis = [];
|
||||||
for (let i = 1; i <= that.month; i++) {
|
for (let i = 1; i < 13; i++) {
|
||||||
let item = i + "月";
|
let item = i + "月";
|
||||||
monthXAxis.push(item);
|
monthXAxis.push(item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,7 @@ export default {
|
||||||
["循环风机1906", "", "KW·h/t", "", "", ""],
|
["循环风机1906", "", "KW·h/t", "", "", ""],
|
||||||
["系统风机", "", "KW·h/t", "", "", ""],
|
["系统风机", "", "KW·h/t", "", "", ""],
|
||||||
],
|
],
|
||||||
|
tableData: [],
|
||||||
modelValue: true,
|
modelValue: true,
|
||||||
type: "hour_s",
|
type: "hour_s",
|
||||||
title: "水泥磨工段",
|
title: "水泥磨工段",
|
||||||
|
|
@ -258,6 +259,7 @@ export default {
|
||||||
allValHour: 0,
|
allValHour: 0,
|
||||||
allValDays: 0,
|
allValDays: 0,
|
||||||
allValMonth: 0,
|
allValMonth: 0,
|
||||||
|
mpoints: [],
|
||||||
option1: {
|
option1: {
|
||||||
color: colors,
|
color: colors,
|
||||||
tooltip: tooltip,
|
tooltip: tooltip,
|
||||||
|
|
@ -420,148 +422,39 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
//水泥磨
|
||||||
let that = this;
|
let that = this;
|
||||||
var myDate = new Date();
|
var myDate = new Date();
|
||||||
let year = myDate.getFullYear();
|
that.year = myDate.getFullYear();
|
||||||
let month = myDate.getMonth() + 1;
|
that.month = myDate.getMonth() + 1;
|
||||||
let days = myDate.getDate();
|
that.days = myDate.getDate();
|
||||||
let hours = myDate.getHours();
|
that.hours = myDate.getHours();
|
||||||
let timeDate = myDate.getTime();
|
that.getMpoints();
|
||||||
that.timeStamp = timeDate;
|
that.getTableHourData();
|
||||||
let dayTime = 24 * 60 * 60 * 1000;
|
that.getHourData(that.year, that.month, that.days);
|
||||||
//昨天的计算
|
that.getDayData(that.year, that.month);
|
||||||
let year_d = year,
|
that.getMonthData(that.year);
|
||||||
month_d = month,
|
|
||||||
days_d = days;
|
|
||||||
if (hours < 21) {
|
|
||||||
//21点前,查找昨日数据为前一天数据
|
|
||||||
let newDate = timeDate - dayTime;
|
|
||||||
let lastDate = new Date(newDate);
|
|
||||||
year_d = lastDate.getFullYear();
|
|
||||||
month_d = lastDate.getMonth() + 1;
|
|
||||||
days_d = lastDate.getDate();
|
|
||||||
}
|
|
||||||
//上一小时的计算
|
|
||||||
let hourTime = timeDate - 3600000;
|
|
||||||
let hourDate = new Date(hourTime);
|
|
||||||
let year_h = hourDate.getFullYear();
|
|
||||||
let month_h = hourDate.getMonth() + 1;
|
|
||||||
let days_h = hourDate.getDate();
|
|
||||||
let hours_h = hourDate.getHours();
|
|
||||||
this.$API.mtm.mgroup.list
|
|
||||||
.req({ page: 0, search: "水泥磨" })
|
|
||||||
.then((res) => {
|
|
||||||
console.log("水泥磨", res);
|
|
||||||
that.query.mgroup = res[0].id;
|
|
||||||
//本月
|
|
||||||
let params2 = {};
|
|
||||||
params2.page = 0;
|
|
||||||
params2.year_s = year;
|
|
||||||
params2.month_s = month;
|
|
||||||
params2.type = "month_s";
|
|
||||||
params2.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat
|
|
||||||
.req(params2)
|
|
||||||
.then((res2) => {
|
|
||||||
if (res2.length > 0) {
|
|
||||||
let allValMonth = (that.allValMonth =
|
|
||||||
res2[0].total_production); //当前条件下的总产量
|
|
||||||
params2.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(params2)
|
|
||||||
.then((res) => {
|
|
||||||
let data2 = res;
|
|
||||||
for (let i = 0; i < data2.length; i++) {
|
|
||||||
that.tableDatas[i] = [];
|
|
||||||
that.tableDatas[i][0] =
|
|
||||||
data2[i].ep_monitored_name;
|
|
||||||
that.tableDatas[i][1] =
|
|
||||||
data2[i].ep_monitored_number;
|
|
||||||
that.tableDatas[i][2] = "KW·h/t";
|
|
||||||
let val =
|
|
||||||
allValMonth == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data2[i].val /
|
|
||||||
allValMonth
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[i][5] = val;
|
|
||||||
that.tableDatas[i][6] = data2[i].mpoint;
|
|
||||||
}
|
|
||||||
debugger;
|
|
||||||
console.log(that.tableDatas);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then((res2) => {
|
|
||||||
//昨日
|
|
||||||
let params3 = {};
|
|
||||||
params3.page = 0;
|
|
||||||
params3.year_s = year_d;
|
|
||||||
params3.month_s = month_d;
|
|
||||||
params3.day_s = days_d;
|
|
||||||
params3.type = "day_s";
|
|
||||||
params3.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat.req(params3).then((res3) => {
|
|
||||||
if (res3.length > 0) {
|
|
||||||
let allValDays = (that.allValDays =
|
|
||||||
res3[0].total_production);
|
|
||||||
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(params3)
|
|
||||||
.then((res) => {
|
|
||||||
let data3 = res3;
|
|
||||||
for (let j = 0; j < data3.length; j++) {
|
|
||||||
let val =
|
|
||||||
allValDays == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data3[j].val /
|
|
||||||
allValDays
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[j][4] = val;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//上小时
|
|
||||||
let params4 = {};
|
|
||||||
params4.page = 0;
|
|
||||||
params4.year = year_h;
|
|
||||||
params4.month = month_h;
|
|
||||||
params4.day = days_h;
|
|
||||||
params4.hour = hours_h;
|
|
||||||
params4.type = "hour_s";
|
|
||||||
params4.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat.req(params4).then((res4) => {
|
|
||||||
if (res4.length > 0) {
|
|
||||||
let hourProduct = (that.allValHour =
|
|
||||||
res4[0].total_production);
|
|
||||||
params4.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(params4)
|
|
||||||
.then((res) => {
|
|
||||||
let data4 = res4;
|
|
||||||
for (let k = 0; k < data4.length; k++) {
|
|
||||||
let val =
|
|
||||||
hourProduct == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data4[k].val /
|
|
||||||
hourProduct
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[k][3] = val;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
that.getHourData();
|
|
||||||
that.getDayData();
|
|
||||||
that.getMonthData();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getMpoints() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.mgroup__name = "水泥磨";
|
||||||
|
obj.page = 0;
|
||||||
|
obj.enabled = 1;
|
||||||
|
obj.need_display = 1;
|
||||||
|
obj.ordering = "report_sortstr";
|
||||||
|
obj.material__code__in = "elec,elec_0";
|
||||||
|
this.$API.enm.mpoint.list.req(obj).then((res) => {
|
||||||
|
console.log("mpoints", res);
|
||||||
|
let arr = [];
|
||||||
|
res.forEach((item) => {
|
||||||
|
arr.push(item.nickname);
|
||||||
|
});
|
||||||
|
console.log("arr", arr);
|
||||||
|
that.mpoints = arr;
|
||||||
|
});
|
||||||
|
},
|
||||||
typeRadioChange() {
|
typeRadioChange() {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
|
|
@ -581,58 +474,152 @@ export default {
|
||||||
}
|
}
|
||||||
this.searchDate;
|
this.searchDate;
|
||||||
},
|
},
|
||||||
//获取小时数据
|
getTableHourData() {
|
||||||
getHourData() {
|
|
||||||
let that = this;
|
let that = this;
|
||||||
let query = {};
|
that.tableDatas = [];
|
||||||
query.page = 0;
|
let timeDate = new Date().getTime();
|
||||||
query.year_s = that.year;
|
let hourTime = timeDate - 3600000;
|
||||||
query.month_s = that.month;
|
let hourDate = new Date(hourTime);
|
||||||
query.day_s = that.days;
|
let year_h = hourDate.getFullYear();
|
||||||
query.type = "hour_s";
|
let month_h = hourDate.getMonth() + 1;
|
||||||
query.mgroup = that.query.mgroup;
|
let days_h = hourDate.getDate();
|
||||||
query.mpoint__ep_monitored__power_kw__gte = 100;
|
let hours_h = hourDate.getHours();
|
||||||
this.$API.enm.mpoint.stat.req(query).then((response) => {
|
let minutes = hourDate.getMinutes();
|
||||||
let seriesData0 = [],
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
seriesData1 = [],
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
seriesData2 = [],
|
if (hours_h > 5) {
|
||||||
seriesData3 = [],
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
seriesData4 = [],
|
|
||||||
seriesData5 = [],
|
|
||||||
seriesData6 = [];
|
|
||||||
let data = response;
|
|
||||||
data.forEach((item) => {
|
|
||||||
let ind = item.hour;
|
|
||||||
let val = 0;
|
|
||||||
if (that.allValHour == 0) {
|
|
||||||
val = "";
|
|
||||||
} else {
|
} else {
|
||||||
val = (item.val / that.allValHour).toFixed(2);
|
hours_h = hours_h - 1;
|
||||||
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
}
|
}
|
||||||
if (item.equip_name == "循环风机1906") {
|
let obj = {};
|
||||||
seriesData0[ind] = val;
|
obj.type = "hour_s";
|
||||||
} else if (item.equip_name == "系统风机") {
|
obj.year = year_h;
|
||||||
seriesData1[ind] = val;
|
obj.month = month_h;
|
||||||
} else if (item.equip_name == "水平涡流选粉机") {
|
obj.day = days_h;
|
||||||
seriesData2[ind] = val;
|
obj.hour = hours_h;
|
||||||
} else if (item.equip_name == "水泥磨主电机") {
|
obj.mgroup__name = "水泥磨";
|
||||||
seriesData3[ind] = val;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
} else if (item.equip_name == "辊压机动辊电机") {
|
obj.mpoint__need_display = 1;
|
||||||
seriesData4[ind] = val;
|
obj.page = 0;
|
||||||
} else if (item.equip_name == "辊压机定辊电机") {
|
this.$API.enm.mpoint.stat
|
||||||
seriesData5[ind] = val;
|
.req(obj)
|
||||||
} else if (item.equip_name == "新增磨尾风机") {
|
.then((res) => {
|
||||||
seriesData6[ind] = val;
|
that.tableData = res;
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item) => {
|
||||||
|
let index = that.mpoints.indexOf(item.mpoint_nickname);
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[3] = item.elec_consume_unit;
|
||||||
|
obj[4] = 0;
|
||||||
|
obj[5] = 0;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index] = obj;
|
||||||
|
});
|
||||||
|
let yetTime = timeDate - 3600000 * 24;
|
||||||
|
let ystDate = new Date(yetTime);
|
||||||
|
let year_h = ystDate.getFullYear();
|
||||||
|
let month_h = ystDate.getMonth() + 1;
|
||||||
|
let days_h = ystDate.getDate();
|
||||||
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
|
let obj_d = {};
|
||||||
|
obj_d.type = "day_s";
|
||||||
|
obj_d.year_s = year_h;
|
||||||
|
obj_d.month_s = month_h;
|
||||||
|
obj_d.day_s = days_h;
|
||||||
|
obj_d.mgroup__name = "水泥磨";
|
||||||
|
obj_d.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj_d.mpoint__need_display = 1;
|
||||||
|
obj_d.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj_d).then((res) => {
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item, index) => {
|
||||||
|
let index_d = that.mpoints.indexOf(
|
||||||
|
item.mpoint_nickname
|
||||||
|
);
|
||||||
|
if (that.tableDatas[index_d]) {
|
||||||
|
that.tableDatas[index_d][3] =
|
||||||
|
item.elec_consume_unit;
|
||||||
|
} else {
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[4] = item.elec_consume_unit;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index_d] = obj;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
let obj_m = {};
|
||||||
|
obj_m.type = "month_s";
|
||||||
|
obj_m.year_s = that.year;
|
||||||
|
obj_m.month_s = that.month;
|
||||||
|
obj_m.mgroup__name = "水泥磨";
|
||||||
|
obj_m.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj_m.mpoint__need_display = 1;
|
||||||
|
obj_m.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj_m).then((res) => {
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item, index) => {
|
||||||
|
let index_m = that.mpoints.indexOf(
|
||||||
|
item.mpoint_nickname
|
||||||
|
);
|
||||||
|
if (that.tableDatas[index_m]) {
|
||||||
|
that.tableDatas[index_m][4] =
|
||||||
|
item.elec_consume_unit;
|
||||||
|
} else {
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[5] = item.elec_consume_unit;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index_m] = obj;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then(() => {});
|
||||||
|
},
|
||||||
|
//获取小时数据
|
||||||
|
getHourData(year, month, days) {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.type = "hour_s";
|
||||||
|
obj.year_s = year;
|
||||||
|
obj.month_s = month;
|
||||||
|
obj.day_s = days;
|
||||||
|
obj.mgroup__name = "水泥磨";
|
||||||
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
|
let seriesData = [];
|
||||||
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
|
seriesData.push([]);
|
||||||
|
}
|
||||||
|
let data = response;
|
||||||
|
data.forEach((item) => {
|
||||||
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
|
let ind = item.hour; //xAxis
|
||||||
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
|
});
|
||||||
let options = { ...that.option1 };
|
let options = { ...that.option1 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
options.series[2].data = seriesData2;
|
chartItem.name = that.mpoints[j];
|
||||||
options.series[3].data = seriesData3;
|
chartItem.type = "bar";
|
||||||
options.series[4].data = seriesData4;
|
chartItem.data = seriesData[j];
|
||||||
options.series[5].data = seriesData4;
|
options.series.push(chartItem);
|
||||||
options.series[6].data = seriesData4;
|
}
|
||||||
|
options.legend.data = that.mpoints;
|
||||||
let hourXAxis = [];
|
let hourXAxis = [];
|
||||||
for (let i = 0; i < 24; i++) {
|
for (let i = 0; i < 24; i++) {
|
||||||
let item = i + "时";
|
let item = i + "时";
|
||||||
|
|
@ -643,59 +630,40 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取天数据
|
//获取天数据
|
||||||
getDayData() {
|
getDayData(year, month) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query1 = {};
|
let obj = {};
|
||||||
query1.page = 0;
|
obj.type = "day_s";
|
||||||
query1.year_s = that.year;
|
obj.year_s = year;
|
||||||
query1.month_s = that.month;
|
obj.month_s = month;
|
||||||
query1.type = "day_s";
|
obj.mgroup__name = "水泥磨";
|
||||||
query1.mgroup = this.query.mgroup;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
query1.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
this.$API.enm.enstat.req(query1).then((response) => {
|
obj.mpoint__need_display = 1;
|
||||||
let seriesData0 = [],
|
obj.page = 0;
|
||||||
seriesData1 = [],
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
seriesData2 = [],
|
let seriesData = [];
|
||||||
seriesData3 = [],
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
seriesData4 = [],
|
seriesData.push([]);
|
||||||
seriesData5 = [],
|
}
|
||||||
seriesData6 = [];
|
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
// debugger;
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
let ind = item.day_s;
|
let ind = item.day_s - 1;
|
||||||
let val = 0;
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
if (that.allValDays == 0) {
|
|
||||||
val = "";
|
|
||||||
} else {
|
|
||||||
val = (item.val / that.allValDays).toFixed(2);
|
|
||||||
}
|
|
||||||
if (item.equip_name == "循环风机1906") {
|
|
||||||
seriesData0[ind] = val;
|
|
||||||
} else if (item.equip_name == "系统风机") {
|
|
||||||
seriesData1[ind] = val;
|
|
||||||
} else if (item.equip_name == "水平涡流选粉机") {
|
|
||||||
seriesData2[ind] = val;
|
|
||||||
} else if (item.equip_name == "水泥磨主电机") {
|
|
||||||
seriesData3[ind] = val;
|
|
||||||
} else if (item.equip_name == "辊压机动辊电机") {
|
|
||||||
seriesData4[ind] = val;
|
|
||||||
} else if (item.equip_name == "辊压机定辊电机") {
|
|
||||||
seriesData5[ind] = val;
|
|
||||||
} else if (item.equip_name == "新增磨尾风机") {
|
|
||||||
seriesData6[ind] = val;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
let options = { ...that.option2 };
|
let options = { ...that.option2 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
options.series[2].data = seriesData2;
|
chartItem.name = that.mpoints[j];
|
||||||
options.series[3].data = seriesData3;
|
chartItem.type = "bar";
|
||||||
options.series[4].data = seriesData4;
|
chartItem.data = seriesData[j];
|
||||||
options.series[5].data = seriesData4;
|
options.series.push(chartItem);
|
||||||
options.series[6].data = seriesData4;
|
}
|
||||||
|
options.legend.data = that.mpoints;
|
||||||
let dayXAxis = [];
|
let dayXAxis = [];
|
||||||
for (let i = 1; i <= that.days; i++) {
|
let dayss = new Date(year, month, 0).getDate();
|
||||||
|
for (let i = 1; i <= dayss; i++) {
|
||||||
let item = i + "日";
|
let item = i + "日";
|
||||||
dayXAxis.push(item);
|
dayXAxis.push(item);
|
||||||
}
|
}
|
||||||
|
|
@ -704,57 +672,38 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取月数据
|
//获取月数据
|
||||||
getMonthData() {
|
getMonthData(year) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query2 = {};
|
let obj = {};
|
||||||
query2.page = 0;
|
obj.type = "month_s";
|
||||||
query2.year_s = that.year;
|
obj.year_s = year;
|
||||||
query2.type = "month_s";
|
obj.mgroup__name = "水泥磨";
|
||||||
query2.mgroup = that.query.mgroup;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
query2.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
this.$API.enm.enstat.req(query2).then((response) => {
|
obj.mpoint__need_display = 1;
|
||||||
let seriesData0 = [],
|
obj.page = 0;
|
||||||
seriesData1 = [],
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
seriesData2 = [],
|
let seriesData = [];
|
||||||
seriesData3 = [],
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
seriesData4 = [],
|
seriesData.push([]);
|
||||||
seriesData5 = [],
|
}
|
||||||
seriesData6 = [];
|
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
let ind = item.month_s;
|
let ind = item.month_s - 1;
|
||||||
let val = 0;
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
if (that.allValMonth == 0) {
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
val = "";
|
|
||||||
} else {
|
|
||||||
val = (item.val / that.allValMonth).toFixed(2);
|
|
||||||
}
|
|
||||||
if (item.equip_name == "循环风机1906") {
|
|
||||||
seriesData0[ind] = val;
|
|
||||||
} else if (item.equip_name == "系统风机") {
|
|
||||||
seriesData1[ind] = val;
|
|
||||||
} else if (item.equip_name == "水平涡流选粉机") {
|
|
||||||
seriesData2[ind] = val;
|
|
||||||
} else if (item.equip_name == "水泥磨主电机") {
|
|
||||||
seriesData3[ind] = val;
|
|
||||||
} else if (item.equip_name == "辊压机动辊电机") {
|
|
||||||
seriesData4[ind] = val;
|
|
||||||
} else if (item.equip_name == "辊压机定辊电机") {
|
|
||||||
seriesData5[ind] = val;
|
|
||||||
} else if (item.equip_name == "新增磨尾风机") {
|
|
||||||
seriesData6[ind] = val;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
let options = { ...that.option3 };
|
let options = { ...that.option3 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
options.series[2].data = seriesData2;
|
chartItem.name = that.mpoints[j];
|
||||||
options.series[3].data = seriesData3;
|
chartItem.type = "bar";
|
||||||
options.series[4].data = seriesData4;
|
chartItem.data = seriesData[j];
|
||||||
options.series[5].data = seriesData4;
|
options.series.push(chartItem);
|
||||||
options.series[6].data = seriesData4;
|
}
|
||||||
|
options.legend.data = that.mpoints;
|
||||||
let monthXAxis = [];
|
let monthXAxis = [];
|
||||||
for (let i = 1; i <= that.month; i++) {
|
for (let i = 1; i < 13; i++) {
|
||||||
let item = i + "月";
|
let item = i + "月";
|
||||||
monthXAxis.push(item);
|
monthXAxis.push(item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,7 @@ export default {
|
||||||
// ['废气风机','','KW·h/t','','',''],
|
// ['废气风机','','KW·h/t','','',''],
|
||||||
// ['尾排风机','','KW·h/t','','',''],
|
// ['尾排风机','','KW·h/t','','',''],
|
||||||
],
|
],
|
||||||
|
tableData: [],
|
||||||
modelValue: true,
|
modelValue: true,
|
||||||
type: "hour_s",
|
type: "hour_s",
|
||||||
title: "原料磨工段",
|
title: "原料磨工段",
|
||||||
|
|
@ -395,148 +395,43 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
mpoints: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
// 原料磨
|
||||||
let that = this;
|
let that = this;
|
||||||
var myDate = new Date();
|
var myDate = new Date();
|
||||||
let year = (that.year = myDate.getFullYear());
|
that.year = myDate.getFullYear();
|
||||||
let month = (that.month = myDate.getMonth() + 1);
|
that.month = myDate.getMonth() + 1;
|
||||||
let days = (that.days = myDate.getDate());
|
that.days = myDate.getDate();
|
||||||
let hours = (that.hours = myDate.getHours());
|
that.hours = myDate.getHours();
|
||||||
let timeDate = myDate.getTime();
|
that.getMpoints();
|
||||||
let dayTime = 24 * 60 * 60 * 1000;
|
that.getTableHourData();
|
||||||
//昨天的计算
|
that.getHourData(that.year, that.month, that.days);
|
||||||
let year_d = year,
|
that.getDayData(that.year, that.month);
|
||||||
month_d = month,
|
that.getMonthData(that.year);
|
||||||
days_d = days;
|
|
||||||
if (hours < 21) {
|
|
||||||
//21点前,查找昨日数据为前一天数据
|
|
||||||
let newDate = timeDate - dayTime;
|
|
||||||
let lastDate = new Date(newDate);
|
|
||||||
year_d = lastDate.getFullYear();
|
|
||||||
month_d = lastDate.getMonth() + 1;
|
|
||||||
days_d = lastDate.getDate();
|
|
||||||
}
|
|
||||||
//上一小时的计算
|
|
||||||
let hourTime = timeDate - 3600000;
|
|
||||||
let hourDate = new Date(hourTime);
|
|
||||||
let year_h = hourDate.getFullYear();
|
|
||||||
let month_h = hourDate.getMonth() + 1;
|
|
||||||
let days_h = hourDate.getDate();
|
|
||||||
let hours_h = hourDate.getHours();
|
|
||||||
this.$API.mtm.mgroup.list
|
|
||||||
.req({ page: 0, search: "原料磨" })
|
|
||||||
.then((res) => {
|
|
||||||
console.log("原料磨", res);
|
|
||||||
that.query.mgroup = res[0].id;
|
|
||||||
//本月
|
|
||||||
let params2 = {};
|
|
||||||
params2.page = 0;
|
|
||||||
params2.year_s = year;
|
|
||||||
params2.month_s = month;
|
|
||||||
params2.type = "month_s";
|
|
||||||
params2.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat
|
|
||||||
.req(params2)
|
|
||||||
.then((res2) => {
|
|
||||||
if (res2.length > 0) {
|
|
||||||
let hourProduct = (that.allValMonth =
|
|
||||||
res2[0].total_production); //当前条件下的总产量
|
|
||||||
params2.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(params2)
|
|
||||||
.then((res) => {
|
|
||||||
let data2 = res;
|
|
||||||
for (let i = 0; i < data2.length; i++) {
|
|
||||||
that.tableDatas[i] = [];
|
|
||||||
that.tableDatas[i][0] =
|
|
||||||
data2[i].ep_monitored_name;
|
|
||||||
that.tableDatas[i][1] =
|
|
||||||
data2[i].ep_monitored_number;
|
|
||||||
that.tableDatas[i][2] = "KW·h/t";
|
|
||||||
let val =
|
|
||||||
hourProduct == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data2[i].val /
|
|
||||||
hourProduct
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[i][5] = val;
|
|
||||||
that.tableDatas[i][6] = data2[i].mpoint;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then((res2) => {
|
|
||||||
//昨日
|
|
||||||
let params3 = {};
|
|
||||||
params3.page = 0;
|
|
||||||
params3.year_s = year_d;
|
|
||||||
params3.month_s = month_d;
|
|
||||||
params3.day_s = days_d;
|
|
||||||
params3.type = "day_s";
|
|
||||||
params3.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat.req(params3).then((res3) => {
|
|
||||||
if (res3.length > 0) {
|
|
||||||
let hourProduct = (that.allValDays =
|
|
||||||
res3[0].total_production);
|
|
||||||
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(params3)
|
|
||||||
.then((res) => {
|
|
||||||
let data3 = res3;
|
|
||||||
for (let j = 0; j < data3.length; j++) {
|
|
||||||
let val =
|
|
||||||
hourProduct == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data3[j].val /
|
|
||||||
hourProduct
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[j][4] = val;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//上小时
|
|
||||||
let params4 = {};
|
|
||||||
params4.page = 0;
|
|
||||||
params4.year_s = year_h;
|
|
||||||
params4.month_s = month_h;
|
|
||||||
params4.day_s = days_h;
|
|
||||||
params4.hour_s = hours_h;
|
|
||||||
params4.type = "hour_s";
|
|
||||||
params4.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat.req(params4).then((res4) => {
|
|
||||||
if (res4.length > 0) {
|
|
||||||
let hourProduct = (that.allValHour =
|
|
||||||
res4[0].total_production);
|
|
||||||
params4.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(params4)
|
|
||||||
.then((res) => {
|
|
||||||
let data4 = res4;
|
|
||||||
for (let k = 0; k < data4.length; k++) {
|
|
||||||
let val =
|
|
||||||
hourProduct == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data4[k].val /
|
|
||||||
hourProduct
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[k][3] = val;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
that.getHourData();
|
|
||||||
that.getDayData();
|
|
||||||
that.getMonthData();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getMpoints() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.mgroup__name = "原料磨";
|
||||||
|
obj.page = 0;
|
||||||
|
obj.enabled = 1;
|
||||||
|
obj.need_display = 1;
|
||||||
|
obj.ordering = "report_sortstr";
|
||||||
|
obj.material__code__in = "elec,elec_0";
|
||||||
|
this.$API.enm.mpoint.list.req(obj).then((res) => {
|
||||||
|
console.log("mpoints", res);
|
||||||
|
let arr = [];
|
||||||
|
res.forEach((item) => {
|
||||||
|
arr.push(item.nickname);
|
||||||
|
});
|
||||||
|
console.log("arr", arr);
|
||||||
|
that.mpoints = arr;
|
||||||
|
});
|
||||||
|
},
|
||||||
typeRadioChange() {
|
typeRadioChange() {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
|
|
@ -554,51 +449,154 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.getMonthData(val);
|
this.getMonthData(val);
|
||||||
}
|
}
|
||||||
|
this.searchDate;
|
||||||
},
|
},
|
||||||
//获取小时数据
|
getTableHourData() {
|
||||||
getHourData() {
|
|
||||||
let that = this;
|
let that = this;
|
||||||
let query = {};
|
that.tableDatas = [];
|
||||||
query.page = 0;
|
let timeDate = new Date().getTime();
|
||||||
query.year_s = that.year;
|
let hourTime = timeDate - 3600000;
|
||||||
query.month_s = that.month;
|
let hourDate = new Date(hourTime);
|
||||||
query.day_s = that.days;
|
let year_h = hourDate.getFullYear();
|
||||||
query.type = "hour_s";
|
let month_h = hourDate.getMonth() + 1;
|
||||||
query.mgroup = that.query.mgroup;
|
let days_h = hourDate.getDate();
|
||||||
query.mpoint__ep_monitored__power_kw__gte = 100;
|
let hours_h = hourDate.getHours();
|
||||||
this.$API.enm.mpoint.stat.req(query).then((response) => {
|
let minutes = hourDate.getMinutes();
|
||||||
let seriesData0 = [],
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
seriesData1 = [],
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
seriesData2 = [],
|
if (hours_h > 5) {
|
||||||
seriesData3 = [],
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
seriesData4 = [];
|
|
||||||
let data = response;
|
|
||||||
data.forEach((item) => {
|
|
||||||
let ind = item.hour;
|
|
||||||
let val = 0;
|
|
||||||
if (that.allValHour == 0) {
|
|
||||||
val = "";
|
|
||||||
} else {
|
} else {
|
||||||
val = (item.val / that.allValHour).toFixed(2);
|
hours_h = hours_h - 1;
|
||||||
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
}
|
}
|
||||||
if (item.equip_name == "立磨主电机") {
|
let obj = {};
|
||||||
seriesData0[ind] = val;
|
obj.type = "hour_s";
|
||||||
} else if (item.equip_name == "循环风机") {
|
obj.year = year_h;
|
||||||
seriesData1[ind] = val;
|
obj.month = month_h;
|
||||||
} else if (item.equip_name == "烘干破主") {
|
obj.day = days_h;
|
||||||
seriesData2[ind] = val;
|
obj.hour = hours_h;
|
||||||
} else if (item.equip_name == "废气风机") {
|
obj.mgroup__name = "原料磨";
|
||||||
seriesData3[ind] = val;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
} else if (item.equip_name == "尾排风机") {
|
obj.mpoint__need_display = 1;
|
||||||
seriesData4[ind] = val;
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat
|
||||||
|
.req(obj)
|
||||||
|
.then((res) => {
|
||||||
|
that.tableData = res;
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item) => {
|
||||||
|
let index = that.mpoints.indexOf(item.mpoint_nickname);
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[3] = item.elec_consume_unit;
|
||||||
|
obj[4] = 0;
|
||||||
|
obj[5] = 0;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index] = obj;
|
||||||
|
});
|
||||||
|
let yetTime = timeDate - 3600000 * 24;
|
||||||
|
let ystDate = new Date(yetTime);
|
||||||
|
let year_h = ystDate.getFullYear();
|
||||||
|
let month_h = ystDate.getMonth() + 1;
|
||||||
|
let days_h = ystDate.getDate();
|
||||||
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
|
let obj_d = {};
|
||||||
|
obj_d.type = "day_s";
|
||||||
|
obj_d.year_s = year_h;
|
||||||
|
obj_d.month_s = month_h;
|
||||||
|
obj_d.day_s = days_h;
|
||||||
|
obj_d.mgroup__name = "原料磨";
|
||||||
|
obj_d.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj_d.mpoint__need_display = 1;
|
||||||
|
obj_d.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj_d).then((res) => {
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item, index) => {
|
||||||
|
let index_d = that.mpoints.indexOf(
|
||||||
|
item.mpoint_nickname
|
||||||
|
);
|
||||||
|
if (that.tableDatas[index_d]) {
|
||||||
|
that.tableDatas[index_d][3] =
|
||||||
|
item.elec_consume_unit;
|
||||||
|
} else {
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[4] = item.elec_consume_unit;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index_d] = obj;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
let obj_m = {};
|
||||||
|
obj_m.type = "month_s";
|
||||||
|
obj_m.year_s = that.year;
|
||||||
|
obj_m.month_s = that.month;
|
||||||
|
obj_m.mgroup__name = "原料磨";
|
||||||
|
obj_m.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj_m.mpoint__need_display = 1;
|
||||||
|
obj_m.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj_m).then((res) => {
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item, index) => {
|
||||||
|
let index_m = that.mpoints.indexOf(
|
||||||
|
item.mpoint_nickname
|
||||||
|
);
|
||||||
|
if (that.tableDatas[index_m]) {
|
||||||
|
that.tableDatas[index_m][4] =
|
||||||
|
item.elec_consume_unit;
|
||||||
|
} else {
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[5] = item.elec_consume_unit;
|
||||||
|
obj[6] = item.mpoint;
|
||||||
|
that.tableDatas[index_m] = obj;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then(() => {});
|
||||||
|
},
|
||||||
|
//获取小时数据
|
||||||
|
getHourData(year, month, days) {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.type = "hour_s";
|
||||||
|
obj.year_s = year;
|
||||||
|
obj.month_s = month;
|
||||||
|
obj.day_s = days;
|
||||||
|
obj.mgroup__name = "原料磨";
|
||||||
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
|
let seriesData = [];
|
||||||
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
|
seriesData.push([]);
|
||||||
|
}
|
||||||
|
let data = response;
|
||||||
|
data.forEach((item) => {
|
||||||
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
|
let ind = item.hour; //xAxis
|
||||||
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
|
});
|
||||||
let options = { ...that.option1 };
|
let options = { ...that.option1 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
options.series[2].data = seriesData2;
|
chartItem.name = that.mpoints[j];
|
||||||
options.series[3].data = seriesData3;
|
chartItem.type = "bar";
|
||||||
options.series[4].data = seriesData4;
|
chartItem.data = seriesData[j];
|
||||||
|
options.series.push(chartItem);
|
||||||
|
}
|
||||||
|
options.legend.data = that.mpoints;
|
||||||
let hourXAxis = [];
|
let hourXAxis = [];
|
||||||
for (let i = 0; i < 24; i++) {
|
for (let i = 0; i < 24; i++) {
|
||||||
let item = i + "时";
|
let item = i + "时";
|
||||||
|
|
@ -609,50 +607,40 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取天数据
|
//获取天数据
|
||||||
getDayData() {
|
getDayData(year, month) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query1 = {};
|
let obj = {};
|
||||||
query1.page = 0;
|
obj.type = "day_s";
|
||||||
query1.year_s = that.year;
|
obj.year_s = year;
|
||||||
query1.month_s = that.month;
|
obj.month_s = month;
|
||||||
query1.type = "day_s";
|
obj.mgroup__name = "原料磨";
|
||||||
query1.mgroup = this.query.mgroup;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
query1.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
this.$API.enm.enstat.req(query1).then((response) => {
|
obj.mpoint__need_display = 1;
|
||||||
let seriesData0 = [],
|
obj.page = 0;
|
||||||
seriesData1 = [],
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
seriesData2 = [],
|
let seriesData = [];
|
||||||
seriesData3 = [],
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
seriesData4 = [];
|
seriesData.push([]);
|
||||||
|
}
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
let ind = item.day_s;
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
let val = 0;
|
let ind = item.day_s - 1;
|
||||||
if (that.allValDays == 0) {
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
val = "";
|
|
||||||
} else {
|
|
||||||
val = (item.val / that.allValDays).toFixed(2);
|
|
||||||
}
|
|
||||||
if (item.equip_name == "立磨主电机") {
|
|
||||||
seriesData0[ind] = val;
|
|
||||||
} else if (item.equip_name == "循环风机") {
|
|
||||||
seriesData1[ind] = val;
|
|
||||||
} else if (item.equip_name == "烘干破主") {
|
|
||||||
seriesData2[ind] = val;
|
|
||||||
} else if (item.equip_name == "废气风机") {
|
|
||||||
seriesData3[ind] = val;
|
|
||||||
} else if (item.equip_name == "尾排风机") {
|
|
||||||
seriesData4[ind] = val;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
let options = { ...that.option2 };
|
let options = { ...that.option2 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
options.series[2].data = seriesData2;
|
chartItem.name = that.mpoints[j];
|
||||||
options.series[3].data = seriesData3;
|
chartItem.type = "bar";
|
||||||
options.series[4].data = seriesData4;
|
chartItem.data = seriesData[j];
|
||||||
|
options.series.push(chartItem);
|
||||||
|
}
|
||||||
|
options.legend.data = that.mpoints;
|
||||||
let dayXAxis = [];
|
let dayXAxis = [];
|
||||||
for (let i = 1; i <= that.days; i++) {
|
let dayss = new Date(year, month, 0).getDate();
|
||||||
|
for (let i = 1; i <= dayss; i++) {
|
||||||
let item = i + "日";
|
let item = i + "日";
|
||||||
dayXAxis.push(item);
|
dayXAxis.push(item);
|
||||||
}
|
}
|
||||||
|
|
@ -661,49 +649,38 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取月数据
|
//获取月数据
|
||||||
getMonthData() {
|
getMonthData(year) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query2 = {};
|
let obj = {};
|
||||||
query2.page = 0;
|
obj.type = "month_s";
|
||||||
query2.year_s = that.year;
|
obj.year_s = year;
|
||||||
query2.type = "month_s";
|
obj.mgroup__name = "原料磨";
|
||||||
query2.mgroup = that.query.mgroup;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
query2.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
this.$API.enm.enstat.req(query2).then((response) => {
|
obj.mpoint__need_display = 1;
|
||||||
let seriesData0 = [],
|
obj.page = 0;
|
||||||
seriesData1 = [],
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
seriesData2 = [],
|
let seriesData = [];
|
||||||
seriesData3 = [],
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
seriesData4 = [];
|
seriesData.push([]);
|
||||||
|
}
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
let ind = item.month_s;
|
let ind = item.month_s - 1;
|
||||||
let val = 0;
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
if (that.allValMonth == 0) {
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
val = "";
|
|
||||||
} else {
|
|
||||||
val = (item.val / that.allValMonth).toFixed(2);
|
|
||||||
}
|
|
||||||
if (item.equip_name == "立磨主电机") {
|
|
||||||
seriesData0[ind] = val;
|
|
||||||
} else if (item.equip_name == "循环风机") {
|
|
||||||
seriesData1[ind] = val;
|
|
||||||
} else if (item.equip_name == "烘干破主") {
|
|
||||||
seriesData2[ind] = val;
|
|
||||||
} else if (item.equip_name == "废气风机") {
|
|
||||||
seriesData3[ind] = val;
|
|
||||||
} else if (item.equip_name == "尾排风机") {
|
|
||||||
seriesData4[ind] = val;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
let options = { ...that.option3 };
|
let options = { ...that.option3 };
|
||||||
options.series[0].data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
options.series[1].data = seriesData1;
|
let chartItem = {};
|
||||||
options.series[2].data = seriesData2;
|
chartItem.name = that.mpoints[j];
|
||||||
options.series[3].data = seriesData3;
|
chartItem.type = "bar";
|
||||||
options.series[4].data = seriesData4;
|
chartItem.data = seriesData[j];
|
||||||
|
options.series.push(chartItem);
|
||||||
|
}
|
||||||
|
options.legend.data = that.mpoints;
|
||||||
let monthXAxis = [];
|
let monthXAxis = [];
|
||||||
for (let i = 1; i <= that.month; i++) {
|
for (let i = 1; i < 13; i++) {
|
||||||
let item = i + "月";
|
let item = i + "月";
|
||||||
monthXAxis.push(item);
|
monthXAxis.push(item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -189,18 +189,21 @@ export default {
|
||||||
exportLoading: false,
|
exportLoading: false,
|
||||||
chartShow: false,
|
chartShow: false,
|
||||||
myOption: null,
|
myOption: null,
|
||||||
|
timeStamp: null,
|
||||||
optionDay: {},
|
optionDay: {},
|
||||||
optionMonth: {},
|
optionMonth: {},
|
||||||
year: 2023,
|
year: 2023,
|
||||||
month: 1,
|
month: 1,
|
||||||
|
days: 1,
|
||||||
query: {
|
query: {
|
||||||
mgroup: "",
|
mgroup: "",
|
||||||
},
|
},
|
||||||
mpoint: "",
|
mpoint: "",
|
||||||
tableName: "主要设备(100KW以上)单位产品电耗数据表",
|
tableName: "主要设备(100KW以上)单位产品电耗数据表",
|
||||||
tableDatas: [["烘干破主电机", "", "kw.h/t", "", "", ""]],
|
tableDatas: [["烘干破主电机", "", "kw.h/t", "", "", ""]],
|
||||||
|
tableData: [],
|
||||||
modelValue: true,
|
modelValue: true,
|
||||||
type: "hour_s",
|
type: "day_s",
|
||||||
title: "电石渣工段",
|
title: "电石渣工段",
|
||||||
cate: "",
|
cate: "",
|
||||||
apiObj: this.$API.enm.mpoint.stat,
|
apiObj: this.$API.enm.mpoint.stat,
|
||||||
|
|
@ -209,7 +212,7 @@ export default {
|
||||||
asynDialog: false,
|
asynDialog: false,
|
||||||
allValDays: 0,
|
allValDays: 0,
|
||||||
allValMonth: 0,
|
allValMonth: 0,
|
||||||
option1: {
|
option2: {
|
||||||
color: colors,
|
color: colors,
|
||||||
tooltip: tooltip,
|
tooltip: tooltip,
|
||||||
grid: grid,
|
grid: grid,
|
||||||
|
|
@ -230,7 +233,7 @@ export default {
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
option2: {
|
option3: {
|
||||||
color: colors,
|
color: colors,
|
||||||
tooltip: tooltip,
|
tooltip: tooltip,
|
||||||
grid: grid,
|
grid: grid,
|
||||||
|
|
@ -264,156 +267,176 @@ export default {
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mpoints: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let that = this;
|
let that = this;
|
||||||
var myDate = new Date();
|
var myDate = new Date();
|
||||||
let year = myDate.getFullYear();
|
that.year = myDate.getFullYear();
|
||||||
let month = myDate.getMonth() + 1;
|
that.month = myDate.getMonth() + 1;
|
||||||
let days = myDate.getDate();
|
that.days = myDate.getDate();
|
||||||
let hours = myDate.getHours();
|
that.getMpoints();
|
||||||
let timeDate = myDate.getTime();
|
that.getTableHourData();
|
||||||
this.timeStamp = timeDate;
|
that.getDayData(that.year, that.month);
|
||||||
this.year = year;
|
that.getMonthData(that.year);
|
||||||
this.month = month;
|
let obj = {};
|
||||||
this.days = days;
|
obj.mgroup__name = "电石渣";
|
||||||
|
obj.page = 0;
|
||||||
let dayTime = 24 * 60 * 60 * 1000;
|
obj.enabled = 1;
|
||||||
//昨天的计算
|
obj.need_display = 1;
|
||||||
let year_d = year,
|
obj.ordering = "report_sortstr";
|
||||||
month_d = month,
|
obj.material__code__in = "elec,elec_0";
|
||||||
days_d = days;
|
this.$API.enm.mpoint.list.req(obj).then((res) => {
|
||||||
if (hours < 21) {
|
console.log("mpoints", res);
|
||||||
//21点前,查找昨日数据为前一天数据
|
let arr = [];
|
||||||
let newDate = timeDate - dayTime;
|
res.forEach((item) => {
|
||||||
let lastDate = new Date(newDate);
|
arr.push(item.nickname);
|
||||||
year_d = lastDate.getFullYear();
|
|
||||||
month_d = lastDate.getMonth() + 1;
|
|
||||||
days_d = lastDate.getDate();
|
|
||||||
}
|
|
||||||
this.$API.mtm.mgroup.list
|
|
||||||
.req({ page: 0, search: "电石渣" })
|
|
||||||
.then((res) => {
|
|
||||||
console.log("电石渣", res);
|
|
||||||
that.query.mgroup = res[0].id;
|
|
||||||
//本月
|
|
||||||
let params2 = {};
|
|
||||||
params2.page = 0;
|
|
||||||
params2.year_s = year;
|
|
||||||
params2.month_s = month;
|
|
||||||
params2.type = "month_s";
|
|
||||||
params2.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat
|
|
||||||
.req(params2)
|
|
||||||
.then((res2) => {
|
|
||||||
if (res2.length > 0) {
|
|
||||||
let allValMonth = (that.allValMonth =
|
|
||||||
res2[0].total_production); //当前条件下的总产量
|
|
||||||
params2.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(params2)
|
|
||||||
.then((res) => {
|
|
||||||
let data2 = res;
|
|
||||||
for (let i = 0; i < data2.length; i++) {
|
|
||||||
that.tableDatas[i] = [];
|
|
||||||
that.tableDatas[i][0] =
|
|
||||||
data2[i].ep_monitored_name;
|
|
||||||
that.tableDatas[i][1] =
|
|
||||||
data2[i].ep_monitored_number;
|
|
||||||
that.tableDatas[i][2] = "KW·h/t";
|
|
||||||
let val =
|
|
||||||
allValMonth == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data2[i].val /
|
|
||||||
allValMonth
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[i][4] = val;
|
|
||||||
that.tableDatas[i][5] = data2[i].mpoint;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
console.log("arr", arr);
|
||||||
})
|
that.mpoints = arr;
|
||||||
.then((res2) => {
|
|
||||||
//昨日
|
|
||||||
let params3 = {};
|
|
||||||
params3.page = 0;
|
|
||||||
params3.year_s = year_d;
|
|
||||||
params3.month_s = month_d;
|
|
||||||
params3.day_s = days_d;
|
|
||||||
params3.type = "day_s";
|
|
||||||
params3.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat.req(params3).then((res3) => {
|
|
||||||
if (res3.length > 0) {
|
|
||||||
let allValDays = (that.allValDays =
|
|
||||||
res3[0].total_production);
|
|
||||||
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
|
||||||
this.$API.enm.mpoint.stat
|
|
||||||
.req(params3)
|
|
||||||
.then((res) => {
|
|
||||||
let data3 = res3;
|
|
||||||
for (let j = 0; j < data3.length; j++) {
|
|
||||||
let val =
|
|
||||||
allValDays == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data3[j].val /
|
|
||||||
allValDays
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[j][3] = val;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
that.getDayData();
|
|
||||||
that.getMonthData();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getMpoints() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.mgroup__name = "电石渣";
|
||||||
|
obj.page = 0;
|
||||||
|
obj.enabled = 1;
|
||||||
|
obj.need_display = 1;
|
||||||
|
obj.ordering = "report_sortstr";
|
||||||
|
obj.material__code__in = "elec,elec_0";
|
||||||
|
this.$API.enm.mpoint.list.req(obj).then((res) => {
|
||||||
|
console.log("mpoints", res);
|
||||||
|
let arr = [];
|
||||||
|
res.forEach((item) => {
|
||||||
|
arr.push(item.nickname);
|
||||||
|
});
|
||||||
|
console.log("arr", arr);
|
||||||
|
that.mpoints = arr;
|
||||||
|
});
|
||||||
|
},
|
||||||
typeRadioChange() {
|
typeRadioChange() {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "month") {
|
if (this.typeRadio == "day") {
|
||||||
|
let year = val.split("-")[0];
|
||||||
|
let month = val.split("-")[1];
|
||||||
|
let days = val.split("-")[2];
|
||||||
|
this.getHourData(year, month, days);
|
||||||
|
} else if (this.typeRadio == "month") {
|
||||||
let year = val.split("-")[0];
|
let year = val.split("-")[0];
|
||||||
let month = val.split("-")[1];
|
let month = val.split("-")[1];
|
||||||
this.getDayData(year, month);
|
this.getDayData(year, month);
|
||||||
} else {
|
} else {
|
||||||
this.getMonthData(val);
|
this.getMonthData(val);
|
||||||
}
|
}
|
||||||
|
this.searchDate;
|
||||||
},
|
},
|
||||||
//获取天数据
|
getTableHourData() {
|
||||||
getDayData() {
|
|
||||||
let that = this;
|
let that = this;
|
||||||
let query1 = {};
|
that.tableDatas = [];
|
||||||
query1.page = 0;
|
let timeDate = new Date().getTime();
|
||||||
query1.year_s = that.year;
|
let yetTime = timeDate - 3600000 * 24;
|
||||||
query1.month_s = that.month;
|
let ystDate = new Date(yetTime);
|
||||||
query1.type = "day_s";
|
let year_h = ystDate.getFullYear();
|
||||||
query1.mgroup = this.query.mgroup;
|
let month_h = ystDate.getMonth() + 1;
|
||||||
query1.mpoint__ep_monitored__power_kw__gte = 100;
|
let days_h = ystDate.getDate();
|
||||||
this.$API.enm.enstat.req(query1).then((response) => {
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
let seriesData0 = [];
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
let data = response;
|
let obj_d = {};
|
||||||
data.forEach((item) => {
|
obj_d.type = "day_s";
|
||||||
let ind = item.day_s;
|
obj_d.year_s = year_h;
|
||||||
let val = 0;
|
obj_d.month_s = month_h;
|
||||||
if (that.allValDays == 0) {
|
obj_d.day_s = days_h;
|
||||||
val = "";
|
obj_d.mgroup__name = "电石渣";
|
||||||
|
obj_d.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj_d.mpoint__need_display = 1;
|
||||||
|
obj_d.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj_d).then((res) => {
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item, index) => {
|
||||||
|
let index_d = that.mpoints.indexOf(item.mpoint_nickname);
|
||||||
|
if (that.tableDatas[index_d]) {
|
||||||
|
that.tableDatas[index_d][3] = item.elec_consume_unit;
|
||||||
} else {
|
} else {
|
||||||
val = (item.val / that.allValDays).toFixed(2);
|
let obj = [];
|
||||||
}
|
obj[0] = item.mpoint_nickname;
|
||||||
if (item.equip_name == "烘干破主电机") {
|
obj[1] = item.ep_monitored_number;
|
||||||
seriesData0[ind] = val;
|
obj[2] = "KW·h/t";
|
||||||
|
obj[3] = item.elec_consume_unit;
|
||||||
|
obj[5] = item.mpoint;
|
||||||
|
that.tableDatas[index_d] = obj;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option1 };
|
let obj_m = {};
|
||||||
options.series.data = seriesData0;
|
obj_m.type = "month_s";
|
||||||
|
obj_m.year_s = that.year;
|
||||||
|
obj_m.month_s = that.month;
|
||||||
|
obj_m.mgroup__name = "电石渣";
|
||||||
|
obj_m.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj_m.mpoint__need_display = 1;
|
||||||
|
obj_m.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj_m).then((res) => {
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item, index) => {
|
||||||
|
let index_m = that.mpoints.indexOf(
|
||||||
|
item.mpoint_nickname
|
||||||
|
);
|
||||||
|
if (that.tableDatas[index_m]) {
|
||||||
|
that.tableDatas[index_m][4] =
|
||||||
|
item.elec_consume_unit;
|
||||||
|
} else {
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.mpoint_nickname;
|
||||||
|
obj[1] = item.ep_monitored_number;
|
||||||
|
obj[2] = "KW·h/t";
|
||||||
|
obj[4] = item.elec_consume_unit;
|
||||||
|
obj[5] = item.mpoint;
|
||||||
|
that.tableDatas[index_m] = obj;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取天数据
|
||||||
|
getDayData(year, month) {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.type = "day_s";
|
||||||
|
obj.year_s = year;
|
||||||
|
obj.month_s = month;
|
||||||
|
obj.mgroup__name = "电石渣";
|
||||||
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
|
let seriesData = [];
|
||||||
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
|
seriesData.push([]);
|
||||||
|
}
|
||||||
|
let data = response;
|
||||||
|
data.forEach((item) => {
|
||||||
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
|
let ind = item.day_s - 1;
|
||||||
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
|
});
|
||||||
|
let options = { ...that.option2 };
|
||||||
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
|
let chartItem = {};
|
||||||
|
chartItem.name = that.mpoints[j];
|
||||||
|
chartItem.type = "bar";
|
||||||
|
chartItem.data = seriesData[j];
|
||||||
|
options.series.push(chartItem);
|
||||||
|
}
|
||||||
|
options.legend.data = that.mpoints;
|
||||||
let dayXAxis = [];
|
let dayXAxis = [];
|
||||||
for (let i = 1; i <= that.days; i++) {
|
let dayss = new Date(year, month, 0).getDate();
|
||||||
|
for (let i = 1; i <= dayss; i++) {
|
||||||
let item = i + "日";
|
let item = i + "日";
|
||||||
dayXAxis.push(item);
|
dayXAxis.push(item);
|
||||||
}
|
}
|
||||||
|
|
@ -422,31 +445,42 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取月数据
|
//获取月数据
|
||||||
getMonthData() {
|
getMonthData(year) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query2 = {};
|
let obj = {};
|
||||||
query2.page = 0;
|
obj.type = "month_s";
|
||||||
query2.year_s = that.year;
|
obj.year_s = year;
|
||||||
query2.type = "month_s";
|
obj.mgroup__name = "电石渣";
|
||||||
query2.mgroup = that.query.mgroup;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
query2.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
this.$API.enm.enstat.req(query2).then((response) => {
|
obj.mpoint__need_display = 1;
|
||||||
let seriesData0 = [];
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
|
let seriesData = [];
|
||||||
|
for (let i = 0; i < that.mpoints.length; i++) {
|
||||||
|
seriesData.push([]);
|
||||||
|
}
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
let ind = item.month_s;
|
let ind = item.month_s - 1;
|
||||||
let val = 0;
|
let index = that.mpoints.indexOf(item.mpoint_nickname); //第几个mpoint
|
||||||
if (that.allValMonth == 0) {
|
seriesData[index][ind] = item.elec_consume_unit;
|
||||||
val = "";
|
|
||||||
} else {
|
|
||||||
val = (item.val / that.allValMonth).toFixed(2);
|
|
||||||
}
|
|
||||||
if (item.equip_name == "烘干破主电机") {
|
|
||||||
seriesData0[ind] = val;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
let options = { ...that.option2 };
|
let options = { ...that.option3 };
|
||||||
options.series.data = seriesData0;
|
for (let j = 0; j < that.mpoints.length; j++) {
|
||||||
|
let chartItem = {};
|
||||||
|
chartItem.name = that.mpoints[j];
|
||||||
|
chartItem.type = "bar";
|
||||||
|
chartItem.data = seriesData[j];
|
||||||
|
options.series.push(chartItem);
|
||||||
|
}
|
||||||
|
options.legend.data = that.mpoints;
|
||||||
|
let monthXAxis = [];
|
||||||
|
for (let i = 1; i < 13; i++) {
|
||||||
|
let item = i + "月";
|
||||||
|
monthXAxis.push(item);
|
||||||
|
}
|
||||||
|
options.xAxis.data = monthXAxis;
|
||||||
that.optionMonth = options;
|
that.optionMonth = options;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue