Introduced EntityShowSubComponents
This commit is contained in:
63
components/EntityShowSubFiles.vue
Normal file
63
components/EntityShowSubFiles.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<script setup>
|
||||
|
||||
const props = defineProps({
|
||||
queryStringData: {
|
||||
type: String
|
||||
},
|
||||
item: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
topLevelType: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(["updateNeeded"])
|
||||
|
||||
const files = useFiles()
|
||||
|
||||
|
||||
const availableFiles = ref([])
|
||||
|
||||
const setup = async () => {
|
||||
if(props.item.files) {
|
||||
availableFiles.value = await files.selectSomeDocuments(props.item.files.map(i => i.id)) || []
|
||||
}
|
||||
}
|
||||
|
||||
setup()
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UCard class="mt-5" style="height: 80vh">
|
||||
<Toolbar>
|
||||
<DocumentUpload
|
||||
:type="props.type.substring(0,props.type.length-1)"
|
||||
:element-id="props.item.id"
|
||||
@uploadFinished="emit('updateNeeded')"
|
||||
/>
|
||||
</Toolbar>
|
||||
|
||||
<DocumentList
|
||||
:key="props.item.files.length"
|
||||
:documents="availableFiles"
|
||||
v-if="availableFiles.length > 0"
|
||||
/>
|
||||
<UAlert
|
||||
v-else
|
||||
icon="i-heroicons-x-mark"
|
||||
title="Keine Dateien verfügbar"
|
||||
/>
|
||||
</UCard>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user