From 1312dbe2af2b3d0c97098c75719b34c98d6a5638 Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 28 Aug 2024 12:13:58 +0200 Subject: [PATCH] fix: refs #7353 iron out filter --- src/components/ui/VnFilterPanel.vue | 6 ++--- .../Monitor/Ticket/MonitorTicketFilter.vue | 24 ++++++++++++++----- src/pages/Monitor/Ticket/MonitorTickets.vue | 13 +++++++++- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index caed3b401..a0dc6cc82 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -24,7 +24,7 @@ const $props = defineProps({ type: Boolean, default: true, }, - unRemovableParams: { + unremovableParams: { type: Array, required: false, default: () => [], @@ -148,7 +148,7 @@ async function clearFilters() { arrayData.reset(['skip', 'filter.skip', 'page']); // Filtrar los params no removibles const removableFilters = Object.keys(userParams.value).filter((param) => - $props.unRemovableParams.includes(param) + $props.unremovableParams.includes(param) ); const newParams = {}; // Conservar solo los params que no son removibles @@ -268,7 +268,7 @@ function sanitizer(params) { diff --git a/src/pages/Monitor/Ticket/MonitorTicketFilter.vue b/src/pages/Monitor/Ticket/MonitorTicketFilter.vue index ff9ea5e63..f5917356d 100644 --- a/src/pages/Monitor/Ticket/MonitorTicketFilter.vue +++ b/src/pages/Monitor/Ticket/MonitorTicketFilter.vue @@ -15,13 +15,16 @@ 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); + if (!days) { - Object.assign(params, { from: undefined, to: undefined, scopeDays: undefined }); + Object.assign(params, { from, to, scopeDays: 1 }); } else { - params.from = Date.vnNew(); - const to = Date.vnNew(); + params.from = from; to.setDate(to.getDate() + days); - to.setHours(23, 59, 59, 999); params.to = to; } if (callback) callback(); @@ -29,12 +32,20 @@ const handleScopeDays = (params, days, callback) => {