综合服务完善修改

This commit is contained in:
zjf committed 2025-10-13 00:25:38 +08:00
1 parent 78762f43d2
commit 8d96247c44
7 files changed
+28 -10

No files matched your search

@@ -111,12 +111,12 @@ export const generateRandomData = (min: number, max: number): number => {
export const generateTimeSeries = (startTime: Date, endTime: Date, interval: number = 60): string[] => {
const times: string[] = [];
const current = new Date(startTime);
while (current <= endTime) {
times.push(formatDateTime(current, 'HH:mm'));
current.setMinutes(current.getMinutes() + interval);
}
return times;
};
@@ -128,7 +128,7 @@ export const generateTimeSeries = (startTime: Date, endTime: Date, interval: num
export const getDefaultTimeRange = (type: 'hour' | 'day' | 'month' = 'day') => {
const now = new Date();
const startTime = new Date(now);
switch (type) {
case 'hour':
startTime.setHours(now.getHours() - 24);
@@ -140,7 +140,7 @@ export const getDefaultTimeRange = (type: 'hour' | 'day' | 'month' = 'day') => {
startTime.setMonth(now.getMonth() - 6);
break;
}
return {
startTime: formatDateTime(startTime),
endTime: formatDateTime(now),