diff --git a/src/views/chart/hooks/monitoring.ts b/src/views/chart/hooks/monitoring.ts index 6929e79..817894e 100644 --- a/src/views/chart/hooks/monitoring.ts +++ b/src/views/chart/hooks/monitoring.ts @@ -872,7 +872,9 @@ export default (state: IObject) => { { const date = new dateService().getFullDate(undefined, '-'); //当日 - const time = new dateService().getTime(others.beginTime); //24小时制的开始时间 从配置viewConfig中取 + const time = new dateService().getTime( + others.beginTime || new Date(+new dateService().getMidnightTimeStamp()), + ); //24小时制的开始时间 从配置viewConfig中取,没有就取当日零点时间 const beginTime = new Date(`${date} ${time}`).getTime(); //组装好的日期获取时间戳 const endTime = beginTime + new dateService().oneDayTimestamp - 1000; //毫秒戳 一天的时间戳减去1秒 算出截至时间戳