fix: refs #7323 fixed left filter
This commit is contained in:
parent
4a544b0b6c
commit
f171774605
|
@ -108,11 +108,20 @@ const isLoading = ref(false);
|
||||||
async function search(evt) {
|
async function search(evt) {
|
||||||
if (evt && $props.disableSubmitEvent) return;
|
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;
|
isLoading.value = true;
|
||||||
const filter = { ...userParams.value };
|
const filter = {
|
||||||
|
...userParams.value,
|
||||||
|
};
|
||||||
store.userParamsChanged = true;
|
store.userParamsChanged = true;
|
||||||
const { params: newParams } = await arrayData.addFilter({ params: userParams.value });
|
const { params: newParams } = await arrayData.addFilter({
|
||||||
|
params: userParams.value,
|
||||||
|
});
|
||||||
userParams.value = newParams;
|
userParams.value = newParams;
|
||||||
|
|
||||||
if (!$props.showAll && !Object.values(filter).length) store.data = [];
|
if (!$props.showAll && !Object.values(filter).length) store.data = [];
|
||||||
|
@ -197,7 +206,7 @@ function formatValue(value) {
|
||||||
color="primary"
|
color="primary"
|
||||||
style="position: fixed; z-index: 1; right: 0; bottom: 0"
|
style="position: fixed; z-index: 1; right: 0; bottom: 0"
|
||||||
icon="search"
|
icon="search"
|
||||||
@click="search()"
|
@click="search($event)"
|
||||||
></QBtn>
|
></QBtn>
|
||||||
<QForm @submit="search" id="filterPanelForm">
|
<QForm @submit="search" id="filterPanelForm">
|
||||||
<QList dense>
|
<QList dense>
|
||||||
|
|
|
@ -5,7 +5,7 @@ import WorkerFilter from '../WorkerFilter.vue';
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCard
|
||||||
data-key="Worker"
|
data-key="Workers"
|
||||||
base-url="Workers"
|
base-url="Workers"
|
||||||
:descriptor="WorkerDescriptor"
|
:descriptor="WorkerDescriptor"
|
||||||
:filter-panel="WorkerFilter"
|
:filter-panel="WorkerFilter"
|
||||||
|
|
|
@ -29,6 +29,10 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'id',
|
name: 'id',
|
||||||
label: t('tableColumns.id'),
|
label: t('tableColumns.id'),
|
||||||
|
columnFilter: {
|
||||||
|
alias: 'w',
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
chip: {
|
chip: {
|
||||||
condition: () => true,
|
condition: () => true,
|
||||||
},
|
},
|
||||||
|
@ -39,6 +43,9 @@ const columns = computed(() => [
|
||||||
name: 'nickname',
|
name: 'nickname',
|
||||||
label: t('tableColumns.name'),
|
label: t('tableColumns.name'),
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
|
columnFilter: {
|
||||||
|
name: 'search',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -98,7 +105,7 @@ function uppercaseStreetModel(data) {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="WorkerList"
|
data-key="Worker"
|
||||||
:label="t('Search worker')"
|
:label="t('Search worker')"
|
||||||
:info="t('You can search by worker id or name')"
|
:info="t('You can search by worker id or name')"
|
||||||
/>
|
/>
|
||||||
|
@ -124,7 +131,7 @@ function uppercaseStreetModel(data) {
|
||||||
/>
|
/>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="worker"
|
data-key="Worker"
|
||||||
url="Workers/filter"
|
url="Workers/filter"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Workers/new',
|
urlCreate: 'Workers/new',
|
||||||
|
@ -137,7 +144,6 @@ function uppercaseStreetModel(data) {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
redirect="worker"
|
redirect="worker"
|
||||||
:use-model="true"
|
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
|
|
Loading…
Reference in New Issue