feat: 修改大屏 本月能源消耗改为本日
This commit is contained in:
parent
e8eb624661
commit
c9168a5b61
|
@ -1285,25 +1285,26 @@ export default {
|
|||
let myChart = echarts.init(chartDom);
|
||||
|
||||
// 初始化各个series数据数组
|
||||
let seriesData = new Array(12).fill(0);
|
||||
let seriesData1 = new Array(12).fill(0);
|
||||
let seriesData = new Array(31).fill(0);
|
||||
let seriesData1 = new Array(31).fill(0);
|
||||
|
||||
// 定义查询参数的生成函数
|
||||
function generateQuery(mgroupId) {
|
||||
return {
|
||||
page: 0,
|
||||
//获取当前年的第一个月
|
||||
start_time: that.currentYear + "-01-01 00:00:00",
|
||||
end_time: that.currentYear + "-12-31 00:00:00",
|
||||
type: "month_s",
|
||||
year_s: that.currentYear,
|
||||
month_s: that.currentMonth,
|
||||
type: "day_s",
|
||||
mgroup: mgroupId,
|
||||
};
|
||||
}
|
||||
function generateQueryMpoint(mpointId) {
|
||||
return {
|
||||
page: 0,
|
||||
type: "month",
|
||||
year: that.currentYear,
|
||||
type: "day_s",
|
||||
year_s: that.currentYear,
|
||||
month_s: that.currentMonth,
|
||||
mpoint: mpointId,
|
||||
};
|
||||
}
|
||||
|
@ -1312,18 +1313,18 @@ export default {
|
|||
this.$API.enm.enstat.req(query1).then((response) => {
|
||||
response.forEach((item) => {
|
||||
if (item.qua_data.length > 0) {
|
||||
let ind = item.month_s - 1;
|
||||
let ind = item.day_s - 1;
|
||||
seriesData[ind] = item.total_production || 0;
|
||||
}
|
||||
});
|
||||
// 获取每个月的全厂电量
|
||||
// 获取每日的全厂电量
|
||||
let query2 = generateQueryMpoint("3631880992400515072");
|
||||
return this.$API.enm.mpointstat.list.req(query2);
|
||||
}).then((response) => {
|
||||
let maxId;
|
||||
response.forEach((item) => {
|
||||
let ind = item.month - 1;
|
||||
maxId = 12;
|
||||
let ind = item.day_s - 1;
|
||||
maxId = 31;
|
||||
seriesData1[ind] = item.val || 0;
|
||||
});
|
||||
// 更新图表数据
|
||||
|
@ -1389,20 +1390,7 @@ export default {
|
|||
},
|
||||
},
|
||||
];
|
||||
option5.xAxis.data = [
|
||||
"1月",
|
||||
"2月",
|
||||
"3月",
|
||||
"4月",
|
||||
"5月",
|
||||
"6月",
|
||||
"7月",
|
||||
"8月",
|
||||
"9月",
|
||||
"10月",
|
||||
"11月",
|
||||
"12月",
|
||||
];
|
||||
option5.xAxis.data = that.datelist;
|
||||
myChart.setOption(option5); // 设置更新后的图表
|
||||
let index3 = 0;
|
||||
intervalId = setInterval(function () {
|
||||
|
|
Loading…
Reference in New Issue