feat: index_enm 修改大屏内容

This commit is contained in:
zty 2024-10-24 16:05:12 +08:00
parent 345bdc3b96
commit 550bc6443b
1 changed files with 549 additions and 137 deletions

View File

@ -18,23 +18,23 @@
<div class="totalNumContnier"> <div class="totalNumContnier">
<div class="totalNumWrap totalNum_orange"> <div class="totalNumWrap totalNum_orange">
<img class="" src="img/number_bg_orange.png" /> <img class="" src="img/number_bg_orange.png" />
<span class="totalNumText">产量</span> <span class="totalNumText">本月熟料产量</span>
<div class="totalNumber"> <div class="totalNumber">
{{ totalData.total_production }} {{ totalData.shuliao }}
</div> </div>
</div> </div>
<div class="totalNumWrap totalNumWrap_green"> <div class="totalNumWrap totalNumWrap_green">
<img src="img/number_bg_green.png" /> <img src="img/number_bg_green.png" />
<span class="totalNumText">实物煤耗</span> <span class="totalNumText">本月水泥产量</span>
<div class="totalNumber"> <div class="totalNumber">
{{ totalData.pcoal_consume }} {{ totalData.cement }}
</div> </div>
</div> </div>
<div class="totalNumWrap totalNum_blue"> <div class="totalNumWrap totalNum_blue">
<img src="img/number_bg_blue.png" /> <img src="img/number_bg_blue.png" />
<span class="totalNumText">综合电耗</span> <span class="totalNumText">本月水泥出厂</span>
<div class="totalNumber"> <div class="totalNumber">
{{ totalData.celec_consume_unit }} {{ totalData.out_cement }}
</div> </div>
</div> </div>
</div> </div>
@ -106,6 +106,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="flexItem">
<div class="itemTitle">
<div class="itemTitleIcon"></div>
<div>压缩空气用水量</div>
</div>
<div class="itemBody" id="line2"></div>
</div>
<!-- <div class="flexItem"> <!-- <div class="flexItem">
<div class="itemTitle"> <div class="itemTitle">
<div class="itemTitleIcon"></div> <div class="itemTitleIcon"></div>
@ -420,9 +427,9 @@ export default {
水泥储存及散装库: "水泥包装", 水泥储存及散装库: "水泥包装",
}, },
totalData: { totalData: {
total_production: 0, shuliao: 0,
pcoal_consume: 0, cement: 0,
celec_consume_unit: 0, out_cement: 0,
}, },
rateData: [ rateData: [
{ name: "电石渣", value: 0 }, { name: "电石渣", value: 0 },
@ -506,6 +513,45 @@ export default {
}, },
series: [], series: [],
}, },
option2 :{
color: ["#80FFA5", "#00DDFF", "#37A2FF", "#FF0087", "#FFBF00"],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
data: []
},
toolbox: {
feature: {
saveAsImage: {}
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: []
}
],
yAxis: [
{
type: 'value'
}
],
series: [],
},
radarSeriesData: [0, 0, 0, 0, 0], radarSeriesData: [0, 0, 0, 0, 0],
radarOption: { radarOption: {
radar: { radar: {
@ -636,6 +682,8 @@ export default {
that.$nextTick(() => { that.$nextTick(() => {
// //
that.productNum(); that.productNum();
that.waterAirData();
that.getMonthData();
// //
that.eqRate(); that.eqRate();
// //
@ -652,135 +700,369 @@ export default {
that.timerTime = setInterval(() => { that.timerTime = setInterval(() => {
that.showTime(); that.showTime();
}, 1000); }, 1000);
that.qualityTimer = setInterval(() => { // that.qualityTimer = setInterval(() => {
let lineDom = document.getElementById("line3"); // let lineDom = document.getElementById("line3");
if (lineDom) { // if (lineDom) {
that.KHData = []; // that.KHData = [];
that.SMData = []; // that.SMData = [];
that.IMData = []; // that.IMData = [];
if (that.deptName == "出磨熟料") { // if (that.deptName == "") {
that.deptName = "入窑生料"; // that.deptName = "";
for (let i = 0; i < day; i++) { // for (let i = 0; i < day; i++) {
that.KHData.push(that.shengliaoData.KH[i]); // that.KHData.push(that.shengliaoData.KH[i]);
that.SMData.push(that.shengliaoData.SM[i]); // that.SMData.push(that.shengliaoData.SM[i]);
that.IMData.push(that.shengliaoData.IM[i]); // that.IMData.push(that.shengliaoData.IM[i]);
} // }
} else { // } else {
that.deptName = "出磨熟料"; // that.deptName = "";
for (let i = 0; i < day; i++) { // for (let i = 0; i < day; i++) {
that.KHData.push(that.shuliaoData.KH[i]); // that.KHData.push(that.shuliaoData.KH[i]);
that.SMData.push(that.shuliaoData.SM[i]); // that.SMData.push(that.shuliaoData.SM[i]);
that.IMData.push(that.shuliaoData.IM[i]); // that.IMData.push(that.shuliaoData.IM[i]);
} // }
} // }
that.initChart(); // that.initChart();
} // }
}, 5000); // }, 5000);
// that.timerTime = setInterval(() => {
// that.productNum();
// that.eqRate();
// that.generation();
// that.proceElec();
// that.dataCollect();
// }, 3600000);
}); });
}, },
methods: { methods: {
//
productNum() { productNum() {
let that = this; let that = this;
this.$API.mtm.mgroup.list
.req({ page: 0, search: "回转窑" }) // option1
.then((res) => { let option1 = that.deepCopy(that.option);
// console.log("", res); let chartDom = document.getElementById("line1");
that.huihzuanyaoId = res[0].id; let myChart = echarts.init(chartDom);
let query = {};
query.page = 0; let seriesData = new Array(31).fill(0); // 310
query.year_s = that.currentYear; let seriesData1 = new Array(31).fill(0);
query.month_s = that.currentMonth; let seriesData2 = new Array(31).fill(0);
query.type = "day_s";
query.mgroup = that.huihzuanyaoId; //
this.$API.enm.enstat.req(query).then((response) => { this.$API.mtm.mgroup.list.req({ page: 0, search: "回转窑" }).then((res) => {
let seriesData = []; that.huihzuanyaoId = res[0]?.id;
let data = response; let query = {
data.forEach((item) => { page: 0,
let ind = item.day_s - 1; year_s: that.currentYear,
seriesData[ind] = item.total_production; month_s: that.currentMonth,
if (item.day_s == that.currentDay) { type: "day_s",
that.totalData.total_production = mgroup: that.huihzuanyaoId,
item.total_production; };
that.totalData.pcoal_consume = return this.$API.enm.enstat.req(query);
item.pcoal_consume; }).then((response) => {
that.totalData.celec_consume_unit = response.forEach((item) => {
item.celec_consume_unit; let ind = item.day_s - 1;
} seriesData[ind] = item.total_production || 0; //
});
let option1 = that.deepCopy(that.option);
let chartDom = document.getElementById("line1");
let myChart = echarts.init(chartDom);
option1.legend.data = [
// {
// name: "",
// textStyle: {
// color: "#fff",
// },
// borderRadius: 2,
// itemStyle: {
// color: that.linearGradientColors[0],
// },
// },
// {
// name: "",
// textStyle: {
// color: "#fff",
// },
// borderRadius: 2,
// itemStyle: {
// color: that.linearGradientColors[1],
// },
// },
];
option1.series = [
{
name: "",
type: "line",
stack: "Total",
smooth: true,
lineStyle: {
width: 0,
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: that.linearGradientColors[0],
},
emphasis: {
focus: "series",
},
data: seriesData,
},
{
name: "",
type: "line",
stack: "Total",
smooth: true,
lineStyle: {
width: 0,
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: that.linearGradientColors[1],
},
emphasis: {
focus: "series",
},
data: that.tezhongData,
},
];
myChart.setOption(option1);
}); });
}).then(() => {
//
return this.$API.mtm.mgroup.list.req({ page: 0, search: "水泥磨" });
}).then((res) => {
that.shuinimoId = res[0]?.id;
let query = {
page: 0,
year_s: that.currentYear,
month_s: that.currentMonth,
type: "day_s",
mgroup: that.shuinimoId,
};
return this.$API.enm.enstat.req(query);
}).then((response) => {
response.forEach((item) => {
let ind = item.day_s - 1;
seriesData1[ind] = item.total_production || 0;
});
}).then(() => {
//
return this.$API.mtm.mgroup.list.req({ page: 0, search: "水泥包装" });
}).then((res) => {
that.shuinimoId = res[0]?.id;
let query = {
page: 0,
year_s: that.currentYear,
month_s: that.currentMonth,
type: "day_s",
mgroup: that.shuinimoId,
};
return this.$API.enm.enstat.req(query);
}).then((response) => {
response.forEach((item) => {
let ind = item.day_s - 1;
seriesData2[ind] = item.total_production || 0;
});
//
option1.legend.data = [
{
name: "熟料",
textStyle: {
color: "#fff",
},
borderRadius: 2,
itemStyle: {
color: that.linearGradientColors[0],
},
},
{
name: "水泥",
textStyle: {
color: "#fff",
},
borderRadius: 2,
itemStyle: {
color: that.linearGradientColors[1],
},
},
{
name: "出厂水泥",
textStyle: {
color: "#fff",
},
borderRadius: 2,
itemStyle: {
color: that.linearGradientColors[2],
},
},
];
option1.series = [
{
name: "熟料",
type: "line",
stack: "Total",
smooth: true,
lineStyle: {
width: 0,
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: that.linearGradientColors[0],
},
emphasis: {
focus: "series",
},
data: seriesData,
},
{
name: "水泥",
type: "line",
stack: "Total",
smooth: true,
lineStyle: {
width: 0,
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: that.linearGradientColors[1],
},
emphasis: {
focus: "series",
},
data: seriesData1,
},
{
name: "出厂水泥",
type: "line",
stack: "Total",
smooth: true,
lineStyle: {
width: 0,
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: that.linearGradientColors[2],
},
emphasis: {
focus: "series",
},
data: seriesData2,
},
];
myChart.setOption(option1);
}); });
},
getMonthData() {
//
let that = this;
this.$API.mtm.mgroup.list.req({ page: 0, search: "回转窑" }).then((res) => {
that.huihzuanyaoId = res[0]?.id; //id
let query = {
page: 0,
year_s: that.currentYear,
month_s: that.currentMonth,
type: "month_s",
mgroup: that.huihzuanyaoId,
};
return this.$API.enm.enstat.req(query);
}).then((response) => {
response.forEach((item) => {
if (item.month_s == that.currentMonth) {
that.totalData.shuliao = item.total_production; //
}
})
}).then(() => {
//
return this.$API.mtm.mgroup.list.req({ page: 0, search: "水泥磨" });
}).then((res) => {
that.shuinimoId = res[0]?.id; //id
let query = {
page: 0,
year_s: that.currentYear,
month_s: that.currentMonth,
type: "month_s",
mgroup: that.shuinimoId,
};
return that.$API.enm.enstat.req(query);
}).then((response) => {
response.forEach((item) => {
if (item.month_s == that.currentMonth) {
that.totalData.cement = item.total_production; //
}
})
}).then(() => {
//
return this.$API.mtm.mgroup.list.req({ page: 0, search: "水泥包装" });
}).then((res) => {
that.out_cement = res[0]?.id; //id
let query = {
page: 0,
year_s: that.currentYear,
month_s: that.currentMonth,
type: "month_s",
mgroup: that.out_cement,
};
return that.$API.enm.enstat.req(query);
}).then((response) => {
response.forEach((item) => {
if (item.month_s == that.currentMonth) {
that.totalData.out_cement = item.total_production; //
}
})
})
},
waterAirData() {
let that = this;
// option2
let option3 = that.deepCopy(that.option); // this.option
let chartDom = document.getElementById("line2");
let myChart = echarts.init(chartDom);
// series
let seriesData = new Array(31).fill(0); //
let seriesData1 = new Array(31).fill(0); //
let seriesData2 = new Array(31).fill(0); //
let seriesData3 = new Array(31).fill(0); //
let seriesData4 = new Array(31).fill(0); //
let seriesData5 = new Array(31).fill(0); //
//
function generateQuery(deptId) {
return {
page: 0,
year_s: that.currentYear,
month_s: that.currentMonth,
type: "day_s",
mgroup__belong_dept: deptId,
};
}
// API
let query1 = generateQuery("3626222645575802880");
this.$API.enm.enstat.req(query1).then((response) => {
response.forEach((item) => {
if (item.mgroup_name === "原料压缩空气") {
let ind = item.day_s - 1;
seriesData[ind] = item.cair_consume || 0;
} else if (item.mgroup_name === "原料车间用水") {
let ind = item.day_s - 1;
seriesData1[ind] = item.water_consume || 0;
}
});
// API
let query2 = generateQuery("3626252143184752640");
return this.$API.enm.enstat.req(query2);
}).then((response) => {
response.forEach((item) => {
if (item.mgroup_name === "烧成压缩空气") {
let ind = item.day_s - 1;
seriesData2[ind] = item.cair_consume || 0;
} else if (item.mgroup_name === "烧成车间用水") {
let ind = item.day_s - 1;
seriesData3[ind] = item.water_consume || 0;
}
});
// API
let query3 = generateQuery("3626252144132665344");
return this.$API.enm.enstat.req(query3);
}).then((response) => {
response.forEach((item) => {
if (item.mgroup_name === "水泥压缩空气") {
let ind = item.day_s - 1;
seriesData4[ind] = item.cair_consume || 0;
} else if (item.mgroup_name === "水泥车间用水") {
let ind = item.day_s - 1;
seriesData5[ind] = item.water_consume || 0;
}
});
//
option3.series = [
{
name: '原料压缩空气',
type: 'line',
stack: 'Total',
data: seriesData
},
{
name: '原料车间用水',
type: 'line',
stack: 'Total',
data: seriesData1
},
{
name: '烧成压缩空气',
type: 'line',
stack: 'Total',
data: seriesData2
},
{
name: '烧成车间用水',
type: 'line',
stack: 'Total',
data: seriesData3
},
{
name: '水泥压缩空气',
type: 'line',
stack: 'Total',
data: seriesData4
},
{
name: '水泥车间用水',
type: 'line',
stack: 'Total',
data: seriesData5
}
]
myChart.setOption(option3); //
});
},
//
getShiNengMouData() {
let that = this;
let query = {};
query.page = 0;
query.year_s = that.currentYear;
query.month_s = that.currentMonth;
query.type = "month_s";
this.$API.enm.enstat.req(query).then((response) => {
})
}, },
// //
eqRate() { eqRate() {
@ -848,7 +1130,6 @@ export default {
}); });
}); });
}, },
// //
// this.$API.enm.mpoint.list // this.$API.enm.mpoint.list
// .req({ // .req({
// page: 0, // page: 0,
@ -896,7 +1177,6 @@ export default {
}; };
that.$API.enm.enstat.req(params).then((res) => { that.$API.enm.enstat.req(params).then((res) => {
let data = res.results; let data = res.results;
console.log("工序电耗", data);
let seriesData = [0, 0, 0, 0, 0]; let seriesData = [0, 0, 0, 0, 0];
data.forEach((item, index) => { data.forEach((item, index) => {
if (item.mgroup_name == "电石渣") { if (item.mgroup_name == "电石渣") {
@ -927,7 +1207,140 @@ export default {
}); });
}, },
//--- //---
qualAnalys() {}, qualAnalys() {
let that = this;
// option2
let option5 = that.deepCopy(that.option); // this.option
let chartDom = document.getElementById("line3");
let myChart = echarts.init(chartDom);
// series
let seriesData = new Array(31).fill(0);
let seriesData1 = new Array(31).fill(0);
let seriesData2 = new Array(31).fill(0);
let seriesData3 = new Array(31).fill(0);
let seriesData4 = new Array(31).fill(0);
//
function generateQuery(mgroupId) {
return {
page: 0,
year_s: that.currentYear,
month_s: that.currentMonth,
type: "day_s",
mgroup: mgroupId,
};
}
// API
let query1 = generateQuery("3626253029718056960");
this.$API.enm.enstat.req(query1).then((response) => {
response.forEach((item) => {
if (item.qua_data.length > 0) {
let ind = item.day_s - 1;
seriesData[ind] = item.出窑熟料_fCaO_rate_pass || 0;
seriesData1[ind] = item.出窑熟料_立升重_rate_pass || 0;
}
});
let query2 = generateQuery("3626253601661739008");
return this.$API.enm.enstat.req(query2);
}).then((response) => {
response.forEach((item) => {
if (item.qua_data.length > 0) {
let ind = item.day_s - 1;
seriesData2[ind] = item.出磨水泥_SO3_rate_pass || 0;
seriesData3[ind] = item.出磨水泥_比表面积_rate_pass || 0;
seriesData4[ind] = item.出磨水泥_掺量_rate_pass || 0;
}
});
//
option5.legend.data = [
{
name: "f-CaO",
textStyle: {
color: "#fff",
},
borderRadius: 2,
itemStyle: {
color: that.linearGradientColors[0],
},
},
{
name: "立升重",
textStyle: {
color: "#fff",
},
borderRadius: 2,
itemStyle: {
color: that.linearGradientColors[1],
},
},
{
name: "SO3",
textStyle: {
color: "#fff",
},
borderRadius: 2,
itemStyle: {
color: that.linearGradientColors[2],
},
},
{
name: "比表面积",
textStyle: {
color: "#fff",
},
borderRadius: 2,
itemStyle: {
color: that.linearGradientColors[3],
},
},
{
name: "掺量",
textStyle: {
color: "#fff",
},
borderRadius: 2,
itemStyle: {
color: that.linearGradientColors[4],
},
},
];
option5.series = [
{
name: 'f-CaO',
type: 'line',
stack: 'Total',
data: seriesData
},
{
name: '立升重',
type: 'line',
stack: 'Total',
data: seriesData1
},
{
name: 'SO3',
type: 'line',
stack: 'Total',
data: seriesData2
},
{
name: '比表面积',
type: 'line',
stack: 'Total',
data: seriesData3
},
{
name: '掺量',
type: 'line',
stack: 'Total',
data: seriesData4
},
]
myChart.setOption(option5); //
});
},
// //
dataCollect() { dataCollect() {
let that = this; let that = this;
@ -942,7 +1355,6 @@ export default {
return typeof variable; return typeof variable;
} }
that.$API.enm.mpoint.list.req(params).then((res) => { that.$API.enm.mpoint.list.req(params).then((res) => {
console.log("数据采集", res);
let success_num = 0; let success_num = 0;
let error_num = 0; let error_num = 0;
res.forEach((item, index) => { res.forEach((item, index) => {
@ -958,7 +1370,6 @@ export default {
} }
that.tableData.push(item); that.tableData.push(item);
}); });
console.log("数据采集tableData", that.tableData);
// let chartDom6 = document.getElementById("pieChart"); // let chartDom6 = document.getElementById("pieChart");
// let myChart6 = echarts.init(chartDom6); // let myChart6 = echarts.init(chartDom6);
@ -1079,6 +1490,7 @@ export default {
that.resizeChart("line1"); that.resizeChart("line1");
// that.resizeChart("pieChart"); // that.resizeChart("pieChart");
that.resizeChart("radar"); that.resizeChart("radar");
that.resizeChart("line2");
that.resizeChart("line3"); that.resizeChart("line3");
}, },
resizeChart(name) { resizeChart(name) {