2025-01-22 13:25:34 +01:00
|
|
|
<template>
|
|
|
|
|
<aside>
|
2025-01-23 12:23:14 +01:00
|
|
|
<button @click="emits('close')">X</button>
|
|
|
|
|
<ul class="tabs">
|
|
|
|
|
<li v-for="(proposal, index) in proposals">
|
|
|
|
|
<button @click="activeProposal = proposal">
|
|
|
|
|
{{ index === 0 ? "Proposition initiale" : "Alternative " + index }}
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<p>Données basées sur la proposition du {{ activeProposal.date }}</p>
|
|
|
|
|
<p>{{ activeProposal.stepLabel }}</p>
|
2025-01-22 17:08:32 +01:00
|
|
|
|
|
|
|
|
<h4>Note globale</h4>
|
2025-01-23 12:23:14 +01:00
|
|
|
<p>{{ activeProposal.grades.global.letter }}</p>
|
|
|
|
|
<p>{{ activeProposal.grades.global.mention }}</p>
|
|
|
|
|
<input type="range" :value="activeProposal.grades.global.number" disabled />
|
|
|
|
|
<p>{{ activeProposal.grades.global.comment }}</p>
|
2025-01-22 17:08:32 +01:00
|
|
|
|
|
|
|
|
<h4>Positionnement</h4>
|
2025-01-23 12:23:14 +01:00
|
|
|
{{ activeProposal.grades.position.complexity }}
|
|
|
|
|
{{ activeProposal.grades.position.weight }}
|
2025-01-22 17:08:32 +01:00
|
|
|
|
|
|
|
|
<h4>Indicateur des composants impliqués</h4>
|
|
|
|
|
<template
|
2025-01-23 12:23:14 +01:00
|
|
|
v-for="indicator in activeProposal.grades.indicators"
|
2025-01-22 17:08:32 +01:00
|
|
|
:key="indicator.value"
|
|
|
|
|
>
|
|
|
|
|
<label for="">{{ indicator.label }}</label>
|
|
|
|
|
<input type="range" :value="indicator.value" min="-5" max="+5" disabled />
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- Je laisse pour le moment en suspend l'effet de ce bouton car je ne suis pas sûr de comprendre. J'ai mis un commentaire sur Figma -->
|
|
|
|
|
<button>Demander une expertise d'optimisation</button>
|
2025-01-22 13:25:34 +01:00
|
|
|
</aside>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup>
|
|
|
|
|
import { storeToRefs } from "pinia";
|
|
|
|
|
import { usePageStore } from "../../stores/page";
|
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
import "dayjs/locale/fr";
|
2025-01-23 12:23:14 +01:00
|
|
|
import { ref, onBeforeUnmount } from "vue";
|
2025-01-22 13:25:34 +01:00
|
|
|
|
|
|
|
|
dayjs.locale("fr");
|
|
|
|
|
|
|
|
|
|
const { page } = storeToRefs(usePageStore());
|
|
|
|
|
|
2025-01-23 12:23:14 +01:00
|
|
|
const emits = defineEmits(["close"]);
|
|
|
|
|
|
|
|
|
|
const proposals = page.value.designToLight;
|
|
|
|
|
|
|
|
|
|
proposals[0].isActive = true;
|
|
|
|
|
|
|
|
|
|
const activeProposal = ref(proposals[0]);
|
|
|
|
|
|
|
|
|
|
window.addEventListener("keyup", closeOnEscape);
|
|
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
window.removeEventListener("keyup", closeOnEscape);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Functions
|
|
|
|
|
function closeOnEscape(event) {
|
|
|
|
|
if (event.key === "Escape") emits("close");
|
|
|
|
|
}
|
2025-01-22 13:25:34 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
aside {
|
|
|
|
|
position: fixed;
|
|
|
|
|
right: 1rem;
|
|
|
|
|
top: 1rem;
|
|
|
|
|
bottom: 1rem;
|
|
|
|
|
padding: 0.7rem;
|
|
|
|
|
width: 30vw;
|
|
|
|
|
border-radius: 1rem;
|
|
|
|
|
background-color: #191919;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
2025-01-23 12:23:14 +01:00
|
|
|
|
|
|
|
|
button {
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
2025-01-22 13:25:34 +01:00
|
|
|
</style>
|