From 08c60b3da066729af5633eb1c7d165e711be0203 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 21 Feb 2023 15:05:57 +0100 Subject: [PATCH] Changes --- src/components/ui/VnFilterPanel.vue | 31 +++-- src/components/ui/VnSearchbar.vue | 8 ++ src/composables/useArrayData.js | 2 +- src/layouts/MainLayout.vue | 2 +- src/pages/Customer/Card/CustomerCard.vue | 15 ++- src/pages/Customer/CustomerFilter.vue | 153 +++++++++++++---------- src/pages/Customer/CustomerList.vue | 13 +- src/pages/Login/LoginMain.vue | 1 + src/pages/Ticket/TicketFilter.vue | 3 +- 9 files changed, 144 insertions(+), 84 deletions(-) diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index e1e3c9719..29967d8c7 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -23,12 +23,21 @@ const userParams = ref({}); onMounted(() => { const params = store.userParams; if (params) { - userParams.value = params; + userParams.value = Object.assign({}, params); } }); async function search() { const params = userParams.value; + for (const param in params) { + if (params[param] === '' || params[param] === null) { + delete userParams.value[param]; + delete store.userParams[param]; + } + } + + // if (Object.keys(params)) + await arrayData.addFilter({ params }); } @@ -64,7 +73,7 @@ async function remove(key) { removable > -
+
{{ chip.label }}: "{{ chip.value }}"
@@ -97,17 +106,17 @@ async function remove(key) {
- + - { - "en": { - "appliedFilters": "Applied filters" - }, - "es": { - "appliedFilters": "Filtros aplicados" - } +{ + "en": { + "appliedFilters": "Applied filters" + }, + "es": { + "appliedFilters": "Filtros aplicados" } - +} + diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index f380079d5..456fd5917 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -69,6 +69,14 @@ async function search() { + diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 37d6febc7..b68a73f5e 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -123,7 +123,7 @@ export function useArrayData(key, userOptions) { } async function refresh() { - // TODO: Refresh + await fetch({ append: false }); } function updateStateParams() { diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 8fc99d166..29fcfc3e9 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -16,7 +16,7 @@ const stateStore = useStateStore(); v-model="stateStore.rightDrawer" side="right" :width="256" - :breakpoint="800" + :breakpoint="1000" :persistent="false" > diff --git a/src/pages/Customer/Card/CustomerCard.vue b/src/pages/Customer/Card/CustomerCard.vue index 8d6288fe5..ebeac4425 100644 --- a/src/pages/Customer/Card/CustomerCard.vue +++ b/src/pages/Customer/Card/CustomerCard.vue @@ -1,4 +1,5 @@ + + + { + "en": { + "searchLabel": "Search by customer id or name" + }, + "es": { + "searchLabel": "Buscar por id o nombre del cliente" + } + } + diff --git a/src/pages/Customer/CustomerFilter.vue b/src/pages/Customer/CustomerFilter.vue index dcc363487..5b44fceb6 100644 --- a/src/pages/Customer/CustomerFilter.vue +++ b/src/pages/Customer/CustomerFilter.vue @@ -1,8 +1,10 @@