forked from verdnatura/salix-front
refactor: refs #7323 hidden column filter proposal
This commit is contained in:
parent
6f6ab74220
commit
26cdae2384
|
@ -108,20 +108,11 @@ 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 = Object.entries($props.modelValue).reduce((acc, [key, val]) => {
|
store.filter.where = {};
|
||||||
if (key.indexOf('.') > 0) {
|
|
||||||
acc[key] = val;
|
|
||||||
}
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
const filter = {
|
const filter = { ...userParams.value };
|
||||||
...userParams.value,
|
|
||||||
};
|
|
||||||
store.userParamsChanged = true;
|
store.userParamsChanged = true;
|
||||||
const { params: newParams } = await arrayData.addFilter({
|
const { params: newParams } = await arrayData.addFilter({ params: userParams.value });
|
||||||
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 = [];
|
||||||
|
@ -206,7 +197,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($event)"
|
@click="search()"
|
||||||
></QBtn>
|
></QBtn>
|
||||||
<QForm @submit="search" id="filterPanelForm">
|
<QForm @submit="search" id="filterPanelForm">
|
||||||
<QList dense>
|
<QList dense>
|
||||||
|
|
|
@ -71,6 +71,7 @@ const columns = computed(() => [
|
||||||
alias: 'mu',
|
alias: 'mu',
|
||||||
inWhere: true,
|
inWhere: true,
|
||||||
},
|
},
|
||||||
|
hidden: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
|
Loading…
Reference in New Issue