2024-11-21 10:55:22 +01:00
|
|
|
<template>
|
|
|
|
|
<header role="tablist" aria-labelledby="tablist">
|
|
|
|
|
<button
|
2024-11-21 13:20:57 +01:00
|
|
|
v-if="step.files.static.rawGlass"
|
2024-11-21 10:55:22 +01:00
|
|
|
id="verre-brut-label"
|
|
|
|
|
type="button"
|
|
|
|
|
role="tab"
|
2024-11-27 15:59:13 +01:00
|
|
|
:aria-selected="activeTab === 'rawGlass' ? true : false"
|
2024-11-21 10:55:22 +01:00
|
|
|
aria-controls="verre-brut"
|
|
|
|
|
tabindex="-1"
|
2024-11-27 15:59:13 +01:00
|
|
|
@click="activeTab = 'rawGlass'"
|
2024-11-21 10:55:22 +01:00
|
|
|
>
|
|
|
|
|
<span class="label">Verre brut</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
2024-11-21 13:20:57 +01:00
|
|
|
v-if="step.files.static.finishedGlass"
|
2024-11-21 10:55:22 +01:00
|
|
|
id="verre-paracheve-label"
|
|
|
|
|
type="button"
|
|
|
|
|
role="tab"
|
2024-11-27 15:59:13 +01:00
|
|
|
:aria-selected="activeTab === 'finishedGlass' ? true : false"
|
2024-11-21 10:55:22 +01:00
|
|
|
aria-controls="verre-paracheve"
|
2024-11-27 15:59:13 +01:00
|
|
|
@click="activeTab = 'finishedGlass'"
|
2024-11-21 10:55:22 +01:00
|
|
|
>
|
|
|
|
|
<span class="label">Verre parachevé</span>
|
|
|
|
|
</button>
|
|
|
|
|
</header>
|
2024-12-19 16:03:20 +01:00
|
|
|
<div id="vpv-container" class="dialog__inner">
|
2024-11-28 14:45:45 +01:00
|
|
|
<PdfViewer />
|
2024-11-21 10:55:22 +01:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-11-21 13:20:57 +01:00
|
|
|
<script setup>
|
2025-03-07 17:29:11 +01:00
|
|
|
import { ref, watch } from 'vue';
|
|
|
|
|
import { useVirtualSampleStore } from '../../../stores/virtualSample';
|
|
|
|
|
import PdfViewer from '../PdfViewer.vue';
|
|
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
|
|
import { useDialogStore } from '../../../stores/dialog';
|
2024-11-21 13:20:57 +01:00
|
|
|
|
2025-03-07 17:29:11 +01:00
|
|
|
const { step } = storeToRefs(useVirtualSampleStore());
|
2024-12-20 12:36:21 +01:00
|
|
|
const { openedFile, activeTracks } = storeToRefs(useDialogStore());
|
2025-03-07 17:29:11 +01:00
|
|
|
const activeTab = ref(Object.keys(step.value.files.static)[0]);
|
2024-11-28 14:45:45 +01:00
|
|
|
|
2024-12-20 12:36:21 +01:00
|
|
|
activeTracks.value = [];
|
|
|
|
|
|
2024-11-28 14:45:45 +01:00
|
|
|
watch(
|
|
|
|
|
activeTab,
|
|
|
|
|
(newVal) => {
|
2025-03-07 17:29:11 +01:00
|
|
|
openedFile.value = step.value.files.static[newVal];
|
2024-11-28 14:45:45 +01:00
|
|
|
},
|
|
|
|
|
{ immediate: true }
|
|
|
|
|
);
|
2024-11-21 13:20:57 +01:00
|
|
|
</script>
|