2024-10-28 18:18:32 +01:00
|
|
|
|
<template>
|
2024-10-30 16:41:29 +01:00
|
|
|
|
<Dialog
|
|
|
|
|
|
id="virtual-sample"
|
|
|
|
|
|
v-model:visible="isOpen"
|
|
|
|
|
|
modal
|
|
|
|
|
|
:draggable="false"
|
2024-11-28 15:15:21 +01:00
|
|
|
|
dismissableMask="true"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
header="Titre du rendu"
|
|
|
|
|
|
class="dialog"
|
2024-11-28 17:56:56 +01:00
|
|
|
|
:class="[{ 'with-comments': isCommentsOpen }, activeTab]"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
:closeOnEscape="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #header>
|
2024-11-28 18:08:39 +01:00
|
|
|
|
<div class="dialog__tabs" role="tablist">
|
2024-11-05 14:14:40 +01:00
|
|
|
|
<button
|
2024-11-21 13:20:57 +01:00
|
|
|
|
v-if="step.files.dynamic"
|
2024-11-28 18:08:39 +01:00
|
|
|
|
type="button"
|
|
|
|
|
|
role="tab"
|
2024-11-05 14:14:40 +01:00
|
|
|
|
class="btn btn--transparent | font-serif"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
data-icon="cursor"
|
2024-11-20 16:03:38 +01:00
|
|
|
|
:aria-pressed="activeTab === 'dynamic' ? true : false"
|
2024-11-28 18:08:39 +01:00
|
|
|
|
aria-controls="dynamic"
|
2024-11-20 16:03:38 +01:00
|
|
|
|
@click="activeTab = 'dynamic'"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
>
|
|
|
|
|
|
<span>Vue Dynamique</span>
|
|
|
|
|
|
</button>
|
2024-11-20 16:03:38 +01:00
|
|
|
|
<button
|
2024-11-21 13:20:57 +01:00
|
|
|
|
v-if="step.files.static"
|
2024-11-28 18:08:39 +01:00
|
|
|
|
type="button"
|
|
|
|
|
|
role="tab"
|
2024-11-20 16:03:38 +01:00
|
|
|
|
@click="activeTab = 'static'"
|
|
|
|
|
|
class="btn btn--transparent | font-serif"
|
|
|
|
|
|
data-icon="image"
|
|
|
|
|
|
:aria-pressed="activeTab === 'static' ? true : false"
|
2024-11-28 18:08:39 +01:00
|
|
|
|
aria-controls="static"
|
2024-11-20 16:03:38 +01:00
|
|
|
|
>
|
2024-10-30 16:41:29 +01:00
|
|
|
|
<span>Vue statique</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
2024-11-20 18:42:37 +01:00
|
|
|
|
<h2 class="font-serif text-lg">Échantillon virtuel</h2>
|
2024-10-30 16:41:29 +01:00
|
|
|
|
</template>
|
2024-11-13 07:46:32 +01:00
|
|
|
|
|
2024-11-28 18:08:39 +01:00
|
|
|
|
<DynamicView id="dynamic" v-if="activeTab === 'dynamic'" />
|
|
|
|
|
|
<StaticView id="static" v-if="activeTab === 'static'" />
|
2024-11-20 15:57:07 +01:00
|
|
|
|
|
2024-10-30 16:41:29 +01:00
|
|
|
|
<template #footer>
|
2024-11-21 10:08:37 +01:00
|
|
|
|
<a
|
|
|
|
|
|
v-if="currentFile"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
id="download-image"
|
2024-11-05 14:14:40 +01:00
|
|
|
|
class="btn btn--white-10"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
data-icon="download"
|
2024-11-21 10:08:37 +01:00
|
|
|
|
:href="currentFile.url"
|
|
|
|
|
|
download
|
2024-10-30 16:41:29 +01:00
|
|
|
|
>
|
2024-11-21 10:08:37 +01:00
|
|
|
|
<span>{{
|
|
|
|
|
|
activeTab === "dynamic" ? "Télécharger l’image" : "Télécharger le PDF"
|
|
|
|
|
|
}}</span>
|
|
|
|
|
|
</a>
|
2024-11-05 14:14:40 +01:00
|
|
|
|
<button
|
2024-10-30 16:41:29 +01:00
|
|
|
|
id="loop-animation"
|
2024-11-05 14:14:40 +01:00
|
|
|
|
class="btn btn--transparent btn--outline"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
data-icon="loop"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span>Animation en boucle</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button
|
|
|
|
|
|
id="toggle-comments"
|
|
|
|
|
|
:aria-pressed="isCommentsOpen"
|
|
|
|
|
|
class="btn btn--transparent btn--outline"
|
|
|
|
|
|
data-icon="comment"
|
|
|
|
|
|
@click="isCommentsOpen = !isCommentsOpen"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span class="sr-only">Afficher les commentaires</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</Dialog>
|
2024-10-28 18:18:32 +01:00
|
|
|
|
</template>
|
2024-10-30 16:41:29 +01:00
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2024-11-20 08:26:12 +01:00
|
|
|
|
import { storeToRefs } from "pinia";
|
2024-10-30 16:41:29 +01:00
|
|
|
|
import Dialog from "primevue/dialog";
|
2024-11-21 10:08:37 +01:00
|
|
|
|
import DynamicView from "./DynamicView.vue";
|
|
|
|
|
|
import StaticView from "./StaticView.vue";
|
2024-11-28 15:15:21 +01:00
|
|
|
|
import { ref, watch } from "vue";
|
2024-11-21 10:08:37 +01:00
|
|
|
|
import { useVirtualSampleStore } from "../../../stores/virtualSample";
|
2024-11-28 14:45:45 +01:00
|
|
|
|
import { useDialogStore } from "../../../stores/dialog";
|
2024-11-28 15:15:21 +01:00
|
|
|
|
import { useRoute, useRouter } from "vue-router";
|
2024-10-30 16:41:29 +01:00
|
|
|
|
|
|
|
|
|
|
const { file } = defineProps({
|
|
|
|
|
|
file: Object,
|
|
|
|
|
|
});
|
2024-11-20 08:26:12 +01:00
|
|
|
|
|
2024-11-21 13:20:57 +01:00
|
|
|
|
const { activeTab, currentFile, step } = storeToRefs(useVirtualSampleStore());
|
2024-11-28 14:45:45 +01:00
|
|
|
|
const { isCommentsOpen } = storeToRefs(useDialogStore());
|
2024-10-30 16:41:29 +01:00
|
|
|
|
|
|
|
|
|
|
// Variables
|
2024-11-28 15:15:21 +01:00
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
const route = useRoute();
|
2024-11-19 17:20:47 +01:00
|
|
|
|
const isOpen = ref(true);
|
2024-11-28 15:15:21 +01:00
|
|
|
|
watch(isOpen, (newValue) => {
|
|
|
|
|
|
router.push({ name: route.name });
|
|
|
|
|
|
});
|
2024-10-30 16:41:29 +01:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.dialog__inner {
|
|
|
|
|
|
padding: var(--space-16);
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|