KI-AGENT: Tab und Pagination der Ausgangsbelege im Profil speichern
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 23s
Build and Push Docker Images / build-frontend (push) Successful in 1m13s
Build and Push Docker Images / build-central-services-api (push) Successful in 22s
Build and Push Docker Images / build-website (push) Successful in 22s
Build and Push Docker Images / build-central-services-admin (push) Successful in 21s
Build and Push Docker Images / build-docs (push) Successful in 22s
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 23s
Build and Push Docker Images / build-frontend (push) Successful in 1m13s
Build and Push Docker Images / build-central-services-api (push) Successful in 22s
Build and Push Docker Images / build-website (push) Successful in 22s
Build and Push Docker Images / build-central-services-admin (push) Successful in 21s
Build and Push Docker Images / build-docs (push) Successful in 22s
This commit is contained in:
@@ -46,7 +46,12 @@
|
||||
</USelectMenu>
|
||||
</template>
|
||||
</UDashboardToolbar>
|
||||
<UTabs :items="selectedTypes" class="m-3">
|
||||
<UTabs
|
||||
v-model="activeTabIndex"
|
||||
:items="selectedTypes"
|
||||
class="m-3"
|
||||
@update:model-value="storeActiveTab"
|
||||
>
|
||||
<template #default="{item}">
|
||||
{{ item.label }}
|
||||
<UBadge
|
||||
@@ -149,6 +154,7 @@
|
||||
:items-per-page="rowsPerPage"
|
||||
:total="getRowsForTab(item.key).length"
|
||||
:show-edges="true"
|
||||
@update:page="page => storeTabPage(item.key, page)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -171,8 +177,8 @@ const dataType = dataStore.dataTypes[type]
|
||||
|
||||
const items = ref([])
|
||||
const selectedItem = ref(0)
|
||||
const activeTabIndex = ref(0)
|
||||
const rowsPerPage = 100
|
||||
const storedListNavigation = tempStore.settings?.createddocumentsList || {}
|
||||
const tabPages = reactive({
|
||||
drafts: 1,
|
||||
invoices: 1,
|
||||
@@ -180,7 +186,8 @@ const tabPages = reactive({
|
||||
costEstimates: 1,
|
||||
deliveryNotes: 1,
|
||||
packingSlips: 1,
|
||||
confirmationOrders: 1
|
||||
confirmationOrders: 1,
|
||||
...(storedListNavigation.tabPages || {})
|
||||
})
|
||||
const sum = useSum()
|
||||
|
||||
@@ -276,6 +283,8 @@ const templateTypes = [
|
||||
{ key: "confirmationOrders", label: "Auftragsbestätigungen" }
|
||||
]
|
||||
const selectedTypes = ref(tempStore.filters["createddocuments"] ? tempStore.filters["createddocuments"] : templateTypes)
|
||||
const storedTabIndex = selectedTypes.value.findIndex(type => type.key === storedListNavigation.activeTabKey)
|
||||
const activeTabIndex = ref(String(storedTabIndex >= 0 ? storedTabIndex : 0))
|
||||
const types = computed(() => {
|
||||
return templateTypes.filter((type) => selectedTypes.value.find(i => i.key === type.key))
|
||||
})
|
||||
@@ -413,6 +422,24 @@ const rowsByTab = computed(() => {
|
||||
|
||||
const getRowsForTab = (tabKey) => rowsByTab.value[tabKey] || []
|
||||
|
||||
const storeListNavigation = () => {
|
||||
const activeTab = selectedTypes.value[Number(activeTabIndex.value)]
|
||||
|
||||
tempStore.modifySettings('createddocumentsList', {
|
||||
activeTabKey: activeTab?.key || selectedTypes.value[0]?.key,
|
||||
tabPages: {...tabPages}
|
||||
})
|
||||
}
|
||||
|
||||
const storeActiveTab = () => {
|
||||
storeListNavigation()
|
||||
}
|
||||
|
||||
const storeTabPage = (tabKey, page) => {
|
||||
tabPages[tabKey] = page
|
||||
storeListNavigation()
|
||||
}
|
||||
|
||||
const getVisibleRowsForTab = (tabKey) => {
|
||||
const rows = getRowsForTab(tabKey)
|
||||
const start = (tabPages[tabKey] - 1) * rowsPerPage
|
||||
@@ -423,5 +450,6 @@ watch([debouncedSearchString, selectedFilters, selectedTypes], () => {
|
||||
Object.keys(tabPages).forEach((key) => {
|
||||
tabPages[key] = 1
|
||||
})
|
||||
storeListNavigation()
|
||||
}, { deep: true })
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user