virtual sample : show static vue files
This commit is contained in:
parent
1398da62be
commit
9ed050b122
6 changed files with 42 additions and 7 deletions
Binary file not shown.
|
|
@ -0,0 +1 @@
|
||||||
|
Uuid: inTVYmCtOtEsv5eV
|
||||||
|
|
@ -2,6 +2,18 @@ Title: Échantillon virtuel
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
Rawglass: - file://inTVYmCtOtEsv5eV
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Finishedglass:
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Stepname: virtualSample
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
Views:
|
Views:
|
||||||
|
|
||||||
- file://4J0jWX6DWA86y0Er
|
- file://4J0jWX6DWA86y0Er
|
||||||
|
|
@ -77,10 +89,6 @@ Views:
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
Stepname: virtualSample
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
Stepindex: 5
|
Stepindex: 5
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<header role="tablist" aria-labelledby="tablist">
|
<header role="tablist" aria-labelledby="tablist">
|
||||||
<button
|
<button
|
||||||
|
v-if="step.files.static.rawGlass"
|
||||||
id="verre-brut-label"
|
id="verre-brut-label"
|
||||||
type="button"
|
type="button"
|
||||||
role="tab"
|
role="tab"
|
||||||
|
|
@ -11,6 +12,7 @@
|
||||||
<span class="label">Verre brut</span>
|
<span class="label">Verre brut</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
|
v-if="step.files.static.finishedGlass"
|
||||||
id="verre-paracheve-label"
|
id="verre-paracheve-label"
|
||||||
type="button"
|
type="button"
|
||||||
role="tab"
|
role="tab"
|
||||||
|
|
@ -21,10 +23,26 @@
|
||||||
</button>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
<div class="dialog__inner" id="verre-brut">
|
<div class="dialog__inner" id="verre-brut">
|
||||||
<!-- PdvViewer -->
|
<VPdfViewer
|
||||||
|
:darkMode="true"
|
||||||
|
:initialThumbnailsVisible="true"
|
||||||
|
:src="openedFile.url"
|
||||||
|
local="fr_FR"
|
||||||
|
@loaded="onPdfLoaded"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { useVirtualSampleStore } from "../../../stores/virtualSample";
|
||||||
|
import { VPdfViewer, useLicense } from "@vue-pdf-viewer/viewer";
|
||||||
|
|
||||||
|
const { step } = useVirtualSampleStore();
|
||||||
|
const activeTab = ref(Object.keys(step.files.static)[0]);
|
||||||
|
const openedFile = ref(step.files.static[activeTab.value]);
|
||||||
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.dialog__inner {
|
.dialog__inner {
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="dialog__tabs">
|
<div class="dialog__tabs">
|
||||||
<button
|
<button
|
||||||
|
v-if="step.files.dynamic"
|
||||||
class="btn btn--transparent | font-serif"
|
class="btn btn--transparent | font-serif"
|
||||||
data-icon="cursor"
|
data-icon="cursor"
|
||||||
:aria-pressed="activeTab === 'dynamic' ? true : false"
|
:aria-pressed="activeTab === 'dynamic' ? true : false"
|
||||||
|
|
@ -20,6 +21,7 @@
|
||||||
<span>Vue Dynamique</span>
|
<span>Vue Dynamique</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
|
v-if="step.files.static"
|
||||||
@click="activeTab = 'static'"
|
@click="activeTab = 'static'"
|
||||||
class="btn btn--transparent | font-serif"
|
class="btn btn--transparent | font-serif"
|
||||||
data-icon="image"
|
data-icon="image"
|
||||||
|
|
@ -82,13 +84,15 @@ import StaticView from "./StaticView.vue";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { useDialogStore } from "../../../stores/dialog";
|
import { useDialogStore } from "../../../stores/dialog";
|
||||||
import { useVirtualSampleStore } from "../../../stores/virtualSample";
|
import { useVirtualSampleStore } from "../../../stores/virtualSample";
|
||||||
|
import { usePageStore } from "../../../stores/page";
|
||||||
|
|
||||||
const { file } = defineProps({
|
const { file } = defineProps({
|
||||||
file: Object,
|
file: Object,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { page } = usePageStore();
|
||||||
const { comments } = storeToRefs(useDialogStore());
|
const { comments } = storeToRefs(useDialogStore());
|
||||||
const { activeTab, currentFile } = storeToRefs(useVirtualSampleStore());
|
const { activeTab, currentFile, step } = storeToRefs(useVirtualSampleStore());
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
const isOpen = ref(true);
|
const isOpen = ref(true);
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
|
import { usePageStore } from "./page";
|
||||||
|
|
||||||
export const useVirtualSampleStore = defineStore("virtual-sample", () => {
|
export const useVirtualSampleStore = defineStore("virtual-sample", () => {
|
||||||
const activeTab = ref("dynamic");
|
const activeTab = ref("dynamic");
|
||||||
const currentFile = ref(null);
|
const currentFile = ref(null);
|
||||||
|
|
||||||
|
const { page } = usePageStore();
|
||||||
|
const step = page.steps.find((step) => step.id === "virtualSample");
|
||||||
|
|
||||||
watch(activeTab, () => (currentFile.value = null));
|
watch(activeTab, () => (currentFile.value = null));
|
||||||
|
|
||||||
return { activeTab, currentFile };
|
return { activeTab, currentFile, step };
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue