0
0
Fork 0

fix: refs #7323 fixed left filter

This commit is contained in:
Jon Elias 2024-07-19 07:42:58 +02:00
parent 4a544b0b6c
commit f171774605
3 changed files with 23 additions and 8 deletions

View File

@ -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)"
></QBtn>
<QForm @submit="search" id="filterPanelForm">
<QList dense>

View File

@ -5,7 +5,7 @@ import WorkerFilter from '../WorkerFilter.vue';
</script>
<template>
<VnCard
data-key="Worker"
data-key="Workers"
base-url="Workers"
:descriptor="WorkerDescriptor"
:filter-panel="WorkerFilter"

View File

@ -29,6 +29,10 @@ const columns = computed(() => [
align: 'left',
name: 'id',
label: t('tableColumns.id'),
columnFilter: {
alias: 'w',
inWhere: true,
},
chip: {
condition: () => true,
},
@ -39,6 +43,9 @@ const columns = computed(() => [
name: 'nickname',
label: t('tableColumns.name'),
isTitle: true,
columnFilter: {
name: 'search',
},
},
{
align: 'left',
@ -98,7 +105,7 @@ function uppercaseStreetModel(data) {
</script>
<template>
<VnSearchbar
data-key="WorkerList"
data-key="Worker"
:label="t('Search worker')"
:info="t('You can search by worker id or name')"
/>
@ -124,7 +131,7 @@ function uppercaseStreetModel(data) {
/>
<VnTable
ref="tableRef"
data-key="worker"
data-key="Worker"
url="Workers/filter"
:create="{
urlCreate: 'Workers/new',
@ -137,7 +144,6 @@ function uppercaseStreetModel(data) {
:columns="columns"
default-mode="table"
redirect="worker"
:use-model="true"
auto-load
>
<template #more-create-dialog="{ data }">