Hotfix: fixed filter when searching by id #1063
|
@ -51,10 +51,6 @@ const props = defineProps({
|
|||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
staticParams: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
exprBuilder: {
|
||||
type: Function,
|
||||
default: null,
|
||||
|
@ -67,6 +63,10 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: undefined,
|
||||
},
|
||||
beforeSearch: {
|
||||
type: Function,
|
||||
default: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
const searchText = ref();
|
||||
|
@ -103,7 +103,7 @@ async function search() {
|
|||
const staticParams = Object.entries(store.userParams);
|
||||
arrayData.reset(['skip', 'page']);
|
||||
|
||||
const filter = {
|
||||
let filter = {
|
||||
|
||||
params: {
|
||||
...Object.fromEntries(staticParams),
|
||||
search: searchText.value,
|
||||
|
@ -117,6 +117,7 @@ async function search() {
|
|||
};
|
||||
delete filter.params.search;
|
||||
}
|
||||
if (props.beforeSearch) filter = props.beforeSearch(filter);
|
||||
await arrayData.applyFilter(filter);
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -18,6 +18,13 @@ const { t } = useI18n();
|
|||
url: 'Tickets/filter',
|
||||
label: t('card.search'),
|
||||
info: t('card.searchInfo'),
|
||||
beforeSearch: (filter) => {
|
||||
if (filter.params.search) {
|
||||
delete filter.params.from;
|
||||
delete filter.params.to;
|
||||
}
|
||||
return filter;
|
||||
},
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -455,6 +455,15 @@ function setReference(data) {
|
|||
data-key="TicketList"
|
||||
:label="t('Search ticket')"
|
||||
:info="t('You can search by ticket id or alias')"
|
||||
:before-search="
|
||||
(filter) => {
|
||||
if (filter.params.search) {
|
||||
delete filter.params.from;
|
||||
delete filter.params.to;
|
||||
}
|
||||
return filter;
|
||||
}
|
||||
"
|
||||
/>
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
|
|
Loading…
Reference in New Issue
if (!searchText.value)