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