From f171774605129b3529cd75891302ebb1e6f24fc1 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 19 Jul 2024 07:42:58 +0200 Subject: [PATCH] fix: refs #7323 fixed left filter --- src/components/ui/VnFilterPanel.vue | 17 +++++++++++++---- src/pages/Worker/Card/WorkerCard.vue | 2 +- src/pages/Worker/WorkerList.vue | 12 +++++++++--- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index b93ca7121..348ec8eea 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -108,11 +108,20 @@ const isLoading = ref(false); async function search(evt) { if (evt && $props.disableSubmitEvent) return; - store.filter.where = {}; + store.filter.where = Object.entries($props.modelValue).reduce((acc, [key, val]) => { + if (key.indexOf('.') > 0) { + acc[key] = val; + } + return acc; + }, {}); isLoading.value = true; - const filter = { ...userParams.value }; + const filter = { + ...userParams.value, + }; store.userParamsChanged = true; - const { params: newParams } = await arrayData.addFilter({ params: userParams.value }); + const { params: newParams } = await arrayData.addFilter({ + params: userParams.value, + }); userParams.value = newParams; if (!$props.showAll && !Object.values(filter).length) store.data = []; @@ -197,7 +206,7 @@ function formatValue(value) { color="primary" style="position: fixed; z-index: 1; right: 0; bottom: 0" icon="search" - @click="search()" + @click="search($event)" > diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue index fb9ab9666..1a5bacf2f 100644 --- a/src/pages/Worker/Card/WorkerCard.vue +++ b/src/pages/Worker/Card/WorkerCard.vue @@ -5,7 +5,7 @@ import WorkerFilter from '../WorkerFilter.vue';