Fixed loading

This commit is contained in:
2025-11-10 12:06:34 +01:00
parent 1beb0dbaf3
commit d6dd0a1602
2 changed files with 6 additions and 5 deletions

View File

@@ -129,11 +129,11 @@ const setupPage = async () => {
items.value = data
itemsMeta.value = meta
if(!initialSetupDone.value){
Object.keys(tempStore.filters[type]).forEach((column) => {
Object.keys(tempStore.filters[type] || {}).forEach((column) => {
columnsToFilter.value[column] = tempStore.filters[type][column]
})
Object.keys(itemsMeta.value.distinctValues).filter(i => !Object.keys(tempStore.filters[type]).includes(i)).forEach(distinctValue => {
Object.keys(itemsMeta.value.distinctValues).filter(i => !Object.keys(tempStore.filters[type] || {}).includes(i)).forEach(distinctValue => {
columnsToFilter.value[distinctValue] = itemsMeta.value.distinctValues[distinctValue]
})
}
@@ -305,7 +305,7 @@ const handleFilterChange = async (action,column) => {
sort-mode="manual"
v-model:sort="sort"
@update:sort="setupPage"
v-if="dataType && columns && items.length > 0"
v-if="dataType && columns && items.length > 0 && !loading"
:rows="items"
:columns="columns"
class="w-full"
@@ -436,7 +436,7 @@ const handleFilterChange = async (action,column) => {
</UTable>
<UCard
class="w-1/3 mx-auto mt-10"
v-else
v-else-if="!loading"
>
<div
class="flex flex-col text-center"
@@ -450,6 +450,7 @@ const handleFilterChange = async (action,column) => {
</UCard>
<UProgress v-else animation="carousel" class="w-3/4 mx-auto mt-5"></UProgress>
</template>
<style scoped>

View File

@@ -31,7 +31,7 @@ export const useTempStore = defineStore('temp', () => {
columns.value = config.columns
pages.value = config.pages
settings.value = config.settings
filters.value = config.filters
filters.value = config.filters || {}
}
function modifySearchString(type,input) {