From 37b3affdbfc2c406b72116ac89657218e38f7adc Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 23 Oct 2024 13:02:28 +0200 Subject: [PATCH] refactor: revert catalog changes --- src/components/ui/VnFilterPanel.vue | 12 +-- src/components/ui/VnSearchbar.vue | 2 - src/pages/Order/Card/OrderCatalog.vue | 5 +- src/pages/Order/Card/OrderCatalogFilter.vue | 108 ++++++++------------ 4 files changed, 50 insertions(+), 77 deletions(-) diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 66e9df5f5..43d634ad9 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -185,9 +185,6 @@ async function remove(key) { } function formatValue(value) { - if (typeof value === 'object') { - return value; - } if (typeof value === 'boolean') return value ? t('Yes') : t('No'); if (isNaN(value) && !isNaN(Date.parse(value))) return toDate(value); @@ -196,13 +193,6 @@ function formatValue(value) { function sanitizer(params) { for (const [key, value] of Object.entries(params)) { - if (key == 'and') { - value.forEach((andValue) => { - params = { ...params, ...andValue }; - }); - delete params[key]; - } - if (value && typeof value === 'object') { const param = Object.values(value)[0]; if (typeof param == 'string') params[key] = param.replaceAll('%', ''); @@ -221,7 +211,7 @@ function sanitizer(params) { icon="search" @click="search()" > - + diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 569e0ed18..dc6d4751c 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -9,7 +9,6 @@ import { useStateStore } from 'src/stores/useStateStore'; const quasar = useQuasar(); const { t } = useI18n(); const state = useStateStore(); -const emit = defineEmits(['onSearch']); const props = defineProps({ dataKey: { @@ -119,7 +118,6 @@ async function search() { delete filter.params.search; } await arrayData.applyFilter(filter); - emit('onSearch', store.data); }