diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 94b64c0db..eb0bbbe66 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -78,23 +78,10 @@ watch( ); const isLoading = ref(false); -function eliminarPropiedadesNull(objeto) { - for (let clave in objeto) { - if (objeto[clave] === null) { - delete objeto[clave]; - } - } - return objeto; -} - async function search() { + store.filter.where = {}; isLoading.value = true; - const objetoSinNull = eliminarPropiedadesNull(userParams.value); - userParams.value = objetoSinNull; const params = { ...userParams.value }; - if (Object.entries(params).length > 0) store.exprBuilder = props.exprBuilder; - else delete store.filter.where; - store.userParams = userParams.value; store.userParamsChanged = true; store.filter.skip = 0; store.skip = 0; @@ -158,26 +145,8 @@ const customTags = computed(() => tagsList.value.filter((tag) => (props.customTags || []).includes(tag.label)) ); -// watch(tags, (now, before) => { -// if (now.length < before.length) { -// const beforeMap = before.map(({ label }) => label); -// const nowMap = now.map(({ label }) => label); -// const key = beforeMap.filter((elemento) => !nowMap.includes(elemento))[0]; -// remove(key ?? beforeMap[0]); -// } -// console.error(''); -// }); - async function remove(key) { - // userParams.value[key] = null; - if (userParams.value[key]) delete userParams.value[key]; - // if (Object.entries(userParams.value).length === 0) { - // store.exprBuilder = null; - // delete store.filter.where; - // } - // else { - // store.exprBuilder = props.exprBuilder; - // } + userParams.value[key] = null; await search(); emit('remove', key); } diff --git a/src/pages/Item/ItemTypeList.vue b/src/pages/Item/ItemTypeList.vue index 6e31cdd25..17d1c0044 100644 --- a/src/pages/Item/ItemTypeList.vue +++ b/src/pages/Item/ItemTypeList.vue @@ -60,7 +60,7 @@ const exprBuilder = (param, value) => ({ - + @@ -70,6 +70,7 @@ const exprBuilder = (param, value) => ({ url="ItemTypes" :order="['name']" auto-load + :expr-builder="exprBuilder" >