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