fix:单位产品电耗数据更新
This commit is contained in:
parent
c55f516019
commit
85eb08dfb1
|
@ -24,13 +24,12 @@
|
||||||
>
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="6">
|
<th colspan="5">
|
||||||
煤磨工段主要设备(100KW以上)单位产品电耗数据表
|
煤磨工段主要设备(100KW以上)单位产品电耗数据表
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>设备名称</th>
|
<th>设备名称</th>
|
||||||
<th>设备编号</th>
|
|
||||||
<th>单位</th>
|
<th>单位</th>
|
||||||
<th>上个小时</th>
|
<th>上个小时</th>
|
||||||
<th>昨日</th>
|
<th>昨日</th>
|
||||||
|
@ -44,27 +43,27 @@
|
||||||
:key="item1"
|
:key="item1"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 0 || ind == 1 || ind == 2"
|
v-if="ind == 0 || ind == 1"
|
||||||
class="numCell"
|
class="numCell"
|
||||||
>
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 3"
|
v-if="ind == 2"
|
||||||
class="numCell hoursItem"
|
class="numCell hoursItem"
|
||||||
@click="itemClick('hour_s', item1)"
|
@click="itemClick('hour_s', item1)"
|
||||||
>
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 4"
|
v-if="ind == 3"
|
||||||
class="numCell monthItem"
|
class="numCell monthItem"
|
||||||
@click="itemClick('day_s', item1)"
|
@click="itemClick('day_s', item1)"
|
||||||
>
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 5"
|
v-if="ind == 4"
|
||||||
class="numCell yearItem"
|
class="numCell yearItem"
|
||||||
@click="itemClick('month_s', item1)"
|
@click="itemClick('month_s', item1)"
|
||||||
>
|
>
|
||||||
|
@ -307,142 +306,103 @@ 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.getTableHourData();
|
||||||
let dayTime = 24 * 60 * 60 * 1000;
|
that.getHourData();
|
||||||
//昨天的计算
|
that.getDayData();
|
||||||
let year_d = year,
|
that.getMonthData();
|
||||||
month_d = month,
|
},
|
||||||
days_d = days;
|
methods: {
|
||||||
if (hours < 21) {
|
getTableHourData() {
|
||||||
//21点前,查找昨日数据为前一天数据
|
let that = this;
|
||||||
let newDate = timeDate - dayTime;
|
that.tableDatas = [];
|
||||||
let lastDate = new Date(newDate);
|
let timeDate = new Date().getTime();
|
||||||
year_d = lastDate.getFullYear();
|
|
||||||
month_d = lastDate.getMonth() + 1;
|
|
||||||
days_d = lastDate.getDate();
|
|
||||||
}
|
|
||||||
//上一小时的计算
|
|
||||||
let hourTime = timeDate - 3600000;
|
let hourTime = timeDate - 3600000;
|
||||||
let hourDate = new Date(hourTime);
|
let hourDate = new Date(hourTime);
|
||||||
let year_h = hourDate.getFullYear();
|
let year_h = hourDate.getFullYear();
|
||||||
let month_h = hourDate.getMonth() + 1;
|
let month_h = hourDate.getMonth() + 1;
|
||||||
let days_h = hourDate.getDate();
|
let days_h = hourDate.getDate();
|
||||||
let hours_h = hourDate.getHours();
|
let hours_h = hourDate.getHours();
|
||||||
this.$API.mtm.mgroup.list
|
let minutes = hourDate.getMinutes();
|
||||||
.req({ page: 0, search: "煤磨" })
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
.then((res) => {
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
console.log("煤磨", res);
|
if (hours_h > 5) {
|
||||||
that.query.mgroup = res[0].id;
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
//本月
|
} else {
|
||||||
let params2 = {};
|
hours_h = hours_h - 1;
|
||||||
params2.page = 0;
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
let obj = {};
|
||||||
|
obj.type = "hour_s";
|
||||||
|
obj.year = year_h;
|
||||||
|
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__ep_monitored__isnull = 0;
|
||||||
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat
|
||||||
|
.req(obj)
|
||||||
|
.then((res) => {
|
||||||
|
console.log("getTableHourData", res);
|
||||||
|
res.forEach((item) => {
|
||||||
|
let obj = [];
|
||||||
|
obj[0] = item.ep_monitored_name;
|
||||||
|
obj[1] = "KW·h/t";
|
||||||
|
obj[2] = item.elec_consume_unit;
|
||||||
|
obj[3] = 0;
|
||||||
|
obj[4] = 0;
|
||||||
|
that.tableDatas.push(obj);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.then((res2) => {
|
.then(() => {
|
||||||
//昨日
|
let yetTime = timeDate - 3600000 * 24;
|
||||||
let params3 = {};
|
let ystDate = new Date(yetTime);
|
||||||
params3.page = 0;
|
let year_h = ystDate.getFullYear();
|
||||||
params3.year_s = year_d;
|
let month_h = ystDate.getMonth() + 1;
|
||||||
params3.month_s = month_d;
|
let days_h = ystDate.getDate();
|
||||||
params3.day_s = days_d;
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
params3.type = "day_s";
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
params3.mgroup = that.query.mgroup;
|
let obj = {};
|
||||||
that.$API.enm.enstat.req(params3).then((res3) => {
|
obj.type = "day_s";
|
||||||
if (res3.length > 0) {
|
obj.year_s = year_h;
|
||||||
let hourProduct = (that.allValDays =
|
obj.month_s = month_h;
|
||||||
res3[0].total_production);
|
obj.day_s = days_h;
|
||||||
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mgroup__name = "煤磨";
|
||||||
that.$API.enm.mpoint.stat
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
.req(params3)
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
.then((res) => {
|
obj.mpoint__need_display = 1;
|
||||||
let data3 = res3;
|
obj.page = 0;
|
||||||
for (let j = 0; j < data3.length; j++) {
|
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||||
let val =
|
console.log("getTableHourData", res);
|
||||||
hourProduct == 0
|
res.forEach((item, index) => {
|
||||||
? "/"
|
that.tableDatas[index][3] = item.elec_consume_unit;
|
||||||
: (
|
});
|
||||||
data3[j].val /
|
});
|
||||||
hourProduct
|
})
|
||||||
).toFixed(2);
|
.then(() => {
|
||||||
that.tableDatas[j][4] = val;
|
let obj = {};
|
||||||
}
|
obj.type = "month_s";
|
||||||
});
|
obj.year_s = that.year;
|
||||||
}
|
obj.month_s = that.month;
|
||||||
});
|
obj.mgroup__name = "煤磨";
|
||||||
//上小时
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
let params4 = {};
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
params4.page = 0;
|
obj.mpoint__need_display = 1;
|
||||||
params4.year = year_h;
|
obj.page = 0;
|
||||||
params4.month = month_h;
|
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||||
params4.day = days_h;
|
console.log("getTableHourData", res);
|
||||||
params4.hour = hours_h;
|
res.forEach((item, index) => {
|
||||||
params4.type = "hour_s";
|
that.tableDatas[index][4] = item.elec_consume_unit;
|
||||||
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: {
|
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
getHourData() {
|
getHourData() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -459,17 +419,11 @@ export default {
|
||||||
seriesData1 = [];
|
seriesData1 = [];
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
let ind = item.hour;
|
let ind = item.hour - 1;
|
||||||
let val = 0;
|
if (item.ep_monitored_name == "煤磨排风机主电机") {
|
||||||
if (that.allValHour == 0) {
|
seriesData0[ind] = item.elec_consume_unit;
|
||||||
val = "";
|
} else if (item.ep_monitored_name == "煤磨主电机") {
|
||||||
} else {
|
seriesData1[ind] = item.elec_consume_unit;
|
||||||
val = (item.val / that.allValHour).toFixed(2);
|
|
||||||
}
|
|
||||||
if (item.equip_name == "煤磨排风机主电机") {
|
|
||||||
seriesData0[ind] = val;
|
|
||||||
} else if (item.equip_name == "煤磨主电机") {
|
|
||||||
seriesData1[ind] = val;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option1 };
|
let options = { ...that.option1 };
|
||||||
|
@ -499,18 +453,11 @@ export default {
|
||||||
seriesData1 = [];
|
seriesData1 = [];
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
// debugger;
|
let ind = item.day_s - 1;
|
||||||
let ind = item.day_s;
|
if (item.ep_monitored_name == "煤磨排风机主电机") {
|
||||||
let val = 0;
|
seriesData0[ind] = item.elec_consume_unit;
|
||||||
if (that.allValDays == 0) {
|
} else if (item.ep_monitored_name == "煤磨主电机") {
|
||||||
val = "";
|
seriesData1[ind] = item.elec_consume_unit;
|
||||||
} 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 };
|
||||||
|
@ -539,17 +486,11 @@ export default {
|
||||||
seriesData1 = [];
|
seriesData1 = [];
|
||||||
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;
|
if (item.ep_monitored_name == "煤磨排风机主电机") {
|
||||||
if (that.allValMonth == 0) {
|
seriesData0[ind] = item.elec_consume_unit;
|
||||||
val = "";
|
} else if (item.ep_monitored_name == "煤磨主电机") {
|
||||||
} else {
|
seriesData1[ind] = item.elec_consume_unit;
|
||||||
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 };
|
||||||
|
|
|
@ -24,13 +24,12 @@
|
||||||
>
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="6">
|
<th colspan="5">
|
||||||
回转窑工段主要设备(100KW以上)单位产品电耗数据表
|
回转窑工段主要设备(100KW以上)单位产品电耗数据表
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>设备名称</th>
|
<th>设备名称</th>
|
||||||
<th>设备编号</th>
|
|
||||||
<th>单位</th>
|
<th>单位</th>
|
||||||
<th>上个小时</th>
|
<th>上个小时</th>
|
||||||
<th>昨日</th>
|
<th>昨日</th>
|
||||||
|
@ -44,27 +43,27 @@
|
||||||
:key="item1"
|
:key="item1"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 0 || ind == 1 || ind == 2"
|
v-if="ind == 0 || ind == 1"
|
||||||
class="numCell"
|
class="numCell"
|
||||||
>
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 3"
|
v-if="ind == 2"
|
||||||
class="numCell"
|
class="numCell"
|
||||||
@click="itemClick('hour_s', item)"
|
@click="itemClick('hour_s', item)"
|
||||||
>
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 4"
|
v-if="ind == 3"
|
||||||
class="numCell"
|
class="numCell"
|
||||||
@click="itemClick('day_s', item)"
|
@click="itemClick('day_s', item)"
|
||||||
>
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 5"
|
v-if="ind == 4"
|
||||||
class="numCell"
|
class="numCell"
|
||||||
@click="itemClick('month_s', item)"
|
@click="itemClick('month_s', item)"
|
||||||
>
|
>
|
||||||
|
@ -193,9 +192,9 @@ export default {
|
||||||
},
|
},
|
||||||
tableName: "主要设备(100KW以上)单位产品电耗数据表",
|
tableName: "主要设备(100KW以上)单位产品电耗数据表",
|
||||||
tableDatas: [
|
tableDatas: [
|
||||||
["尾排风机", "", "KW·h/t", "", "", ""],
|
["尾排风机", "KW·h/t", "", "", ""],
|
||||||
["高温风机", "", "KW·h/t", "", "", ""],
|
["高温风机", "KW·h/t", "", "", ""],
|
||||||
["头排风机", "", "KW·h/t", "", "", ""],
|
["头排风机", "KW·h/t", "", "", ""],
|
||||||
],
|
],
|
||||||
modelValue: true,
|
modelValue: true,
|
||||||
type: "hour_s",
|
type: "hour_s",
|
||||||
|
@ -340,184 +339,137 @@ 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.getTableHourData();
|
||||||
let dayTime = 24 * 60 * 60 * 1000;
|
that.getHourData();
|
||||||
//昨天的计算
|
that.getDayData();
|
||||||
let year_d = year,
|
that.getMonthData();
|
||||||
month_d = month,
|
},
|
||||||
days_d = days;
|
methods: {
|
||||||
if (hours < 21) {
|
getTableHourData() {
|
||||||
//21点前,查找昨日数据为前一天数据
|
let that = this;
|
||||||
let newDate = timeDate - dayTime;
|
that.tableDatas = [];
|
||||||
let lastDate = new Date(newDate);
|
let timeDate = new Date().getTime();
|
||||||
year_d = lastDate.getFullYear();
|
|
||||||
month_d = lastDate.getMonth() + 1;
|
|
||||||
days_d = lastDate.getDate();
|
|
||||||
}
|
|
||||||
//上一小时的计算
|
|
||||||
let hourTime = timeDate - 3600000;
|
let hourTime = timeDate - 3600000;
|
||||||
let hourDate = new Date(hourTime);
|
let hourDate = new Date(hourTime);
|
||||||
let year_h = hourDate.getFullYear();
|
let year_h = hourDate.getFullYear();
|
||||||
let month_h = hourDate.getMonth() + 1;
|
let month_h = hourDate.getMonth() + 1;
|
||||||
let days_h = hourDate.getDate();
|
let days_h = hourDate.getDate();
|
||||||
let hours_h = hourDate.getHours();
|
let hours_h = hourDate.getHours();
|
||||||
that.$API.mtm.mgroup.list
|
let minutes = hourDate.getMinutes();
|
||||||
.req({ page: 0, search: "回转窑" })
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
.then((res) => {
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
console.log("回转窑", res);
|
if (hours_h > 5) {
|
||||||
that.query.mgroup = res[0].id;
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
//本月
|
} else {
|
||||||
let params2 = {};
|
hours_h = hours_h - 1;
|
||||||
params2.page = 0;
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
params2.year_s = year;
|
}
|
||||||
params2.month_s = month;
|
let obj = {};
|
||||||
params2.type = "month_s";
|
obj.type = "hour_s";
|
||||||
params2.mgroup = this.query.mgroup;
|
obj.year = year_h;
|
||||||
this.$API.enm.enstat
|
obj.month = month_h;
|
||||||
.req(params2)
|
obj.day = days_h;
|
||||||
.then((res2) => {
|
obj.hour = hours_h;
|
||||||
if (res2.length > 0) {
|
obj.mgroup__name = "回转窑";
|
||||||
let allValMonth = (that.allValMonth =
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
res2[0].total_production); //当前条件下的总产量
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
params2.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.page = 0;
|
||||||
this.$API.enm.mpoint.stat
|
this.$API.enm.mpoint.stat
|
||||||
.req(params2)
|
.req(obj)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let data2 = res;
|
console.log("getTableHourData", res);
|
||||||
for (let i = 0; i < data2.length; i++) {
|
res.forEach((item) => {
|
||||||
that.tableDatas[i] = [];
|
let obj = [];
|
||||||
that.tableDatas[i][0] =
|
obj[0] = item.ep_monitored_name;
|
||||||
data2[i].ep_monitored_name;
|
obj[1] = "KW·h/t";
|
||||||
that.tableDatas[i][1] =
|
obj[2] = item.elec_consume_unit;
|
||||||
data2[i].ep_monitored_number;
|
obj[3] = 0;
|
||||||
that.tableDatas[i][2] = "KW·h/t";
|
obj[4] = 0;
|
||||||
let val =
|
that.tableDatas.push(obj);
|
||||||
allValMonth == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data2[i].val /
|
|
||||||
allValMonth
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[i][5] = val;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.then((res2) => {
|
.then(() => {
|
||||||
//昨日
|
let yetTime = timeDate - 3600000 * 24;
|
||||||
let params3 = {};
|
let ystDate = new Date(yetTime);
|
||||||
params3.page = 0;
|
let year_h = ystDate.getFullYear();
|
||||||
params3.year_s = year_d;
|
let month_h = ystDate.getMonth() + 1;
|
||||||
params3.month_s = month_d;
|
let days_h = ystDate.getDate();
|
||||||
params3.day_s = days_d;
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
params3.type = "day_s";
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
params3.mgroup = this.query.mgroup;
|
let obj = {};
|
||||||
this.$API.enm.enstat.req(params3).then((res3) => {
|
obj.type = "day_s";
|
||||||
if (res3.length > 0) {
|
obj.year_s = year_h;
|
||||||
let allValDays = (that.allValDays =
|
obj.month_s = month_h;
|
||||||
res3[0].total_production);
|
obj.day_s = days_h;
|
||||||
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mgroup__name = "回转窑";
|
||||||
this.$API.enm.mpoint.stat
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
.req(params3)
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
.then((res) => {
|
obj.mpoint__need_display = 1;
|
||||||
let data3 = res3;
|
obj.page = 0;
|
||||||
for (let j = 0; j < data3.length; j++) {
|
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||||
let val =
|
console.log("getTableHourData", res);
|
||||||
allValDays == 0
|
res.forEach((item, index) => {
|
||||||
? "/"
|
that.tableDatas[index][3] = item.elec_consume_unit;
|
||||||
: (
|
});
|
||||||
data3[j].val /
|
});
|
||||||
allValDays
|
})
|
||||||
).toFixed(2);
|
.then(() => {
|
||||||
that.tableDatas[j][4] = val;
|
let obj = {};
|
||||||
}
|
obj.type = "month_s";
|
||||||
});
|
obj.year_s = that.year;
|
||||||
}
|
obj.month_s = that.month;
|
||||||
});
|
obj.mgroup__name = "回转窑";
|
||||||
//上小时
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
let params4 = {};
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
params4.page = 0;
|
obj.mpoint__need_display = 1;
|
||||||
params4.year = year_h;
|
obj.page = 0;
|
||||||
params4.month = month_h;
|
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||||
params4.day = days_h;
|
console.log("getTableHourData", res);
|
||||||
params4.hour = hours_h;
|
res.forEach((item, index) => {
|
||||||
params4.type = "hour_s";
|
that.tableDatas[index][4] = item.elec_consume_unit;
|
||||||
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: {
|
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
getHourData() {
|
getHourData() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query = {};
|
let obj = {};
|
||||||
query.page = 0;
|
obj.type = "hour_s";
|
||||||
query.year_s = that.year;
|
obj.year_s = that.year;
|
||||||
query.month_s = that.month;
|
obj.month_s = that.month;
|
||||||
query.day_s = that.days;
|
obj.day_s = that.days;
|
||||||
query.type = "hour_s";
|
obj.mgroup__name = "回转窑";
|
||||||
query.mgroup = that.query.mgroup;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
query.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
this.$API.enm.mpoint.stat.req(query).then((response) => {
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
let seriesData0 = [],
|
let seriesData0 = [],
|
||||||
seriesData1 = [],
|
seriesData1 = [],
|
||||||
seriesData2 = [],
|
seriesData2 = [];
|
||||||
seriesData3 = [];
|
response.forEach((item) => {
|
||||||
let data = response;
|
console.log(item.ep_monitored_name);
|
||||||
data.forEach((item) => {
|
let ind = item.hour - 1;
|
||||||
let ind = item.hour;
|
if (item.ep_monitored_name == "尾排风机") {
|
||||||
let val = 0;
|
seriesData0[ind] = item.elec_consume_unit;
|
||||||
if (that.allValHour == 0) {
|
} else if (item.ep_monitored_name == "高温风机") {
|
||||||
val = "";
|
seriesData1[ind] = item.elec_consume_unit;
|
||||||
} else {
|
} else if (item.ep_monitored_name == "头排风机") {
|
||||||
val = (item.val / that.allValHour).toFixed(2);
|
seriesData2[ind] = item.elec_consume_unit;
|
||||||
}
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option1 };
|
let options = { ...that.option1 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData1;
|
||||||
options.series[2].data = seriesData2;
|
options.series[2].data = seriesData2;
|
||||||
options.series[3].data = seriesData3;
|
|
||||||
let hourXAxis = [];
|
let hourXAxis = [];
|
||||||
for (let i = 1; i <= that.hours; i++) {
|
for (let i = 1; i < that.hours + 1; i++) {
|
||||||
let item = i + "时";
|
let item = i + "时";
|
||||||
hourXAxis.push(item);
|
hourXAxis.push(item);
|
||||||
}
|
}
|
||||||
|
@ -528,43 +480,34 @@ export default {
|
||||||
//获取天数据
|
//获取天数据
|
||||||
getDayData() {
|
getDayData() {
|
||||||
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 = that.year;
|
||||||
query1.month_s = that.month;
|
obj.month_s = that.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;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
let seriesData0 = [],
|
let seriesData0 = [],
|
||||||
seriesData1 = [],
|
seriesData1 = [],
|
||||||
seriesData2 = [],
|
seriesData2 = [];
|
||||||
seriesData3 = [];
|
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
// debugger;
|
let ind = item.day_s - 1;
|
||||||
let ind = item.day_s;
|
if (item.ep_monitored_name == "尾排风机") {
|
||||||
let val = 0;
|
seriesData0[ind] = item.elec_consume_unit;
|
||||||
if (that.allValDays == 0) {
|
} else if (item.ep_monitored_name == "高温风机") {
|
||||||
val = "";
|
seriesData1[ind] = item.elec_consume_unit;
|
||||||
} else {
|
} else if (item.ep_monitored_name == "头排风机") {
|
||||||
val = (item.val / that.allValDays).toFixed(2);
|
seriesData2[ind] = item.elec_consume_unit;
|
||||||
}
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option2 };
|
let options = { ...that.option2 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData1;
|
||||||
options.series[2].data = seriesData2;
|
options.series[2].data = seriesData2;
|
||||||
options.series[3].data = seriesData3;
|
|
||||||
let dayXAxis = [];
|
let dayXAxis = [];
|
||||||
for (let i = 1; i <= that.days; i++) {
|
for (let i = 1; i <= that.days; i++) {
|
||||||
let item = i + "日";
|
let item = i + "日";
|
||||||
|
@ -577,41 +520,33 @@ export default {
|
||||||
//获取月数据
|
//获取月数据
|
||||||
getMonthData() {
|
getMonthData() {
|
||||||
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 = that.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;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
let seriesData0 = [],
|
let seriesData0 = [],
|
||||||
seriesData1 = [],
|
seriesData1 = [],
|
||||||
seriesData2 = [],
|
seriesData2 = [];
|
||||||
seriesData3 = [];
|
|
||||||
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;
|
if (item.ep_monitored_name == "尾排风机") {
|
||||||
if (that.allValMonth == 0) {
|
seriesData0[ind] = item.elec_consume_unit;
|
||||||
val = "";
|
} else if (item.ep_monitored_name == "高温风机") {
|
||||||
} else {
|
seriesData1[ind] = item.elec_consume_unit;
|
||||||
val = (item.val / that.allValMonth).toFixed(2);
|
} else if (item.ep_monitored_name == "头排风机") {
|
||||||
}
|
seriesData2[ind] = item.elec_consume_unit;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option3 };
|
let options = { ...that.option3 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData1;
|
||||||
options.series[2].data = seriesData2;
|
options.series[2].data = seriesData2;
|
||||||
options.series[3].data = seriesData3;
|
|
||||||
let monthXAxis = [];
|
let monthXAxis = [];
|
||||||
for (let i = 1; i <= that.month; i++) {
|
for (let i = 1; i <= that.month; i++) {
|
||||||
let item = i + "月";
|
let item = i + "月";
|
||||||
|
|
|
@ -24,13 +24,12 @@
|
||||||
>
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="6">
|
<th colspan="5">
|
||||||
原料磨工段主要设备(100KW以上)单位产品电耗数据表
|
原料磨工段主要设备(100KW以上)单位产品电耗数据表
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>设备名称</th>
|
<th>设备名称</th>
|
||||||
<th>设备编号</th>
|
|
||||||
<th>单位</th>
|
<th>单位</th>
|
||||||
<th>上个小时</th>
|
<th>上个小时</th>
|
||||||
<th>昨日</th>
|
<th>昨日</th>
|
||||||
|
@ -44,27 +43,27 @@
|
||||||
:key="item1"
|
:key="item1"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 0 || ind == 1 || ind == 2"
|
v-if="ind == 0 || ind == 1"
|
||||||
class="numCell"
|
class="numCell"
|
||||||
>
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 3"
|
v-if="ind == 2"
|
||||||
class="numCell"
|
class="numCell"
|
||||||
@click="itemClick('hour_s', item)"
|
@click="itemClick('hour_s', item)"
|
||||||
>
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 4"
|
v-if="ind == 3"
|
||||||
class="numCell"
|
class="numCell"
|
||||||
@click="itemClick('day_s', item)"
|
@click="itemClick('day_s', item)"
|
||||||
>
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
v-if="ind == 5"
|
v-if="ind == 4"
|
||||||
class="numCell"
|
class="numCell"
|
||||||
@click="itemClick('month_s', item)"
|
@click="itemClick('month_s', item)"
|
||||||
>
|
>
|
||||||
|
@ -141,7 +140,7 @@ let toolbox = {
|
||||||
};
|
};
|
||||||
let legend = {
|
let legend = {
|
||||||
top: "2%",
|
top: "2%",
|
||||||
data: ["辊压机", "循环风机", "调配变压器", "低压变压器柜器"],
|
data: ["辊压机", "循环风机"],
|
||||||
};
|
};
|
||||||
let yAxis = {
|
let yAxis = {
|
||||||
type: "value",
|
type: "value",
|
||||||
|
@ -175,17 +174,17 @@ export default {
|
||||||
optionHour: {},
|
optionHour: {},
|
||||||
optionDay: {},
|
optionDay: {},
|
||||||
optionMonth: {},
|
optionMonth: {},
|
||||||
year: 2023,
|
year: 2024,
|
||||||
month: 1,
|
month: 5,
|
||||||
days: 1,
|
days: 13,
|
||||||
hours: 1,
|
hours: 1,
|
||||||
query: {
|
query: {
|
||||||
mgroup: "",
|
mgroup: "",
|
||||||
},
|
},
|
||||||
tableName: "主要设备(100KW以上)单位产品电耗数据表",
|
tableName: "主要设备(100KW以上)单位产品电耗数据表",
|
||||||
tableDatas: [
|
tableDatas: [
|
||||||
["辊压机", "", "KW·h/t", "", "", ""],
|
// ["辊压机", "KW·h/t", "", "", ""],
|
||||||
["循环风机", "", "KW·h/t", "", "", ""],
|
// ["循环风机", "KW·h/t", "", "", ""],
|
||||||
],
|
],
|
||||||
modelValue: true,
|
modelValue: true,
|
||||||
type: "hour_s",
|
type: "hour_s",
|
||||||
|
@ -224,16 +223,6 @@ export default {
|
||||||
type: "bar",
|
type: "bar",
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "调配变压器",
|
|
||||||
type: "bar",
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "低压变压器柜器",
|
|
||||||
type: "bar",
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
option2: {
|
option2: {
|
||||||
|
@ -262,16 +251,6 @@ export default {
|
||||||
type: "bar",
|
type: "bar",
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "调配变压器",
|
|
||||||
type: "bar",
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "低压变压器柜器",
|
|
||||||
type: "bar",
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
option3: {
|
option3: {
|
||||||
|
@ -313,202 +292,141 @@ export default {
|
||||||
type: "bar",
|
type: "bar",
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "调配变压器",
|
|
||||||
type: "bar",
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "低压变压器柜器",
|
|
||||||
type: "bar",
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
mpointList: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
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.getTableHourData();
|
||||||
that.timeStamp = timeDate;
|
that.getHourData();
|
||||||
let dayTime = 24 * 60 * 60 * 1000;
|
that.getDayData();
|
||||||
//昨天的计算
|
that.getMonthData();
|
||||||
let year_d = year,
|
},
|
||||||
month_d = month,
|
methods: {
|
||||||
days_d = days;
|
getTableHourData() {
|
||||||
if (hours < 21) {
|
let that = this;
|
||||||
//21点前,查找昨日数据为前一天数据
|
that.tableDatas = [];
|
||||||
let newDate = timeDate - dayTime;
|
let timeDate = new Date().getTime();
|
||||||
let lastDate = new Date(newDate);
|
|
||||||
year_d = lastDate.getFullYear();
|
|
||||||
month_d = lastDate.getMonth() + 1;
|
|
||||||
days_d = lastDate.getDate();
|
|
||||||
}
|
|
||||||
//上一小时的计算
|
|
||||||
let hourTime = timeDate - 3600000;
|
let hourTime = timeDate - 3600000;
|
||||||
let hourDate = new Date(hourTime);
|
let hourDate = new Date(hourTime);
|
||||||
let year_h = hourDate.getFullYear();
|
let year_h = hourDate.getFullYear();
|
||||||
let month_h = hourDate.getMonth() + 1;
|
let month_h = hourDate.getMonth() + 1;
|
||||||
let days_h = hourDate.getDate();
|
let days_h = hourDate.getDate();
|
||||||
let hours_h = hourDate.getHours();
|
let hours_h = hourDate.getHours();
|
||||||
this.$API.mtm.mgroup.list
|
let minutes = hourDate.getMinutes();
|
||||||
.req({ page: 0, search: "原料磨" })
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
.then((res) => {
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
console.log("原料磨", res);
|
if (hours_h > 5) {
|
||||||
that.query.mgroup = res[0].id;
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
//本月
|
} else {
|
||||||
let params2 = {};
|
hours_h = hours_h - 1;
|
||||||
params2.page = 0;
|
hours_h = hours_h > 9 ? hours_h : "0" + hours_h;
|
||||||
params2.year_s = year;
|
}
|
||||||
params2.month_s = month;
|
let obj = {};
|
||||||
params2.type = "month_s";
|
obj.type = "hour_s";
|
||||||
params2.mgroup = this.query.mgroup;
|
obj.year = year_h;
|
||||||
this.$API.enm.enstat
|
obj.month = month_h;
|
||||||
.req(params2)
|
obj.day = days_h;
|
||||||
.then((res2) => {
|
obj.hour = hours_h;
|
||||||
if (res2.length > 0) {
|
obj.mgroup__name = "原料磨";
|
||||||
let hourProduct = (that.allValMonth =
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
res2[0].total_production); //当前条件下的总产量
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
params2.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.page = 0;
|
||||||
this.$API.enm.mpoint.stat
|
this.$API.enm.mpoint.stat
|
||||||
.req(params2)
|
.req(obj)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let data2 = res;
|
console.log("getTableHourData", res);
|
||||||
for (let i = 0; i < data2.length; i++) {
|
res.forEach((item) => {
|
||||||
that.tableDatas[i] = [];
|
let obj = [];
|
||||||
that.tableDatas[i][0] =
|
obj[0] = item.ep_monitored_name;
|
||||||
data2[i].ep_monitored_name;
|
obj[1] = "KW·h/t";
|
||||||
that.tableDatas[i][1] =
|
obj[2] = item.elec_consume_unit;
|
||||||
data2[i].ep_monitored_number;
|
obj[3] = 0;
|
||||||
that.tableDatas[i][2] = "KW·h/t";
|
obj[4] = 0;
|
||||||
let val =
|
that.tableDatas.push(obj);
|
||||||
hourProduct == 0
|
|
||||||
? "/"
|
|
||||||
: (
|
|
||||||
data2[i].val /
|
|
||||||
hourProduct
|
|
||||||
).toFixed(2);
|
|
||||||
that.tableDatas[i][5] = val;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.then((res2) => {
|
.then(() => {
|
||||||
//昨日
|
let yetTime = timeDate - 3600000 * 24;
|
||||||
let params3 = {};
|
let ystDate = new Date(yetTime);
|
||||||
params3.page = 0;
|
let year_h = ystDate.getFullYear();
|
||||||
params3.year_s = year_d;
|
let month_h = ystDate.getMonth() + 1;
|
||||||
params3.month_s = month_d;
|
let days_h = ystDate.getDate();
|
||||||
params3.day_s = days_d;
|
month_h = month_h > 9 ? month_h : "0" + month_h;
|
||||||
params3.type = "day_s";
|
days_h = days_h > 9 ? days_h : "0" + days_h;
|
||||||
params3.mgroup = this.query.mgroup;
|
let obj = {};
|
||||||
this.$API.enm.enstat.req(params3).then((res3) => {
|
obj.type = "day_s";
|
||||||
if (res3.length > 0) {
|
obj.year_s = year_h;
|
||||||
let hourProduct = (that.allValDays =
|
obj.month_s = month_h;
|
||||||
res3[0].total_production);
|
obj.day_s = days_h;
|
||||||
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mgroup__name = "原料磨";
|
||||||
this.$API.enm.mpoint.stat
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
.req(params3)
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
.then((res) => {
|
obj.mpoint__need_display = 1;
|
||||||
let data3 = res3;
|
obj.page = 0;
|
||||||
for (let j = 0; j < data3.length; j++) {
|
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||||
let val =
|
console.log("getTableHourData", res);
|
||||||
hourProduct == 0
|
res.forEach((item, index) => {
|
||||||
? "/"
|
that.tableDatas[index][3] = item.elec_consume_unit;
|
||||||
: (
|
});
|
||||||
data3[j].val /
|
});
|
||||||
hourProduct
|
})
|
||||||
).toFixed(2);
|
.then(() => {
|
||||||
that.tableDatas[j][4] = val;
|
let obj = {};
|
||||||
}
|
obj.type = "month_s";
|
||||||
});
|
obj.year_s = that.year;
|
||||||
}
|
obj.month_s = that.month;
|
||||||
});
|
obj.mgroup__name = "原料磨";
|
||||||
//上小时
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
let params4 = {};
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
params4.page = 0;
|
obj.mpoint__need_display = 1;
|
||||||
params4.year = year_h;
|
obj.page = 0;
|
||||||
params4.month = month_h;
|
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||||
params4.day = days_h;
|
console.log("getTableHourData", res);
|
||||||
params4.hour = hours_h;
|
res.forEach((item, index) => {
|
||||||
params4.type = "hour_s";
|
that.tableDatas[index][4] = item.elec_consume_unit;
|
||||||
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: {
|
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
getHourData() {
|
getHourData() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query = {};
|
let obj = {};
|
||||||
query.page = 0;
|
obj.type = "hour_s";
|
||||||
query.year_s = that.year;
|
obj.year_s = that.year;
|
||||||
query.month_s = that.month;
|
obj.month_s = that.month;
|
||||||
query.day_s = that.days;
|
obj.day_s = that.days;
|
||||||
query.type = "hour_s";
|
obj.mgroup__name = "原料磨";
|
||||||
query.mgroup = that.query.mgroup;
|
obj.mpoint__material__code__in = "elec,elec_0";
|
||||||
query.mpoint__ep_monitored__power_kw__gte = 100;
|
obj.mpoint__ep_monitored__isnull = 0;
|
||||||
this.$API.enm.mpoint.stat.req(query).then((response) => {
|
obj.mpoint__need_display = 1;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
let seriesData0 = [],
|
let seriesData0 = [],
|
||||||
seriesData1 = [],
|
seriesData1 = [];
|
||||||
seriesData2 = [],
|
response.forEach((item) => {
|
||||||
seriesData3 = [];
|
console.log(item.ep_monitored_name);
|
||||||
let data = response;
|
let ind = item.hour - 1;
|
||||||
data.forEach((item) => {
|
if (item.ep_monitored_name == "辊压机") {
|
||||||
let ind = item.hour;
|
seriesData0[ind] = item.elec_consume_unit;
|
||||||
let val = 0;
|
} else if (item.ep_monitored_name == "循环风机") {
|
||||||
if (that.allValHour == 0) {
|
seriesData1[ind] = item.elec_consume_unit;
|
||||||
val = "";
|
|
||||||
} else {
|
|
||||||
val = (item.val / that.allValHour).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;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option1 };
|
let options = { ...that.option1 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData1;
|
||||||
options.series[2].data = seriesData2;
|
|
||||||
options.series[3].data = seriesData3;
|
|
||||||
let hourXAxis = [];
|
let hourXAxis = [];
|
||||||
for (let i = 1; i <= that.hours; i++) {
|
for (let i = 1; i < that.hours + 1; i++) {
|
||||||
let item = i + "时";
|
let item = i + "时";
|
||||||
hourXAxis.push(item);
|
hourXAxis.push(item);
|
||||||
}
|
}
|
||||||
|
@ -519,42 +437,30 @@ export default {
|
||||||
//获取天数据
|
//获取天数据
|
||||||
getDayData() {
|
getDayData() {
|
||||||
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 = that.year;
|
||||||
query1.month_s = that.month;
|
obj.month_s = that.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;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
let seriesData0 = [],
|
let seriesData0 = [],
|
||||||
seriesData1 = [],
|
seriesData1 = [];
|
||||||
seriesData2 = [],
|
|
||||||
seriesData3 = [];
|
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
let ind = item.day_s;
|
let ind = item.day_s - 1;
|
||||||
let val = 0;
|
if (item.ep_monitored_name == "辊压机") {
|
||||||
if (that.allValDays == 0) {
|
seriesData0[ind] = item.elec_consume_unit;
|
||||||
val = "";
|
} else if (item.ep_monitored_name == "循环风机") {
|
||||||
} else {
|
seriesData1[ind] = item.elec_consume_unit;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option2 };
|
let options = { ...that.option2 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData1;
|
||||||
options.series[2].data = seriesData2;
|
|
||||||
options.series[3].data = seriesData3;
|
|
||||||
let dayXAxis = [];
|
let dayXAxis = [];
|
||||||
for (let i = 1; i <= that.days; i++) {
|
for (let i = 1; i <= that.days; i++) {
|
||||||
let item = i + "日";
|
let item = i + "日";
|
||||||
|
@ -567,41 +473,29 @@ export default {
|
||||||
//获取月数据
|
//获取月数据
|
||||||
getMonthData() {
|
getMonthData() {
|
||||||
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 = that.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;
|
||||||
|
obj.page = 0;
|
||||||
|
this.$API.enm.mpoint.stat.req(obj).then((response) => {
|
||||||
let seriesData0 = [],
|
let seriesData0 = [],
|
||||||
seriesData1 = [],
|
seriesData1 = [];
|
||||||
seriesData2 = [],
|
|
||||||
seriesData3 = [];
|
|
||||||
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;
|
if (item.ep_monitored_name == "辊压机") {
|
||||||
if (that.allValMonth == 0) {
|
seriesData0[ind] = item.elec_consume_unit;
|
||||||
val = "";
|
} else if (item.ep_monitored_name == "循环风机") {
|
||||||
} else {
|
seriesData1[ind] = item.elec_consume_unit;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option3 };
|
let options = { ...that.option3 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData1;
|
||||||
options.series[2].data = seriesData2;
|
|
||||||
options.series[3].data = seriesData3;
|
|
||||||
let monthXAxis = [];
|
let monthXAxis = [];
|
||||||
for (let i = 1; i <= that.month; i++) {
|
for (let i = 1; i <= that.month; i++) {
|
||||||
let item = i + "月";
|
let item = i + "月";
|
||||||
|
|
Loading…
Reference in New Issue