diff --git a/src/pages/Monitor/MonitorClients.vue b/src/pages/Monitor/MonitorClients.vue index c5022d053..e73f52b24 100644 --- a/src/pages/Monitor/MonitorClients.vue +++ b/src/pages/Monitor/MonitorClients.vue @@ -7,11 +7,12 @@ import { toDateFormat } from 'src/filters/date.js'; import VnTable from 'src/components/VnTable/VnTable.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnRow from 'src/components/ui/VnRow.vue'; - +import { dateRange } from 'src/filters'; const { t } = useI18n(); -const from = ref(Date.vnNew()); -const to = ref(Date.vnNew()); +const dates = dateRange(Date.vnNew()); +const from = ref(dates[0]); +const to = ref(dates[1]); const filter = computed(() => { const obj = {}; diff --git a/src/pages/Monitor/Ticket/MonitorTicketFilter.vue b/src/pages/Monitor/Ticket/MonitorTicketFilter.vue index f5917356d..bade21f59 100644 --- a/src/pages/Monitor/Ticket/MonitorTicketFilter.vue +++ b/src/pages/Monitor/Ticket/MonitorTicketFilter.vue @@ -8,6 +8,7 @@ import VnSelect from 'src/components/common/VnSelect.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnInputNumber from 'src/components/common/VnInputNumber.vue'; import FetchData from 'src/components/FetchData.vue'; +import { dateRange } from 'src/filters'; defineProps({ dataKey: { type: String, required: true } }); const { t } = useI18n(); @@ -15,11 +16,7 @@ const warehouses = ref(); const groupedStates = ref(); const handleScopeDays = (params, days, callback) => { - const from = Date.vnNew(); - from.setHours(0, 0, 0, 0); - const to = Date.vnNew(); - to.setHours(23, 59, 59, 999); - + const [from, to] = dateRange(Date.vnNew()); if (!days) { Object.assign(params, { from, to, scopeDays: 1 }); } else { diff --git a/src/pages/Monitor/Ticket/MonitorTickets.vue b/src/pages/Monitor/Ticket/MonitorTickets.vue index 828527162..82788c997 100644 --- a/src/pages/Monitor/Ticket/MonitorTickets.vue +++ b/src/pages/Monitor/Ticket/MonitorTickets.vue @@ -25,17 +25,8 @@ const stateOpts = ref([]); const zoneOpts = ref([]); const visibleColumns = ref([]); const { viewSummary } = useSummaryDialog(); -const from = computed(() => { - const date = Date.vnNew(); - date.setHours(0, 0, 0, 0); - return date; -}); -const to = computed(() => { - const date = Date.vnNew(); - date.setDate(date.getDate() + 1); - date.setHours(23, 59, 59, 999); - return date; -}); +const [from, to] = dateRange(Date.vnNew()); + function exprBuilder(param, value) { switch (param) { case 'stateFk': @@ -377,7 +368,7 @@ const openTab = (id) =>