forked from verdnatura/salix-front
perf: improve ItemFixedPricefilterPanel
This commit is contained in:
parent
a8057b47dc
commit
31b8088b5f
|
@ -159,8 +159,8 @@ const removeTag = (index, params, search) => {
|
|||
/>
|
||||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:expr-builder="exprBuilder"
|
||||
:custom-tags="customTags"
|
||||
:expr-builder="props.exprBuilder"
|
||||
:custom-tags="props.customTags"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<strong v-if="tag.label === 'categoryFk'">
|
||||
|
|
|
@ -17,10 +17,6 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
const itemTypeWorkersOptions = ref([]);
|
||||
const $params = ref({});
|
||||
const pushParam = (param) => ({
|
||||
param: { [param]: $params.value[param] },
|
||||
});
|
||||
const exprBuilder = (param, value) => {
|
||||
switch (param) {
|
||||
case 'name':
|
||||
|
@ -46,11 +42,7 @@ const exprBuilder = (param, value) => {
|
|||
:filter="{ fields: ['id', 'nickname'], order: 'nickname ASC', limit: 30 }"
|
||||
@on-fetch="(data) => (itemTypeWorkersOptions = data)"
|
||||
/>
|
||||
<ItemsFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:custom-tags="['tags']"
|
||||
search-url="table"
|
||||
>
|
||||
<ItemsFilterPanel :data-key="props.dataKey" :custom-tags="['tags']">
|
||||
<template #body="{ params, searchFn }">
|
||||
<QItem class="q-my-md">
|
||||
<QItemSection>
|
||||
|
@ -110,27 +102,24 @@ const exprBuilder = (param, value) => {
|
|||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('components.itemsFilterPanel.mine')"
|
||||
v-model="$params.mine"
|
||||
:true-value="'true'"
|
||||
:false-value="'false'"
|
||||
@update:model-value="searchFn(pushParam('mine'))"
|
||||
v-model="params.mine"
|
||||
toggle-indeterminate
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
|
||||
<QCheckbox
|
||||
v-model="$params.showBadDates"
|
||||
v-model="params.showBadDates"
|
||||
:label="t(`components.itemsFilterPanel.showBadDates`)"
|
||||
:true-value="'true'"
|
||||
:false-value="'false'"
|
||||
@update:model-value="searchFn(pushParam('showBadDates'))"
|
||||
toggle-indeterminate
|
||||
@update:model-value="searchFn()"
|
||||
>
|
||||
</QCheckbox>
|
||||
|
||||
<QCheckbox
|
||||
:label="t('components.itemsFilterPanel.hasMinPrice')"
|
||||
v-model="$params.hasMinPrice"
|
||||
:true-value="'true'"
|
||||
:false-value="'false'"
|
||||
@update:model-value="searchFn(pushParam('hasMinPrice'))"
|
||||
v-model="params.hasMinPrice"
|
||||
toggle-indeterminate
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
Loading…
Reference in New Issue