refactor: apply QPopupProxy
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
William Buezas 2024-11-07 19:16:06 -03:00
parent 498a52a3e5
commit 52a2250acc
1 changed files with 8 additions and 14 deletions

View File

@ -29,7 +29,6 @@ const props = defineProps({
},
});
const showValueFilterDialog = ref(false);
const categoryList = ref(null);
const selectedCategoryFk = ref(null);
const typeList = ref([]);
@ -104,14 +103,12 @@ const applyTags = (tagInfo, params, search) => {
if (!tagInfo || !tagInfo.values.length) {
params.tagGroups = null;
search();
toggleValueFilterDialog();
return;
}
if (!params.tagGroups) params.tagGroups = [];
params.tagGroups.push(tagInfo);
search();
toggleValueFilterDialog();
};
const removeTagGroupParam = (params, search, valIndex = null) => {
@ -149,10 +146,6 @@ function addOrder(value, field, params) {
vnFilterPanelRef.value.search();
}
const toggleValueFilterDialog = () => {
showValueFilterDialog.value = !showValueFilterDialog.value;
};
onMounted(() => {
selectedCategoryFk.value = getParamWhere(route, 'categoryFk');
selectedTypeFk.value = getParamWhere(route, 'typeFk');
@ -315,18 +308,19 @@ onMounted(() => {
flat
color="primary"
size="md"
@click="toggleValueFilterDialog()"
/>
<QPopupProxy>
<CatalogFilterValueDialog
:tags="tags"
@apply-tags="
($event) => applyTags($event, params, searchFn)
"
/>
</QPopupProxy>
</template>
</VnInput>
</QItem>
<QSeparator />
<QDialog v-model="showValueFilterDialog">
<CatalogFilterValueDialog
:tags="tags"
@apply-tags="($event) => applyTags($event, params, searchFn)"
/>
</QDialog>
</template>
</VnFilterPanel>
</template>