fix: add exprBuilder
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
c1ed4ab032
commit
0d50944c2d
|
@ -81,6 +81,8 @@ const isLoading = ref(false);
|
||||||
async function search() {
|
async function search() {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
const params = { ...userParams.value };
|
const params = { ...userParams.value };
|
||||||
|
if (Object.entries(params).length > 0) store.exprBuilder = props.exprBuilder;
|
||||||
|
|
||||||
store.userParamsChanged = true;
|
store.userParamsChanged = true;
|
||||||
store.filter.skip = 0;
|
store.filter.skip = 0;
|
||||||
store.skip = 0;
|
store.skip = 0;
|
||||||
|
@ -144,9 +146,25 @@ 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];
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,12 +29,22 @@ const emit = defineEmits(['search']);
|
||||||
<template #body="{ params }">
|
<template #body="{ params }">
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput :label="t('Name')" v-model="params.name" is-outlined />
|
<VnInput
|
||||||
|
@update:model-value="emit('search')"
|
||||||
|
:label="t('Name')"
|
||||||
|
v-model="params.name"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput v-model="params.code" :label="t('Code')" is-outlined />
|
<VnInput
|
||||||
|
@update:model-value="emit('search')"
|
||||||
|
v-model="params.code"
|
||||||
|
:label="t('Code')"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue