7383-testToMaster #370

Merged
alexm merged 365 commits from 7383-testToMaster into master 2024-05-14 05:46:56 +00:00
2 changed files with 4 additions and 34 deletions
Showing only changes of commit 955e196882 - Show all commits

View File

@ -78,23 +78,10 @@ watch(
); );
const isLoading = ref(false); const isLoading = ref(false);
function eliminarPropiedadesNull(objeto) {
for (let clave in objeto) {
if (objeto[clave] === null) {
delete objeto[clave];
}
}
return objeto;
}
async function search() { async function search() {
store.filter.where = {};
isLoading.value = true; isLoading.value = true;
const objetoSinNull = eliminarPropiedadesNull(userParams.value);
userParams.value = objetoSinNull;
const params = { ...userParams.value }; 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.userParamsChanged = true;
store.filter.skip = 0; store.filter.skip = 0;
store.skip = 0; store.skip = 0;
@ -158,26 +145,8 @@ const customTags = computed(() =>
tagsList.value.filter((tag) => (props.customTags || []).includes(tag.label)) 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) { async function remove(key) {
// userParams.value[key] = null; 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;
// }
await search(); await search();
emit('remove', key); emit('remove', key);
} }

View File

@ -60,7 +60,7 @@ const exprBuilder = (param, value) => ({
</template> </template>
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above> <QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
<QScrollArea class="fit text-grey-8"> <QScrollArea class="fit text-grey-8">
<ItemTypeFilter data-key="ItemTypeList" :expr-builder="exprBuilder" /> <ItemTypeFilter data-key="ItemTypeList" />
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
@ -70,6 +70,7 @@ const exprBuilder = (param, value) => ({
url="ItemTypes" url="ItemTypes"
:order="['name']" :order="['name']"
auto-load auto-load
:expr-builder="exprBuilder"
> >
<template #body="{ rows }"> <template #body="{ rows }">
<CardList <CardList