forked from verdnatura/salix-front
refactor: refs #7909 improve applyFilter
This commit is contained in:
parent
77cb0ed7a8
commit
c7bb0333bd
|
@ -69,6 +69,7 @@ const filter = {
|
|||
],
|
||||
};
|
||||
|
||||
const paginate = ref();
|
||||
const actions = ref();
|
||||
const changeInput = ref();
|
||||
const searchInput = ref();
|
||||
|
@ -237,7 +238,6 @@ async function openPointRecord(id, modelLog) {
|
|||
}
|
||||
async function setLogTree(data) {
|
||||
filter.where = { and: [{ originFk: route.params.id }] };
|
||||
// const { data } = await getLogs(filter);
|
||||
logTree.value = getLogTree(data);
|
||||
}
|
||||
|
||||
|
@ -266,15 +266,7 @@ async function applyFilter() {
|
|||
filter.where.and.push(selectedFilters.value);
|
||||
}
|
||||
|
||||
const { data } = await getLogs(filter);
|
||||
|
||||
logTree.value = getLogTree(data);
|
||||
}
|
||||
|
||||
async function getLogs(filter) {
|
||||
return axios.get(props.url ?? `${props.model}Logs`, {
|
||||
params: { filter: JSON.stringify(filter) },
|
||||
});
|
||||
paginate.value.fetch(filter);
|
||||
}
|
||||
|
||||
function setDate(type) {
|
||||
|
@ -407,6 +399,7 @@ watch(
|
|||
auto-load
|
||||
/>
|
||||
<VnPaginate
|
||||
ref="paginate"
|
||||
:data-key="`${model}Log`"
|
||||
:url="`${model}Logs`"
|
||||
:filter="filter"
|
||||
|
|
Loading…
Reference in New Issue