feat: 修改大屏 本月能源消耗改为本日

This commit is contained in:
zty 2024-12-30 09:14:43 +08:00
parent e8eb624661
commit c9168a5b61
1 changed files with 13 additions and 25 deletions

View File

@ -1285,25 +1285,26 @@ export default {
let myChart = echarts.init(chartDom); let myChart = echarts.init(chartDom);
// series // series
let seriesData = new Array(12).fill(0); let seriesData = new Array(31).fill(0);
let seriesData1 = new Array(12).fill(0); let seriesData1 = new Array(31).fill(0);
// //
function generateQuery(mgroupId) { function generateQuery(mgroupId) {
return { return {
page: 0, page: 0,
// //
start_time: that.currentYear + "-01-01 00:00:00", year_s: that.currentYear,
end_time: that.currentYear + "-12-31 00:00:00", month_s: that.currentMonth,
type: "month_s", type: "day_s",
mgroup: mgroupId, mgroup: mgroupId,
}; };
} }
function generateQueryMpoint(mpointId) { function generateQueryMpoint(mpointId) {
return { return {
page: 0, page: 0,
type: "month", type: "day_s",
year: that.currentYear, year_s: that.currentYear,
month_s: that.currentMonth,
mpoint: mpointId, mpoint: mpointId,
}; };
} }
@ -1312,18 +1313,18 @@ export default {
this.$API.enm.enstat.req(query1).then((response) => { this.$API.enm.enstat.req(query1).then((response) => {
response.forEach((item) => { response.forEach((item) => {
if (item.qua_data.length > 0) { if (item.qua_data.length > 0) {
let ind = item.month_s - 1; let ind = item.day_s - 1;
seriesData[ind] = item.total_production || 0; seriesData[ind] = item.total_production || 0;
} }
}); });
// //
let query2 = generateQueryMpoint("3631880992400515072"); let query2 = generateQueryMpoint("3631880992400515072");
return this.$API.enm.mpointstat.list.req(query2); return this.$API.enm.mpointstat.list.req(query2);
}).then((response) => { }).then((response) => {
let maxId; let maxId;
response.forEach((item) => { response.forEach((item) => {
let ind = item.month - 1; let ind = item.day_s - 1;
maxId = 12; maxId = 31;
seriesData1[ind] = item.val || 0; seriesData1[ind] = item.val || 0;
}); });
// //
@ -1389,20 +1390,7 @@ export default {
}, },
}, },
]; ];
option5.xAxis.data = [ option5.xAxis.data = that.datelist;
"1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月",
];
myChart.setOption(option5); // myChart.setOption(option5); //
let index3 = 0; let index3 = 0;
intervalId = setInterval(function () { intervalId = setInterval(function () {