1.修改 设备管理 - 分组管理 页面

2.修改 监控中心 - 能耗监测 初始化时间bug
This commit is contained in:
fks-yangshouda
2024-08-27 13:53:56 +08:00
parent 15811933c3
commit 30a76a5cc3
4 changed files with 128 additions and 52 deletions

View File

@@ -340,11 +340,25 @@
// 获取当天的时间
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0'); // getMonth() 返回的月份是0-11
const day = String(today.getDate()).padStart(2, '0');
const month = Number(String(today.getMonth() + 1).padStart(2, '0')); // getMonth() 返回的月份是0-11
const day = Number(String(today.getDate()).padStart(2, '0'));
startTime = year + '-' + month + '-' + day;
endTime = year + '-' + month + '-' + day;
if (dateTypeValue.value == 'month') {
startTime = year + '-' + month + '-01';
// 创建下一个月的第一天
const date = new Date(year, month, 1);
// 减去一天得到当月的最后一天
// date.setDate(date.getDate() - 1);
endTime = date.toISOString().split('T')[0];
// endTime = endDate.value + '-01';
} else if (dateTypeValue.value == 'year') {
startTime = year + '-01-01';
endTime = year + '-12-31';
} else {
startTime = year + '-' + month + '-' + day;
endTime = year + '-' + month + '-' + day;
}
}
// 图表数据