From 9506ed695b12584987d1d908773803c1b2bd7f85 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 9 Sep 2024 13:17:38 +0200 Subject: [PATCH] fix: refs #7909 rollback scroll --- src/components/common/VnLog.vue | 521 +++++++++++++++----------------- 1 file changed, 245 insertions(+), 276 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 1d5b2c182..2163d54d4 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -14,7 +14,6 @@ import VnJsonValue from '../common/VnJsonValue.vue'; import FetchData from '../FetchData.vue'; import VnSelect from './VnSelect.vue'; import VnUserLink from '../ui/VnUserLink.vue'; -import VnPaginate from '../ui/VnPaginate.vue'; const stateStore = useStateStore(); const validationsStore = useValidator(); @@ -69,7 +68,7 @@ const filter = { ], }; -const paginate = ref(); +const workers = ref(); const actions = ref(); const changeInput = ref(); const searchInput = ref(); @@ -236,8 +235,9 @@ async function openPointRecord(id, modelLog) { const locale = validations[modelLog.model]?.locale || {}; pointRecord.value = parseProps(propNames, locale, data); } -async function setLogTree(data) { +async function setLogTree() { filter.where = { and: [{ originFk: route.params.id }] }; + const { data } = await getLogs(filter); logTree.value = getLogTree(data); } @@ -266,7 +266,15 @@ async function applyFilter() { filter.where.and.push(selectedFilters.value); } - paginate.value.fetch(filter); + 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) }, + }); } function setDate(type) { @@ -369,6 +377,8 @@ async function clearFilter() { await applyFilter(); } +setLogTree(); + onUnmounted(() => { stateStore.rightDrawer = false; }); @@ -381,6 +391,16 @@ watch( );