fix:修改日期选择器默认时间
This commit is contained in:
@@ -250,7 +250,6 @@ const chartStates: Record<AllChartType, ReturnType<typeof createChartState>> = O
|
||||
//日期选择器
|
||||
interface RangePicker extends Record<AllChartType, [string, string]> {
|
||||
placeholder: [string, string];
|
||||
ranges: Record<string, [Dayjs, Dayjs]>;
|
||||
}
|
||||
|
||||
// 日期选择器状态
|
||||
@@ -258,17 +257,11 @@ const rangePicker = reactive<RangePicker>({
|
||||
...Object.fromEntries(networkElementTypes.value.map(type => [
|
||||
type,
|
||||
[
|
||||
dayjs().startOf('day').valueOf().toString(), // 0 点 0 分 0 秒
|
||||
dayjs().valueOf().toString() // 此时
|
||||
dayjs().startOf('hour').valueOf().toString(), // 当前小时内
|
||||
dayjs().endOf('hour').valueOf().toString()
|
||||
]
|
||||
])) as Record<AllChartType, [string, string]>,
|
||||
placeholder: [t('views.monitor.monitor.startTime'), t('views.monitor.monitor.endTime')] as [string, string],
|
||||
ranges: {
|
||||
[t('views.monitor.monitor.yesterday')]: [dayjs().subtract(1, 'day').startOf('day'), dayjs().subtract(1, 'day').endOf('day')],
|
||||
[t('views.monitor.monitor.today')]: [dayjs().startOf('day'), dayjs()],
|
||||
[t('views.monitor.monitor.week')]: [dayjs().startOf('week'), dayjs().endOf('week')],
|
||||
[t('views.monitor.monitor.month')]: [dayjs().startOf('month'), dayjs().endOf('month')],
|
||||
} as Record<string, [Dayjs, Dayjs]>,
|
||||
});
|
||||
|
||||
// 可复用的图表初始化函数
|
||||
@@ -896,7 +889,6 @@ const applyTwoColumnLayout = () => {
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="x"
|
||||
:placeholder="rangePicker.placeholder"
|
||||
:ranges="rangePicker.ranges"
|
||||
style="width: 360px"
|
||||
@change="() => fetchData(item.i)"
|
||||
class="no-drag"
|
||||
|
||||
Reference in New Issue
Block a user