From 419d3d2d45b16d268da452d06fbc1aadfeb03707 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 10 Oct 2024 07:20:33 +0200 Subject: [PATCH 01/10] fix: refs #6896 fixed module problems --- src/components/ui/VnFilterPanel.vue | 12 ++- src/components/ui/VnSearchbar.vue | 2 + src/i18n/locale/en.yml | 2 + src/i18n/locale/es.yml | 4 +- src/pages/Order/Card/OrderCatalog.vue | 6 +- src/pages/Order/Card/OrderCatalogFilter.vue | 88 +++++++------------- src/pages/Order/Card/OrderDescriptor.vue | 10 +-- src/pages/Order/Card/OrderDescriptorMenu.vue | 7 +- src/pages/Order/Card/OrderLines.vue | 3 +- src/pages/Order/Card/OrderSummary.vue | 27 ++++++ 10 files changed, 87 insertions(+), 74 deletions(-) diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 43d634ad9..242c4220d 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -185,6 +185,9 @@ 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); @@ -193,6 +196,13 @@ 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('%', ''); @@ -211,7 +221,7 @@ function sanitizer(params) { icon="search" @click="search()" > - + diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index dc6d4751c..fc292e980 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -9,6 +9,7 @@ import { useStateStore } from 'src/stores/useStateStore'; const quasar = useQuasar(); const { t } = useI18n(); const state = useStateStore(); +const emit = defineEmits(['on-search']); const props = defineProps({ dataKey: { @@ -118,6 +119,7 @@ async function search() { delete filter.params.search; } await arrayData.applyFilter(filter); + emit('on-search', store.data); }