This commit is contained in:
parent
e08f718975
commit
b1ad357bda
|
@ -86,18 +86,14 @@ if (props.redirect)
|
|||
let arrayData = useArrayData(props.dataKey, arrayDataProps);
|
||||
let store = arrayData.store;
|
||||
const to = computed(() => {
|
||||
const { params } = arrayData.getCurrentFilter();
|
||||
params.search = searchText.value || undefined;
|
||||
const url = { path: route.path, query: { ...(route.query ?? {}) } };
|
||||
const searchUrl = arrayData.store.searchUrl;
|
||||
const currentFilter = {
|
||||
...arrayData.store.currentFilter,
|
||||
search: searchText.value || undefined,
|
||||
};
|
||||
|
||||
for (const key in params) {
|
||||
const val = params[key];
|
||||
if (typeof val === 'object' && !Array.isArray(val) && !(val instanceof Date))
|
||||
params[key] = JSON.stringify(val);
|
||||
}
|
||||
|
||||
if (searchUrl) url.query[searchUrl] = JSON.stringify(params);
|
||||
if (searchUrl) url.query[searchUrl] = JSON.stringify(currentFilter);
|
||||
return url;
|
||||
});
|
||||
|
||||
|
@ -158,6 +154,7 @@ async function search() {
|
|||
</RouterLink>
|
||||
<VnInput
|
||||
id="searchbar"
|
||||
ref="input"
|
||||
v-model.trim="searchText"
|
||||
:placeholder="t(props.label)"
|
||||
dense
|
||||
|
|
Loading…
Reference in New Issue