2024-09-26 19:14:20 +02:00
|
|
|
<template>
|
2024-10-16 15:29:45 +02:00
|
|
|
<main class="flex flex-col items-stretch | w-full" style="--row-gap: 2rem">
|
|
|
|
|
<header class="flex | bg-white | rounded-2xl | p-8">
|
|
|
|
|
<router-link :to="'/' + page.parent" class="btn btn--white" data-icon="arrow-left">
|
|
|
|
|
<span>Retour au projet</span>
|
2024-10-02 15:33:57 +02:00
|
|
|
</router-link>
|
|
|
|
|
<button class="btn | ml-auto">Valider et envoyer le brief</button>
|
|
|
|
|
</header>
|
2024-09-26 19:14:20 +02:00
|
|
|
<component :is="stepsComponents[currentStep]" @update:step="changeStep" />
|
|
|
|
|
</main>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ref } from "vue";
|
2024-10-09 17:39:05 +02:00
|
|
|
import Intro from "../components/project/client-brief/Intro.vue";
|
|
|
|
|
import ModeSelection from "../components/project/client-brief/ModeSelection.vue";
|
|
|
|
|
import Images from "../components/project/client-brief/Images.vue";
|
2024-10-14 14:31:17 +02:00
|
|
|
import PdfViewer from "../components/project/client-brief/PdfViewer.vue";
|
2024-10-02 15:29:31 +02:00
|
|
|
import { usePageStore } from "../stores/page";
|
2024-10-14 15:23:06 +02:00
|
|
|
import { storeToRefs } from "pinia";
|
2024-09-26 19:14:20 +02:00
|
|
|
|
|
|
|
|
const stepsComponents = {
|
|
|
|
|
Intro,
|
|
|
|
|
ModeSelection,
|
2024-10-02 15:29:31 +02:00
|
|
|
Images,
|
2024-10-14 14:31:17 +02:00
|
|
|
PdfViewer,
|
2024-09-26 19:14:20 +02:00
|
|
|
};
|
|
|
|
|
|
2024-10-14 15:23:06 +02:00
|
|
|
const { page } = storeToRefs(usePageStore());
|
2024-10-02 15:29:31 +02:00
|
|
|
|
|
|
|
|
const currentStep = ref(setInitialStep());
|
2024-09-26 19:14:20 +02:00
|
|
|
|
|
|
|
|
function changeStep(stepName) {
|
|
|
|
|
currentStep.value = stepName;
|
|
|
|
|
}
|
2024-10-02 15:29:31 +02:00
|
|
|
|
|
|
|
|
function setInitialStep() {
|
2024-10-16 15:04:15 +02:00
|
|
|
const hasPDF = page.value.content.pdf.length !== 0;
|
2024-10-14 15:23:06 +02:00
|
|
|
const hasImages =
|
2024-10-16 15:03:20 +02:00
|
|
|
page.value.content.moodboard.length !== 0 ||
|
2024-10-14 15:23:06 +02:00
|
|
|
page.value.content.description.length !== 0;
|
2024-10-02 15:29:31 +02:00
|
|
|
const isEmpty = !hasPDF && !hasImages;
|
|
|
|
|
if (isEmpty) return "Intro";
|
2024-10-14 15:23:06 +02:00
|
|
|
if (hasPDF) return "PdfViewer";
|
2024-10-02 15:29:31 +02:00
|
|
|
if (hasImages) return "Images";
|
|
|
|
|
}
|
2024-09-26 19:14:20 +02:00
|
|
|
</script>
|