feat: 修改大屏 本月能源消耗改为本日
This commit is contained in:
parent
e8eb624661
commit
c9168a5b61
|
@ -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 () {
|
||||||
|
|
Loading…
Reference in New Issue