fix:修改时间粒度,修改默认时间

This commit is contained in:
zhongzm
2024-11-22 10:14:45 +08:00
parent 8444de8e98
commit c2a3d4b8a8

View File

@@ -208,8 +208,8 @@ const rangePicker = reactive<RangePicker>({
...Object.fromEntries(networkElementTypes.value.map(type => [
type,
[
dayjs().startOf('hour').valueOf().toString(), // 当前小时内
dayjs().endOf('hour').valueOf().toString()
dayjs().subtract(1, 'hour').startOf('hour').valueOf().toString(), // 上一小时开始
dayjs().startOf('hour').add(1, 'hour').valueOf().toString(), // 当前小时结束
]
])) as Record<AllChartType, [string, string]>,
placeholder: [t('views.monitor.monitor.startTime'), t('views.monitor.monitor.endTime')] as [string, string],
@@ -336,7 +336,7 @@ const fetchData = async (type: AllChartType) => {
endTime,
sortField: 'timeGroup',
sortOrder: 'desc',
interval: 5,
interval: 60*15,
});
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {