project - view pdf in dialog working. Open and close working

This commit is contained in:
isUnknown 2024-10-16 18:43:04 +02:00
parent 09eb3e1969
commit 3d8f9fc893
19 changed files with 89 additions and 119 deletions

View file

@ -4,23 +4,28 @@
aria-labelledby="votre-brief-label"
:data-status="status"
>
<router-link :to="'/' + step.uri">
<h2 id="votre-brief-label">
<span data-icon="votre-brief">{{ step.text }}</span>
</h2>
<div class="cards | flow">
<article class="card">
<hgroup class="order-last">
<h3 class="card__title | font-serif | text-lg">{{ step.text }}</h3>
</hgroup>
<div class="card__meta | flex">
<time class="card__date | text-grey-700" datetime="2024-06-12">{{
dayjs(step.modified).format("DD MMMM YYYY")
}}</time>
</div>
<h2 id="votre-brief-label">
<span data-icon="votre-brief">{{ step.text }}</span>
</h2>
<div class="cards | flow">
<article class="card">
<hgroup class="order-last">
<h3 class="card__title | font-serif | text-lg">{{ step.text }}</h3>
</hgroup>
<div class="card__meta | flex">
<time class="card__date | text-grey-700" datetime="2024-06-12">{{
dayjs(step.modified).format("DD MMMM YYYY")
}}</time>
</div>
<template v-if="step.value === 'clientBrief'">
<figure class="card__images" :data-count="step.files.length - 3">
<template v-if="step.files[0]?.type === 'image'">
<router-link :to="'/' + step.uri">
<figure
class="card__images"
:data-count="
step.files.length > 3 ? step.files.length - 3 : undefined
"
>
<img
v-for="image in step.files.slice(0, 3)"
:key="image.uuid"
@ -28,10 +33,15 @@
:alt="image.alt"
/>
</figure>
</template>
</article>
</div>
</router-link>
</router-link>
</template>
<template v-if="step.files[0]?.type === 'document'">
<figure @click="showPdf" class="card__images">
À remplacer par picto PDF
</figure>
</template>
</article>
</div>
</section>
</template>
@ -44,6 +54,8 @@ const { step } = defineProps({
step: Object,
});
const emit = defineEmits(["update:pdf"]);
dayjs.locale("fr");
const { page } = usePageStore();
@ -65,6 +77,10 @@ function setStatus() {
return "uncompleted";
}
}
function showPdf() {
emit("update:pdf", step.files[0].url);
}
</script>
<style scoped>