@@ -23,9 +23,6 @@ let {documentData, openShowModal:openShowModalProp, returnEmit } = props;
|
||||
const tags = dataStore.getDocumentTags
|
||||
const openShowModal = ref(false)
|
||||
|
||||
|
||||
|
||||
|
||||
//Functions
|
||||
const openDocument = async () => {
|
||||
//selectedDocument.value = doc
|
||||
@@ -140,7 +137,7 @@ const updateDocumentAssignment = async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :id="`docDisplay-${documentData.id}`" class="documentListItem" @click="returnEmit ? $emit('clicked', documentData.id) : openShowModal = true">
|
||||
<div class="documentListItem" @click="returnEmit ? $emit('clicked', documentData.id) : openShowModal = true">
|
||||
<iframe
|
||||
:src="`${documentData.url}#toolbar=0&navpanes=0&scrollbar=0`"
|
||||
class="previewEmbed"
|
||||
@@ -153,8 +150,8 @@ const updateDocumentAssignment = async () => {
|
||||
:src="documentData.url"
|
||||
/>
|
||||
<!-- TODO: Remove Scrollbar -->
|
||||
<UTooltip class="w-full" :text="documentData.path.split('/')[documentData.path.split('/').length -1]">
|
||||
<p class="truncate my-3">{{documentData.path.split("/")[documentData.path.split("/").length -1]}}</p>
|
||||
<UTooltip class="w-full" :text="documentData.path.split('_')[documentData.path.split('_').length -1]">
|
||||
<p class="truncate my-3">{{documentData.path.split("_")[documentData.path.split("_").length -1]}}</p>
|
||||
</UTooltip>
|
||||
|
||||
<InputGroup class="mt-3 flex-wrap">
|
||||
@@ -229,14 +226,6 @@ const updateDocumentAssignment = async () => {
|
||||
>
|
||||
Archivieren
|
||||
</UButton>
|
||||
<UButton
|
||||
:to="documentData.url"
|
||||
variant="outline"
|
||||
icon="i-heroicons-arrow-top-right-on-square"
|
||||
target="_blank"
|
||||
>
|
||||
Öffnen
|
||||
</UButton>
|
||||
<!-- <UButton
|
||||
v-if="documentData.tags.includes('Eingangsrechnung')"
|
||||
@click="createVendorInvoice"
|
||||
@@ -244,11 +233,11 @@ const updateDocumentAssignment = async () => {
|
||||
Eingangsrechnung erstellen
|
||||
</UButton>-->
|
||||
</UButtonGroup>
|
||||
<!-- <br>
|
||||
<br>
|
||||
<a
|
||||
:href="documentData.url"
|
||||
target="_blank"
|
||||
>In neuen Tab anzeigen</a>-->
|
||||
>In neuen Tab anzeigen</a>
|
||||
|
||||
<UFormGroup
|
||||
label="Tags ändern:"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script setup >
|
||||
<script setup lang="ts">
|
||||
import { format, isToday } from 'date-fns'
|
||||
|
||||
const props = defineProps({
|
||||
@@ -12,15 +12,15 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue','emailSelected'])
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const mailsRefs = ref([])
|
||||
const mailsRefs = ref<Element[]>([])
|
||||
|
||||
const selectedMail = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
},
|
||||
set(value) {
|
||||
set(value: Mail | null) {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
@@ -30,17 +30,12 @@ watch(selectedMail, () => {
|
||||
return
|
||||
}
|
||||
|
||||
const ref1 = mailsRefs.value[selectedMail.value.id]
|
||||
if (ref1) {
|
||||
ref1.scrollIntoView({ block: 'nearest' })
|
||||
const ref = mailsRefs.value[selectedMail.value.id]
|
||||
if (ref) {
|
||||
ref.scrollIntoView({ block: 'nearest' })
|
||||
}
|
||||
})
|
||||
|
||||
const changeMail = (mail) => {
|
||||
selectedMail.value = mail
|
||||
emit("emailSelected")
|
||||
}
|
||||
|
||||
defineShortcuts({
|
||||
arrowdown: () => {
|
||||
const index = props.mails.findIndex((mail) => mail.id === selectedMail.value?.id)
|
||||
@@ -64,15 +59,15 @@ defineShortcuts({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="p-0 scrollCont overflow-scroll">
|
||||
<div v-for="(mail, index) in mails" :key="index" :ref="el => { mailsRefs[mail.id] = el }">
|
||||
<UDashboardPanelContent class="p-0">
|
||||
<div v-for="(mail, index) in mails" :key="index" :ref="el => { mailsRefs[mail.id] = el as Element }">
|
||||
<div
|
||||
class="p-4 text-sm cursor-pointer border-l-2"
|
||||
:class="[
|
||||
!mail.seen ? 'text-gray-900 dark:text-white' : 'text-gray-600 dark:text-gray-300',
|
||||
mail.unread ? 'text-gray-900 dark:text-white' : 'text-gray-600 dark:text-gray-300',
|
||||
selectedMail && selectedMail.id === mail.id ? 'border-primary-500 dark:border-primary-400 bg-primary-100 dark:bg-primary-900/25' : 'border-white dark:border-gray-900 hover:border-primary-500/25 dark:hover:border-primary-400/25 hover:bg-primary-100/50 dark:hover:bg-primary-900/10'
|
||||
]"
|
||||
@click="changeMail(mail)"
|
||||
@click="selectedMail = mail"
|
||||
>
|
||||
<div class="flex items-center justify-between" :class="[mail.unread && 'font-semibold']">
|
||||
<div class="flex items-center gap-3">
|
||||
@@ -87,17 +82,11 @@ defineShortcuts({
|
||||
{{ mail.subject }}
|
||||
</p>
|
||||
<p class="text-gray-400 dark:text-gray-500 line-clamp-1">
|
||||
{{ mail.text }}
|
||||
{{ mail.body }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<UDivider />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.scrollCont {
|
||||
height: 90vh;
|
||||
}
|
||||
</style>
|
||||
</UDashboardPanelContent>
|
||||
</template>
|
||||
@@ -17,11 +17,11 @@ defineProps({
|
||||
<UDashboardPanelContent>
|
||||
<div class="flex justify-between">
|
||||
<div class="flex items-center gap-4">
|
||||
<UAvatar v-bind="mail.from.avatar" :alt="mail.from.name||mail.from.address" size="lg" />
|
||||
<UAvatar v-bind="mail.from.avatar" :alt="mail.from.name" size="lg" />
|
||||
|
||||
<div class="min-w-0">
|
||||
<p class="text-gray-900 dark:text-white font-semibold">
|
||||
{{ mail.from.name ||mail.from.address}}
|
||||
{{ mail.from.name }}
|
||||
</p>
|
||||
<p class="text-gray-500 dark:text-gray-400 font-medium">
|
||||
{{ mail.subject }}
|
||||
@@ -36,33 +36,18 @@ defineProps({
|
||||
|
||||
<UDivider class="my-5" />
|
||||
|
||||
<InputGroup class="mb-3">
|
||||
<UButton
|
||||
v-for="attachment in mail.attachments"
|
||||
icon="i-heroicons-arrow-down-tray"
|
||||
disabled
|
||||
>
|
||||
{{attachment.filename}}
|
||||
</UButton>
|
||||
</InputGroup>
|
||||
|
||||
<div class="contentscroll overflow-scroll">
|
||||
<iframe class="flex-1 h-full w-full" :srcdoc="mail.html" v-if="mail.html"/>
|
||||
|
||||
<!-- <div class="flex-1" v-html="mail.html" v-if="mail.html">
|
||||
|
||||
</div>-->
|
||||
<div class="flex-1" v-else>
|
||||
<p>{{mail.text}}</p>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<p class="text-lg">
|
||||
{{ mail.body }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<UDivider class="my-5" />
|
||||
|
||||
<form @submit.prevent>
|
||||
<UTextarea color="gray" required size="xl" :rows="5" :placeholder="`Reply to ${mail.from.name}`">
|
||||
<UButton type="submit" color="black" label="Send" icon="i-heroicons-paper-airplane" class="absolute bottom-2.5 right-3.5" />
|
||||
</UTextarea>
|
||||
</form>
|
||||
</UDashboardPanelContent>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.contentscroll{
|
||||
height: 80vh;
|
||||
}
|
||||
</style>
|
||||
</template>
|
||||
@@ -1,13 +1,7 @@
|
||||
<script setup>
|
||||
import {useRole} from "~/composables/useRole.js";
|
||||
|
||||
const dataStore = useDataStore()
|
||||
const route = useRoute()
|
||||
|
||||
const role = useRole()
|
||||
console.log(role)
|
||||
console.log(role.checkRight("projects"))
|
||||
|
||||
const links = computed(() => {
|
||||
return [
|
||||
{
|
||||
@@ -42,7 +36,7 @@ const links = computed(() => {
|
||||
icon: "i-heroicons-calendar-days"
|
||||
}] : [],
|
||||
{
|
||||
label: "Dateien",
|
||||
label: "Dokumente",
|
||||
to: "/documents",
|
||||
icon: "i-heroicons-document"
|
||||
},
|
||||
@@ -208,22 +202,37 @@ const links = computed(() => {
|
||||
},
|
||||
]
|
||||
},
|
||||
... role.checkRight("checks") ? [{
|
||||
/*... dataStore.ownTenant.features.projects ? [{
|
||||
label: "Projekte",
|
||||
defaultOpen: false,
|
||||
icon: "i-heroicons-clipboard-document-check",
|
||||
children: [
|
||||
...dataStore.ownTenant.projecttypes.map(i => {
|
||||
return {
|
||||
label: i.label,
|
||||
to: `/projects?type=${i.label}`,
|
||||
icon: i.icon
|
||||
}
|
||||
})
|
||||
|
||||
]
|
||||
},] : [],*/
|
||||
{
|
||||
label: "Überprüfungen",
|
||||
to: "/checks",
|
||||
icon: "i-heroicons-magnifying-glass"
|
||||
},] : [],
|
||||
... (role.checkRight("projects") && dataStore.ownTenant.features.projects) ? [{
|
||||
},
|
||||
... dataStore.ownTenant.features.projects ? [{
|
||||
label: "Projekte",
|
||||
to: "/projects",
|
||||
icon: "i-heroicons-clipboard-document-check"
|
||||
},] : [],
|
||||
... (role.checkRight("contracts") && dataStore.ownTenant.features.contracts) ? [{
|
||||
... dataStore.ownTenant.features.contracts ? [{
|
||||
label: "Verträge",
|
||||
to: "/contracts",
|
||||
icon: "i-heroicons-clipboard-document"
|
||||
}] : [],
|
||||
... (role.checkRight("objects") && dataStore.ownTenant.features.objects) ? [{
|
||||
... dataStore.ownTenant.features.objects ? [{
|
||||
label: "Objekte",
|
||||
to: "/plants",
|
||||
icon: "i-heroicons-clipboard-document"
|
||||
|
||||
Reference in New Issue
Block a user