Many Changes
This commit is contained in:
@@ -57,8 +57,8 @@ const updateDocument = async () => {
|
||||
}
|
||||
|
||||
const archiveDocument = () => {
|
||||
documentData.tags.push("Archiviert")
|
||||
updateDocument()
|
||||
//documentData.tags.push("Archiviert")
|
||||
//updateDocument()
|
||||
}
|
||||
|
||||
const resourceOptions = ref([
|
||||
@@ -106,7 +106,7 @@ const updateDocumentAssignment = async () => {
|
||||
<iframe
|
||||
:src="`${documentData.url}#toolbar=0&navpanes=0&scrollbar=0`"
|
||||
class="previewEmbed"
|
||||
v-if="!documentData.tags.includes('Bild')"
|
||||
v-if="!documentData.filetags.includes('Bild')"
|
||||
loading="lazy"
|
||||
/>
|
||||
<img
|
||||
@@ -121,9 +121,9 @@ const updateDocumentAssignment = async () => {
|
||||
|
||||
<InputGroup class="mt-3 flex-wrap">
|
||||
<UBadge
|
||||
v-for="tag in documentData.tags"
|
||||
v-for="tag in documentData.filetags"
|
||||
|
||||
><span class="text-nowrap">{{ tag }}</span></UBadge>
|
||||
><span class="text-nowrap">{{ tag.name }}</span></UBadge>
|
||||
</InputGroup>
|
||||
|
||||
|
||||
@@ -157,9 +157,9 @@ const updateDocumentAssignment = async () => {
|
||||
<div class="flex flex-row justify-between">
|
||||
<div class="flex items-center gap-2">
|
||||
<UBadge
|
||||
v-for="tag in documentData.tags"
|
||||
v-for="tag in documentData.filetags"
|
||||
>
|
||||
{{tag}}
|
||||
{{tag.name}}
|
||||
</UBadge>
|
||||
</div>
|
||||
<UButton color="gray" variant="ghost" icon="i-heroicons-x-mark-20-solid" class="-my-1" @click="openShowModal = false" />
|
||||
@@ -172,7 +172,7 @@ const updateDocumentAssignment = async () => {
|
||||
class="bigPreview"
|
||||
:data="`${documentData.url}#toolbar=0&navpanes=0&scrollbar=0`"
|
||||
type="application/pdf"
|
||||
v-if="!documentData.tags.includes('Bild')"
|
||||
v-if="!documentData.filetags.includes('Bild')"
|
||||
|
||||
/>
|
||||
<img
|
||||
@@ -186,11 +186,11 @@ const updateDocumentAssignment = async () => {
|
||||
<template #footer>
|
||||
|
||||
<UButtonGroup>
|
||||
<UButton
|
||||
<!-- <UButton
|
||||
@click="archiveDocument"
|
||||
>
|
||||
Archivieren
|
||||
</UButton>
|
||||
</UButton>-->
|
||||
<UButton
|
||||
:to="documentData.url"
|
||||
variant="outline"
|
||||
@@ -206,12 +206,12 @@ const updateDocumentAssignment = async () => {
|
||||
>
|
||||
<USelectMenu
|
||||
:options="tags"
|
||||
v-model="documentData.tags"
|
||||
v-model="documentData.filetags"
|
||||
@change="updateDocument"
|
||||
multiple
|
||||
>
|
||||
<template #label>
|
||||
{{documentData.tags.length}} ausgewählt
|
||||
{{documentData.filetags.length}} ausgewählt
|
||||
</template>
|
||||
</USelectMenu>
|
||||
</UFormGroup>
|
||||
|
||||
196
components/DocumentDisplayModal.vue
Normal file
196
components/DocumentDisplayModal.vue
Normal file
@@ -0,0 +1,196 @@
|
||||
<script setup>
|
||||
|
||||
const toast = useToast()
|
||||
const supabase = useSupabaseClient()
|
||||
const dataStore = useDataStore()
|
||||
const profileStore = useProfileStore()
|
||||
const router = useRouter()
|
||||
const modal = useModal()
|
||||
const props = defineProps({
|
||||
documentData: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
openShowModal: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
},
|
||||
returnEmit: {
|
||||
type: Boolean
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
const emits = defineEmits("close")
|
||||
|
||||
const showSlideover = ref(props.openShowModal)
|
||||
|
||||
|
||||
|
||||
|
||||
//Functions
|
||||
const openDocument = async () => {
|
||||
//selectedDocument.value = doc
|
||||
openShowModal.value = true
|
||||
console.log("open")
|
||||
}
|
||||
|
||||
const updateDocument = async () => {
|
||||
console.log("Update")
|
||||
|
||||
const {url, ...objData} = props.documentData
|
||||
delete objData.url
|
||||
delete objData.filetags
|
||||
|
||||
|
||||
const {data,error} = await supabase
|
||||
.from("files")
|
||||
.update(objData)
|
||||
.eq('id',objData.id)
|
||||
.select()
|
||||
|
||||
if(error) {
|
||||
console.log(error)
|
||||
} else {
|
||||
toast.add({title: "Datei aktualisiert"})
|
||||
//openShowModal.value = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const archiveDocument = () => {
|
||||
//documentData.tags.push("Archiviert")
|
||||
//updateDocument()
|
||||
}
|
||||
|
||||
const resourceOptions = ref([
|
||||
{label: 'Projekt', value: 'project', optionAttr: "name"},
|
||||
{label: 'Kunde', value: 'customer', optionAttr: "name"},
|
||||
{label: 'Lieferant', value: 'vendor', optionAttr: "name"},
|
||||
{label: 'Fahrzeug', value: 'vehicle', optionAttr: "licensePlate"},
|
||||
{label: 'Objekt', value: 'plant', optionAttr: "name"},
|
||||
{label: 'Vertrag', value: 'contract', optionAttr: "name"},
|
||||
{label: 'Produkt', value: 'product', optionAttr: "name"}
|
||||
])
|
||||
const resourceToAssign = ref("project")
|
||||
const itemOptions = ref([])
|
||||
const idToAssign = ref(null)
|
||||
const getItemsBySelectedResource = () => {
|
||||
if(resourceToAssign.value === "project") {
|
||||
itemOptions.value = dataStore.projects
|
||||
} else if(resourceToAssign.value === "customer") {
|
||||
itemOptions.value = dataStore.customers
|
||||
} else if(resourceToAssign.value === "vendor") {
|
||||
itemOptions.value = dataStore.vendors
|
||||
} else if(resourceToAssign.value === "vehicle") {
|
||||
itemOptions.value = dataStore.vehicles
|
||||
} else if(resourceToAssign.value === "product") {
|
||||
itemOptions.value = dataStore.products
|
||||
} else if(resourceToAssign.value === "plant") {
|
||||
itemOptions.value = dataStore.plants
|
||||
} else if(resourceToAssign.value === "contract") {
|
||||
itemOptions.value = dataStore.contracts
|
||||
} else {
|
||||
itemOptions.value = []
|
||||
}
|
||||
}
|
||||
getItemsBySelectedResource()
|
||||
|
||||
const updateDocumentAssignment = async () => {
|
||||
props.documentData[resourceToAssign.value] = idToAssign.value
|
||||
await updateDocument()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UModal >
|
||||
<UCard :ui="{ body: { base: 'flex-1' }, ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }">
|
||||
<template #header>
|
||||
<div class="flex flex-row justify-between">
|
||||
<div class="flex items-center gap-2">
|
||||
<UBadge
|
||||
v-for="tag in props.documentData.filetags"
|
||||
>
|
||||
{{tag.name}}
|
||||
</UBadge>
|
||||
</div>
|
||||
<UButton color="gray" variant="ghost" icon="i-heroicons-x-mark-20-solid" class="-my-1" @click="modal.close()" />
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<div class="flex flex-row">
|
||||
<div class="w-1/2">
|
||||
<object
|
||||
class="bigPreview"
|
||||
:data="`${props.documentData.url}#toolbar=0&navpanes=0&scrollbar=0`"
|
||||
type="application/pdf"
|
||||
v-if="!props.documentData.filetags.includes('Bild')"
|
||||
|
||||
/>
|
||||
<img
|
||||
class=" w-full"
|
||||
:src="props.documentData.url"
|
||||
alt=""
|
||||
v-else
|
||||
/>
|
||||
</div>
|
||||
<div class="w-1/2 p-5">
|
||||
<UButtonGroup>
|
||||
<!-- <UButton
|
||||
@click="archiveDocument"
|
||||
>
|
||||
Archivieren
|
||||
</UButton>-->
|
||||
<UButton
|
||||
:to="props.documentData.url"
|
||||
variant="outline"
|
||||
icon="i-heroicons-arrow-top-right-on-square"
|
||||
target="_blank"
|
||||
>
|
||||
Öffnen
|
||||
</UButton>
|
||||
</UButtonGroup>
|
||||
|
||||
|
||||
<p>Dokument zuweisen:</p>
|
||||
<UFormGroup
|
||||
label="Resource auswählen"
|
||||
>
|
||||
<USelectMenu
|
||||
:options="resourceOptions"
|
||||
v-model="resourceToAssign"
|
||||
value-attribute="value"
|
||||
option-attribute="label"
|
||||
@change="getItemsBySelectedResource"
|
||||
>
|
||||
|
||||
</USelectMenu>
|
||||
</UFormGroup>
|
||||
<UFormGroup
|
||||
label="Eintrag auswählen:"
|
||||
>
|
||||
|
||||
</UFormGroup>
|
||||
|
||||
<USelectMenu
|
||||
:options="itemOptions"
|
||||
v-model="idToAssign"
|
||||
:option-attribute="resourceOptions.find(i => i.value === resourceToAssign)? resourceOptions.find(i => i.value === resourceToAssign).optionAttr : 'name'"
|
||||
value-attribute="id"
|
||||
@change="updateDocumentAssignment"
|
||||
></USelectMenu>
|
||||
</div>
|
||||
</div>
|
||||
</UCard>
|
||||
</UModal>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.bigPreview {
|
||||
width: 100%;
|
||||
aspect-ratio: 1/ 1.414;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -145,6 +145,19 @@ const contentChanged = (content, datapoint) => {
|
||||
>{{item.id ? `${dataType.labelSingle} bearbeiten` : `${dataType.labelSingle} erstellen` }}</h1>
|
||||
</template>
|
||||
<template #right>
|
||||
<ButtonWithConfirm
|
||||
color="rose"
|
||||
variant="outline"
|
||||
@confirmed="dataStore.updateItem(type,{...item,archived: true}, oldItem)"
|
||||
>
|
||||
<template #button>
|
||||
Archivieren
|
||||
</template>
|
||||
<template #header>
|
||||
<span class="text-md text-black font-bold">Archivieren bestätigen</span>
|
||||
</template>
|
||||
Möchten Sie das {{dataType.labelSingle}} {{item[dataType.templateColumns.find(i => i.title).key]}} wirklich archivieren?
|
||||
</ButtonWithConfirm>
|
||||
<UButton
|
||||
v-if="item.id"
|
||||
@click="dataStore.updateItem(type,item, oldItem)"
|
||||
@@ -172,8 +185,8 @@ const contentChanged = (content, datapoint) => {
|
||||
>
|
||||
<div class="flex flex-row">
|
||||
<div
|
||||
v-for="columnName in dataType.inputColumns"
|
||||
class="w-1/2 mr-5"
|
||||
v-for="(columnName,index) in dataType.inputColumns"
|
||||
:class="['w-1/2', ... index < dataType.inputColumns.length -1 ? ['mr-5'] : []]"
|
||||
>
|
||||
<UDivider>{{columnName}}</UDivider>
|
||||
|
||||
@@ -192,8 +205,9 @@ const contentChanged = (content, datapoint) => {
|
||||
:item="item"
|
||||
/>
|
||||
</template>
|
||||
<div v-if="datapoint.key.includes('.')">
|
||||
<InputGroup class="w-full" v-if="datapoint.key.includes('.')">
|
||||
<UInput
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-if="['text','number'].includes(datapoint.inputType)"
|
||||
v-model="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||
@@ -212,6 +226,7 @@ const contentChanged = (content, datapoint) => {
|
||||
:disabled="datapoint.disabledFunction ? datapoint.disabledFunction(item) : false"
|
||||
/>
|
||||
<USelectMenu
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'select'"
|
||||
v-model="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||
@@ -228,6 +243,7 @@ const contentChanged = (content, datapoint) => {
|
||||
</template>
|
||||
</USelectMenu>
|
||||
<UTextarea
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'textarea'"
|
||||
v-model="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||
@@ -275,9 +291,18 @@ const contentChanged = (content, datapoint) => {
|
||||
@updateContent="(i) => contentChanged(i,datapoint)"
|
||||
:preloadedContent="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]].html"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
|
||||
<UButton
|
||||
v-if="['text','number','select','date','datetime','textarea'].includes(datapoint.inputType)"
|
||||
@click="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]] = null"
|
||||
variant="outline"
|
||||
color="white"
|
||||
icon="i-heroicons-x-mark"
|
||||
/>
|
||||
</InputGroup>
|
||||
<InputGroup class="w-full" v-else>
|
||||
<UInput
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-if="['text','number'].includes(datapoint.inputType)"
|
||||
v-model="item[datapoint.key]"
|
||||
@@ -296,6 +321,7 @@ const contentChanged = (content, datapoint) => {
|
||||
:disabled="datapoint.disabledFunction ? datapoint.disabledFunction(item) : false"
|
||||
/>
|
||||
<USelectMenu
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'select'"
|
||||
v-model="item[datapoint.key]"
|
||||
@@ -313,6 +339,7 @@ const contentChanged = (content, datapoint) => {
|
||||
</template>
|
||||
</USelectMenu>
|
||||
<UTextarea
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'textarea'"
|
||||
v-model="item[datapoint.key]"
|
||||
@@ -358,7 +385,15 @@ const contentChanged = (content, datapoint) => {
|
||||
@updateContent="(i) => contentChanged(i,datapoint)"
|
||||
:preloadedContent="item[datapoint.key].html"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<UButton
|
||||
v-if="['text','number','select','date','datetime','textarea'].includes(datapoint.inputType)"
|
||||
@click="item[datapoint.key] = null"
|
||||
variant="outline"
|
||||
color="white"
|
||||
icon="i-heroicons-x-mark"
|
||||
/>
|
||||
</InputGroup>
|
||||
<div
|
||||
v-if="profileStore.ownTenant.ownFields"
|
||||
>
|
||||
@@ -387,7 +422,7 @@ const contentChanged = (content, datapoint) => {
|
||||
</div>
|
||||
</div>
|
||||
<UFormGroup
|
||||
v-for="datapoint in dataType.templateColumns.filter(i => i.inputType && i.inputColumn === columnName)"
|
||||
v-for="datapoint in dataType.templateColumns.filter(i => i.inputType && !i.inputColumn)"
|
||||
:label="datapoint.label"
|
||||
>
|
||||
<template #help>
|
||||
@@ -397,8 +432,9 @@ const contentChanged = (content, datapoint) => {
|
||||
:item="item"
|
||||
/>
|
||||
</template>
|
||||
<div v-if="datapoint.key.includes('.')">
|
||||
<InputGroup class="w-full" v-if="datapoint.key.includes('.')">
|
||||
<UInput
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-if="['text','number'].includes(datapoint.inputType)"
|
||||
v-model="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||
@@ -417,6 +453,7 @@ const contentChanged = (content, datapoint) => {
|
||||
:disabled="datapoint.disabledFunction ? datapoint.disabledFunction(item) : false"
|
||||
/>
|
||||
<USelectMenu
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'select'"
|
||||
v-model="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||
@@ -433,6 +470,7 @@ const contentChanged = (content, datapoint) => {
|
||||
</template>
|
||||
</USelectMenu>
|
||||
<UTextarea
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'textarea'"
|
||||
v-model="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||
@@ -480,9 +518,18 @@ const contentChanged = (content, datapoint) => {
|
||||
@updateContent="(i) => contentChanged(i,datapoint)"
|
||||
:preloadedContent="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]].html"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
|
||||
<UButton
|
||||
v-if="['text','number','select','date','datetime','textarea'].includes(datapoint.inputType)"
|
||||
@click="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]] = null"
|
||||
variant="outline"
|
||||
color="white"
|
||||
icon="i-heroicons-x-mark"
|
||||
/>
|
||||
</InputGroup>
|
||||
<InputGroup class="w-full" v-else>
|
||||
<UInput
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-if="['text','number'].includes(datapoint.inputType)"
|
||||
v-model="item[datapoint.key]"
|
||||
@@ -501,6 +548,7 @@ const contentChanged = (content, datapoint) => {
|
||||
:disabled="datapoint.disabledFunction ? datapoint.disabledFunction(item) : false"
|
||||
/>
|
||||
<USelectMenu
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'select'"
|
||||
v-model="item[datapoint.key]"
|
||||
@@ -518,6 +566,7 @@ const contentChanged = (content, datapoint) => {
|
||||
</template>
|
||||
</USelectMenu>
|
||||
<UTextarea
|
||||
class="flex-auto"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'textarea'"
|
||||
v-model="item[datapoint.key]"
|
||||
@@ -563,7 +612,15 @@ const contentChanged = (content, datapoint) => {
|
||||
@updateContent="(i) => contentChanged(i,datapoint)"
|
||||
:preloadedContent="item[datapoint.key].html"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<UButton
|
||||
v-if="['text','number','select','date','datetime','textarea'].includes(datapoint.inputType)"
|
||||
@click="item[datapoint.key] = null"
|
||||
variant="outline"
|
||||
color="white"
|
||||
icon="i-heroicons-x-mark"
|
||||
/>
|
||||
</InputGroup>
|
||||
<div
|
||||
v-if="profileStore.ownTenant.ownFields"
|
||||
>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script setup>
|
||||
import dayjs from "dayjs";
|
||||
import {useSupabaseSelectSomeDocuments} from "~/composables/useSupabase.js";
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
@@ -36,14 +35,15 @@ const router = useRouter()
|
||||
const dataStore = useDataStore()
|
||||
const profileStore = useProfileStore()
|
||||
const supabase = useSupabaseClient()
|
||||
const files = useFiles()
|
||||
|
||||
const dataType = dataStore.dataTypes[type]
|
||||
|
||||
const documents = ref([])
|
||||
const availableFiles = ref([])
|
||||
|
||||
const setup = async () => {
|
||||
if(props.item.documents) {
|
||||
documents.value = await useSupabaseSelectSomeDocuments(props.item.documents.map(i => i.id)) || []
|
||||
if(props.item.files) {
|
||||
availableFiles.value = await files.selectSomeDocuments(props.item.files.map(i => i.id)) || []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,19 +154,6 @@ const getAvailableQueryStringData = () => {
|
||||
>{{item ? `${dataType.labelSingle}${props.item[dataType.templateColumns.find(i => i.title).key] ? ': ' + props.item[dataType.templateColumns.find(i => i.title).key] : ''}`: '' }}</h1>
|
||||
</template>
|
||||
<template #right>
|
||||
<ButtonWithConfirm
|
||||
color="rose"
|
||||
variant="outline"
|
||||
@confirmed="dataStore.updateItem(type,{...item, archived: true})"
|
||||
>
|
||||
<template #button>
|
||||
Archivieren
|
||||
</template>
|
||||
<template #header>
|
||||
<span class="text-md text-black font-bold">Archivieren bestätigen</span>
|
||||
</template>
|
||||
Möchten Sie das Fahrzeug {{item.name}} wirklich archivieren?
|
||||
</ButtonWithConfirm>
|
||||
<UButton
|
||||
@click="router.push(`/standardEntity/${type}/edit/${item.id}`)"
|
||||
>
|
||||
@@ -174,25 +161,22 @@ const getAvailableQueryStringData = () => {
|
||||
</UButton>
|
||||
</template>
|
||||
</UDashboardNavbar>
|
||||
<UDashboardPanelContent>
|
||||
|
||||
</UDashboardPanelContent>
|
||||
<UTabs
|
||||
:items="dataType.showTabs"
|
||||
v-if="props.item.id"
|
||||
class="p-5"
|
||||
v-model="openTab"
|
||||
>
|
||||
<template #item="{item}">
|
||||
<template #item="{item:tab}">
|
||||
<div class="scroll">
|
||||
<div v-if="item.label === 'Informationen'" class="flex flex-row mt-5">
|
||||
<div v-if="tab.label === 'Informationen'" class="flex flex-row mt-5">
|
||||
<UCard class="w-1/2 mr-5">
|
||||
<UAlert
|
||||
v-if="item.archived"
|
||||
color="rose"
|
||||
variant="outline"
|
||||
:title="`${dataType.labelSingle} archiviert`"
|
||||
icon="i-heroicons-light-bulb"
|
||||
icon="i-heroicons-archive-box"
|
||||
class="mb-5"
|
||||
/>
|
||||
<div class="text-wrap">
|
||||
@@ -225,7 +209,7 @@ const getAvailableQueryStringData = () => {
|
||||
/>
|
||||
</UCard>
|
||||
</div>
|
||||
<div v-else-if="item.label === 'Dokumente'">
|
||||
<div v-else-if="tab.label === 'Dateien'">
|
||||
<UCard class="mt-5">
|
||||
<Toolbar>
|
||||
<DocumentUpload
|
||||
@@ -235,11 +219,17 @@ const getAvailableQueryStringData = () => {
|
||||
</Toolbar>
|
||||
|
||||
<DocumentList
|
||||
:documents="documents"
|
||||
:documents="availableFiles"
|
||||
v-if="availableFiles.length > 0"
|
||||
/>
|
||||
<UAlert
|
||||
v-else
|
||||
icon="i-heroicons-x-mark"
|
||||
title="Keine Dateien verfügbar"
|
||||
/>
|
||||
</UCard>
|
||||
</div>
|
||||
<div v-else-if="item.label === 'Projekte'">
|
||||
<div v-else-if="tab.label === 'Projekte'">
|
||||
<UCard class="mt-5">
|
||||
<Toolbar>
|
||||
<UButton
|
||||
@@ -262,7 +252,7 @@ const getAvailableQueryStringData = () => {
|
||||
|
||||
</UCard>
|
||||
</div>
|
||||
<div v-else-if="item.label === 'Objekte'">
|
||||
<div v-else-if="tab.label === 'Objekte'">
|
||||
<UCard class="mt-5">
|
||||
<Toolbar>
|
||||
<UButton
|
||||
@@ -288,7 +278,7 @@ const getAvailableQueryStringData = () => {
|
||||
</UTable>
|
||||
</UCard>
|
||||
</div>
|
||||
<div v-else-if="item.label === 'Aufgaben'">
|
||||
<div v-else-if="tab.label === 'Aufgaben'">
|
||||
<UCard class="mt-5">
|
||||
<Toolbar>
|
||||
<UButton
|
||||
@@ -305,7 +295,7 @@ const getAvailableQueryStringData = () => {
|
||||
/>
|
||||
</UCard>
|
||||
</div>
|
||||
<div v-else-if="item.label === 'Verträge'">
|
||||
<div v-else-if="tab.label === 'Verträge'">
|
||||
<UCard class="mt-5">
|
||||
<Toolbar>
|
||||
<UButton
|
||||
@@ -323,7 +313,7 @@ const getAvailableQueryStringData = () => {
|
||||
></UTable>
|
||||
</UCard>
|
||||
</div>
|
||||
<div v-else-if="item.label === 'Überprüfungen'">
|
||||
<div v-else-if="tab.label === 'Überprüfungen'">
|
||||
<UCard class="mt-5">
|
||||
<UTable
|
||||
:rows="props.item.checks"
|
||||
@@ -341,7 +331,7 @@ const getAvailableQueryStringData = () => {
|
||||
</UTable>
|
||||
</UCard>
|
||||
</div>
|
||||
<div v-else-if="item.label === 'Phasen'">
|
||||
<div v-else-if="tab.label === 'Phasen'">
|
||||
<UCard class="mt-5">
|
||||
<UAccordion
|
||||
:items="renderedPhases"
|
||||
@@ -404,7 +394,8 @@ const getAvailableQueryStringData = () => {
|
||||
</template>
|
||||
</UAccordion>
|
||||
</UCard>
|
||||
</div><div v-else-if="item.label === 'Ausgangsbelege'">
|
||||
</div>
|
||||
<div v-else-if="tab.label === 'Ausgangsbelege'">
|
||||
<UCard class="mt-5">
|
||||
|
||||
<Toolbar>
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
import dayjs from "dayjs"
|
||||
const props = defineProps({
|
||||
type: {
|
||||
required: true,
|
||||
type: String
|
||||
},
|
||||
elementId: {
|
||||
required: true,
|
||||
type: String
|
||||
},
|
||||
renderHeadline: {
|
||||
@@ -26,43 +24,12 @@ const items = ref([])
|
||||
|
||||
const setup = async () => {
|
||||
|
||||
items.value = (await supabase.from("historyitems").select().eq(type,elementId).order("created_at",{ascending: true})).data || []
|
||||
if(type && elementId){
|
||||
items.value = (await supabase.from("historyitems").select().eq(type,elementId).order("created_at",{ascending: true})).data || []
|
||||
} else {
|
||||
items.value = (await supabase.from("historyitems").select().order("created_at",{ascending: true})).data || []
|
||||
|
||||
/*if(type === "customer") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("customer",elementId)).data || []
|
||||
} else if(type === "vendor") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("vendor",elementId)).data || []
|
||||
} else if(type === "project") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("project",elementId)).data || []
|
||||
} else if(type === "plant") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("plant",elementId)).data || []
|
||||
} else if(type === "incomingInvoice") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("incomingInvoice",elementId)).data || []
|
||||
} else if(type === "document") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("document",elementId)).data || []
|
||||
} else if(type === "contact") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("contact",elementId)).data || []
|
||||
} else if(type === "contract") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("contract",elementId)).data || []
|
||||
} else if(type === "inventoryitem") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("inventoryitem",elementId)).data || []
|
||||
} else if(type === "product") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("product",elementId)).data || []
|
||||
} else if(type === "profile") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("profile",elementId)).data || []
|
||||
} else if(type === "absencerequest") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("absenceRequest",elementId)).data || []
|
||||
} else if(type === "event") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("event",elementId)).data || []
|
||||
} else if(type === "task") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("task",elementId)).data || []
|
||||
} else if(type === "vehicle") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("vehicle",elementId)).data || []
|
||||
} else if(type === "space") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("space",elementId)).data || []
|
||||
} else if(type === "trackingtrip") {
|
||||
items.value = (await supabase.from("historyitems").select().eq("trackingtrip",elementId)).data || []
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
setup()
|
||||
@@ -162,7 +129,7 @@ const renderText = (text) => {
|
||||
</UCard>
|
||||
</UModal>
|
||||
<Toolbar
|
||||
v-if="!renderHeadline"
|
||||
v-if="!renderHeadline && elementId && type"
|
||||
>
|
||||
<UButton
|
||||
@click="showAddHistoryItemModal = true"
|
||||
@@ -170,7 +137,7 @@ const renderText = (text) => {
|
||||
+ Eintrag
|
||||
</UButton>
|
||||
</Toolbar>
|
||||
<div v-else>
|
||||
<div v-else-if="renderHeadline && elementId && type">
|
||||
<div :class="`flex justify-between`">
|
||||
<p class=""><span class="text-xl">Logbuch</span> <UBadge variant="outline">{{items.length}}</UBadge></p>
|
||||
<UButton
|
||||
|
||||
@@ -18,6 +18,11 @@ const links = computed(() => {
|
||||
label: "Dashboard",
|
||||
to: "/",
|
||||
icon: "i-heroicons-home"
|
||||
}, {
|
||||
id: 'historyitems',
|
||||
label: "Logbuch",
|
||||
to: "/historyitems",
|
||||
icon: "i-heroicons-book-open"
|
||||
},
|
||||
{
|
||||
label: "Organisation",
|
||||
@@ -46,7 +51,7 @@ const links = computed(() => {
|
||||
}] : [],
|
||||
{
|
||||
label: "Dateien",
|
||||
to: "/documents",
|
||||
to: "/files",
|
||||
icon: "i-heroicons-document"
|
||||
},
|
||||
]
|
||||
@@ -113,6 +118,11 @@ const links = computed(() => {
|
||||
to: "/standardEntity/absencerequests",
|
||||
icon: "i-heroicons-document-text"
|
||||
}] : [],
|
||||
{
|
||||
label: "Fahrten",
|
||||
to: "/trackingTrips",
|
||||
icon: "i-heroicons-map"
|
||||
},
|
||||
]
|
||||
},
|
||||
... profileStore.ownTenant.features.accounting ? [{
|
||||
@@ -156,30 +166,9 @@ const links = computed(() => {
|
||||
},
|
||||
... role.checkRight("spaces") ? [{
|
||||
label: "Lagerplätze",
|
||||
to: "/spaces",
|
||||
to: "/standardEntity/spaces",
|
||||
icon: "i-heroicons-square-3-stack-3d"
|
||||
}] : [],
|
||||
... role.checkRight("inventoryitems") ? [{
|
||||
label: "Inventar",
|
||||
to: "/standardEntity/inventoryitems",
|
||||
icon: "i-heroicons-puzzle-piece"
|
||||
}] : [],
|
||||
]
|
||||
},] : [],
|
||||
... role.checkRight("vehicles") ? [{
|
||||
label: "Fuhrpark",
|
||||
defaultOpen: false,
|
||||
icon: "i-heroicons-truck",
|
||||
children: [
|
||||
... role.checkRight("vehicles") ? [{
|
||||
label: "Fahrzeuge",
|
||||
to: "/standardEntity/vehicles",
|
||||
icon: "i-heroicons-truck"
|
||||
}] : [],{
|
||||
label: "Fahrten",
|
||||
to: "/trackingTrips",
|
||||
icon: "i-heroicons-map"
|
||||
},
|
||||
]
|
||||
},] : [],
|
||||
{
|
||||
@@ -200,11 +189,26 @@ const links = computed(() => {
|
||||
... role.checkRight("services") ? [{
|
||||
label: "Leistungen",
|
||||
to: "/standardEntity/services",
|
||||
icon: "i-heroicons-puzzle-piece"
|
||||
icon: "i-heroicons-wrench-screwdriver"
|
||||
}] : [],
|
||||
... role.checkRight("servicecategories") ? [{
|
||||
label: "Leistungskategorien",
|
||||
to: "/standardEntity/servicecategories",
|
||||
icon: "i-heroicons-wrench-screwdriver"
|
||||
}] : [],
|
||||
{
|
||||
label: "Mitarbeiter",
|
||||
to: "/profiles",
|
||||
icon: "i-heroicons-user-group"
|
||||
},
|
||||
... role.checkRight("vehicles") ? [{
|
||||
label: "Fahrzeuge",
|
||||
to: "/standardEntity/vehicles",
|
||||
icon: "i-heroicons-truck"
|
||||
}] : [],
|
||||
... role.checkRight("inventoryitems") ? [{
|
||||
label: "Inventar",
|
||||
to: "/standardEntity/inventoryitems",
|
||||
icon: "i-heroicons-puzzle-piece"
|
||||
}] : [],
|
||||
]
|
||||
@@ -244,10 +248,6 @@ const links = computed(() => {
|
||||
label: "Nummernkreise",
|
||||
to: "/settings/numberRanges",
|
||||
icon: "i-heroicons-clipboard-document-list"
|
||||
},{
|
||||
label: "Mitarbeiter",
|
||||
to: "/profiles",
|
||||
icon: "i-heroicons-clipboard-document-list"
|
||||
},{
|
||||
label: "Rollen",
|
||||
to: "/roles",
|
||||
@@ -276,63 +276,15 @@ const links = computed(() => {
|
||||
label: "Projekttypen",
|
||||
to: "/projecttypes",
|
||||
icon: "i-heroicons-clipboard-document-list"
|
||||
}/*,{
|
||||
label: "Integrationen",
|
||||
to: "/settings/integrations",
|
||||
icon: "i-heroicons-clipboard-document-list"
|
||||
}*/,{
|
||||
label: "Labels",
|
||||
to: "/settings/labels/",
|
||||
icon: "i-heroicons-bars-3-solid"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
/*const setOpen = (index,open) => {
|
||||
console.log(!open)
|
||||
}*/
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!--
|
||||
<UAccordion :items="links" :ui="{ wrapper: 'flex flex-col w-full' }">
|
||||
<template #default="{ item, index, open }">
|
||||
<UButton color="gray" variant="ghost" class="border-b border-gray-200 dark:border-gray-700" :ui="{ rounded: 'rounded-none', padding: { sm: 'p-3' } }">
|
||||
<template #leading>
|
||||
<!– <div class="w-6 h-6 rounded-full bg-primary-500 dark:bg-primary-400 flex items-center justify-center -my-1">
|
||||
<UIcon :name="item.icon" class="w-4 h-4 text-white dark:text-gray-900" />
|
||||
</div>–>
|
||||
<UIcon :name="item.icon" class="w-4 h-4 dark:text-white text-gray-900" />
|
||||
</template>
|
||||
|
||||
<span class="truncate">{{ item.label }}</span>
|
||||
|
||||
<template #trailing>
|
||||
<UIcon
|
||||
name="i-heroicons-chevron-right-20-solid"
|
||||
class="w-5 h-5 ms-auto transform transition-transform duration-200"
|
||||
:class="[open && 'rotate-90']"
|
||||
/>
|
||||
</template>
|
||||
</UButton>
|
||||
</template>
|
||||
<template #item="{item}">
|
||||
<div v-if="item.children" class="flex flex-col">
|
||||
<UButton
|
||||
v-for="child in item.children"
|
||||
variant="ghost"
|
||||
color="gray"
|
||||
>
|
||||
{{child.label}}
|
||||
</UButton>
|
||||
</div>
|
||||
</template>
|
||||
</UAccordion>
|
||||
-->
|
||||
<div
|
||||
v-for="item in links"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user