This commit is contained in:
2024-07-02 18:38:11 +02:00
parent d2da96eaa3
commit d327277bac
14 changed files with 288 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
<script setup>
import {BlobReader, BlobWriter, ZipWriter} from "@zip.js/zip.js";
import {useSupabaseSelectDocuments} from "~/composables/useSupabase.js";
definePageMeta({
middleware: "auth"
@@ -24,15 +25,24 @@ const fileUploadFormData = ref({
let tags = dataStore.getDocumentTags
const selectedTags = ref("Eingang")
const documents = ref([])
const setupPage = async () => {
documents.value = await useSupabaseSelectDocuments("*, project(id,name), customer(id,name), contract(id,name), vendor(id,name), plant(id,name), vehicle(id,licensePlate), product(id,name), profile(id,fullName) ")
}
setupPage()
const filteredDocuments = computed(() => {
let returnList = []
returnList = dataStore.documents.filter(i => i.tags.filter(t => selectedTags.value === t).length > 0)
if(selectedTags.value !== "Archiviert") {
return documents.value.filter(i => i.tags.find(t => selectedTags.value === t) && !i.tags.includes("Archiviert"))
} else {
return documents.value.filter(i => i.tags.find(t => selectedTags.value === t))
}
//return dataStore.documents.filter(doc => doc.tags.filter(tag => selectedTags.value.find(t => t === tag)).length > 0)
return returnList
})