save DTL
This commit is contained in:
parent
0923c9ec01
commit
28804ceba1
7 changed files with 267 additions and 181 deletions
|
|
@ -28,6 +28,7 @@ tabs:
|
||||||
label: PDF
|
label: PDF
|
||||||
type: files
|
type: files
|
||||||
template: pdf
|
template: pdf
|
||||||
|
upload: pdf
|
||||||
multiple: false
|
multiple: false
|
||||||
description:
|
description:
|
||||||
type: textarea
|
type: textarea
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,34 @@ designToLight:
|
||||||
label: Design to light
|
label: Design to light
|
||||||
icon: leaf
|
icon: leaf
|
||||||
|
|
||||||
columns:
|
fields:
|
||||||
- width: 2/10
|
isDTLEnabled:
|
||||||
fields:
|
label: Actif
|
||||||
isDTLEnabled:
|
type: toggle
|
||||||
label: Actif
|
default: false
|
||||||
type: toggle
|
width: 2/10
|
||||||
default: false
|
dtlProposals:
|
||||||
- width: 8/10
|
label: Propositions
|
||||||
|
type: structure
|
||||||
|
when:
|
||||||
|
isDTLEnabled: true
|
||||||
|
help: |
|
||||||
|
**La première proposition correspond au projet initial. Les propositions suivantes constituent des alternatives.**
|
||||||
|
Pour déplacer une proposition, survolez son index puis cliquez-glissez la poignée ⁝⁝
|
||||||
|
width: 8/10
|
||||||
|
columns:
|
||||||
|
DTLProposalLocation:
|
||||||
|
label: Localisation
|
||||||
|
width: 1/2
|
||||||
|
DTLGrade:
|
||||||
|
label: Note globale
|
||||||
|
width: 1/2
|
||||||
|
after: / 10
|
||||||
|
|
||||||
fields:
|
fields:
|
||||||
DTLTargetHeadline:
|
DTLTargetHeadline:
|
||||||
type: headline
|
type: headline
|
||||||
label: La proposition Design to light
|
label: La proposition
|
||||||
|
|
||||||
DTLProposalLocation:
|
DTLProposalLocation:
|
||||||
label: Localisation
|
label: Localisation
|
||||||
|
|
@ -24,8 +40,6 @@ columns:
|
||||||
industrialIdeation: Idéation industrielle
|
industrialIdeation: Idéation industrielle
|
||||||
virtualSampleDynamicTrack: Échantillon virtuel - piste dynamique
|
virtualSampleDynamicTrack: Échantillon virtuel - piste dynamique
|
||||||
virtualSampleStaticTrack: Échantillon virtuel - piste statique
|
virtualSampleStaticTrack: Échantillon virtuel - piste statique
|
||||||
when:
|
|
||||||
isDTLEnabled: true
|
|
||||||
width: 1/2
|
width: 1/2
|
||||||
|
|
||||||
DTLproposal:
|
DTLproposal:
|
||||||
|
|
@ -76,10 +90,38 @@ columns:
|
||||||
type: range
|
type: range
|
||||||
min: 0
|
min: 0
|
||||||
max: 10
|
max: 10
|
||||||
|
default: 5
|
||||||
tooltip:
|
tooltip:
|
||||||
after: / 10
|
after: / 10
|
||||||
when:
|
|
||||||
isDTLEnabled: true
|
positionHeadline:
|
||||||
|
type: headline
|
||||||
|
label: Positionnement
|
||||||
|
|
||||||
|
DTLComplexityGrade:
|
||||||
|
label: Complexité
|
||||||
|
type: range
|
||||||
|
before: Complexe
|
||||||
|
min: -5
|
||||||
|
max: 5
|
||||||
|
after: Sobre
|
||||||
|
default: 0
|
||||||
|
help: Axe horizontal (X) du graph
|
||||||
|
width: 1/2
|
||||||
|
DTLWeightGrade:
|
||||||
|
label: Poids
|
||||||
|
type: range
|
||||||
|
before: Lourd
|
||||||
|
min: -5
|
||||||
|
max: 5
|
||||||
|
after: Léger
|
||||||
|
default: 0
|
||||||
|
help: Axe vertical (Y) du graph
|
||||||
|
width: 1/2
|
||||||
|
|
||||||
|
indicatorsHeadline:
|
||||||
|
type: headline
|
||||||
|
label: Indicateurs
|
||||||
|
|
||||||
DTLDesignGrade:
|
DTLDesignGrade:
|
||||||
label: Design global
|
label: Design global
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function getFileData($file) {
|
function getFileData($file) {
|
||||||
|
if (!$file) return null;
|
||||||
$data = [
|
$data = [
|
||||||
'modified' => $file->modified('YYYY-MM-dd'),
|
'modified' => $file->modified('YYYY-MM-dd'),
|
||||||
'url' => $file->thumb([
|
'url' => $file->thumb([
|
||||||
|
|
|
||||||
|
|
@ -1,160 +1,154 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function getGlobalEvaluation($numberedGrade) {
|
function getGlobalEvaluation($numberedGrade) {
|
||||||
if ($numberedGrade >= 0 && $numberedGrade < 3) {
|
$gradeMapping = [
|
||||||
return [
|
[0, 3, "D", "Assez lourd", "Allègement du flacon recommandé"],
|
||||||
"letter" => "D",
|
[3, 6, "C", "Assez lourd", "Allègement du flacon recommandé"],
|
||||||
|
[6, 8, "B", "Assez lourd", "Allègement du flacon recommandé"],
|
||||||
|
[8, 10, "A", "Léger", "Conception optimisée"],
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($gradeMapping as [$min, $max, $letter, $mention, $comment]) {
|
||||||
|
if ($numberedGrade >= $min && $numberedGrade < $max) {
|
||||||
|
return [
|
||||||
|
"letter" => $letter,
|
||||||
|
"number" => $numberedGrade,
|
||||||
|
"mention" => $mention,
|
||||||
|
"comment" => $comment,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
"letter" => "",
|
||||||
"number" => $numberedGrade,
|
"number" => $numberedGrade,
|
||||||
"mention" => "Assez lourd",
|
"mention" => "Non défini",
|
||||||
"comment" => "Allègement du flacon recommandé"
|
"comment" => "Pas d'évaluation disponible",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if ($numberedGrade >= 3 && $numberedGrade < 6) {
|
|
||||||
return [
|
function processDTLProposals($page) {
|
||||||
"letter" => "C",
|
$proposals = [];
|
||||||
"number" => $numberedGrade,
|
|
||||||
"mention" => "Assez lourd",
|
foreach ($page->dtlProposals()->toStructure() as $proposal) {
|
||||||
"comment" => "Allègement du flacon recommandé"
|
$location = $proposal->DTLProposalLocation()->value();
|
||||||
];
|
$DTLProposal = null;
|
||||||
}
|
|
||||||
if ($numberedGrade >= 6 && $numberedGrade < 8) {
|
switch ($location) {
|
||||||
return [
|
case 'proposal':
|
||||||
"letter" => "B",
|
$proposalPage = $page->find('proposal');
|
||||||
"number" => $numberedGrade,
|
$proposalFile = $proposal->DTLproposal()->toFile();
|
||||||
"mention" => "Assez lourd",
|
|
||||||
"comment" => "Allègement du flacon recommandé"
|
if ($proposalPage && $proposalFile) {
|
||||||
];
|
$index = $proposalPage->pdf()->toFiles()->indexOf($proposalFile);
|
||||||
}
|
$DTLProposal = [
|
||||||
if ($numberedGrade >= 8 && $numberedGrade <= 10) {
|
"location" => "proposal",
|
||||||
return [
|
"path" => "/projects/" . $page->slug() . "?dialog=proposal&fileIndex=" . $index,
|
||||||
"letter" => "A",
|
"date" => $proposalFile->modified("d/MM/Y"),
|
||||||
"number" => $numberedGrade,
|
"stepLabel" => "Proposition commerciale",
|
||||||
"mention" => "Assez lourd",
|
];
|
||||||
"comment" => "Allègement du flacon recommandé"
|
}
|
||||||
];
|
break;
|
||||||
}
|
|
||||||
return [
|
case 'industrialIdeation':
|
||||||
"letter" => "",
|
$proposalPage = $page->find('industrial-ideation');
|
||||||
"number" => $numberedGrade,
|
$proposalFile = $proposal->DTLindustrialIdeation()->toFile();
|
||||||
"mention" => "Assez lourd",
|
|
||||||
"comment" => "Allègement du flacon recommandé"
|
if ($proposalPage && $proposalFile) {
|
||||||
];
|
$DTLProposal = [
|
||||||
|
"location" => "industrialIdeation",
|
||||||
|
"path" => "/projects/" . $page->slug() . "?dialog=industrial-ideation",
|
||||||
|
"date" => $proposalFile->modified("d/MM/Y"),
|
||||||
|
"stepLabel" => "Idéation industrielle",
|
||||||
|
];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'virtualSampleDynamicTrack':
|
||||||
|
$proposalPage = $proposal->DTLVirtualSampleDynamicTrack()->toPage();
|
||||||
|
if ($proposalPage) {
|
||||||
|
$DTLProposal = [
|
||||||
|
"location" => "virtualSampleDynamicTrack",
|
||||||
|
"path" => "/projects/" . $page->slug() . "?dialog=virtual-sample",
|
||||||
|
"date" => $proposalPage->modified("d/MM/Y"),
|
||||||
|
"stepLabel" => "Échantillon virtuel - piste dynamique",
|
||||||
|
];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'virtualSampleStaticTrack':
|
||||||
|
$proposalPage = $page->find('virtual-sample');
|
||||||
|
$proposalFile = $proposal->DTLVirtualSampleStaticTrack()->toFile();
|
||||||
|
if ($proposalPage && $proposalFile) {
|
||||||
|
$DTLProposal = [
|
||||||
|
"location" => "virtualSampleStaticTrack",
|
||||||
|
"path" => "/projects/" . $page->slug() . "?dialog=virtual-sample",
|
||||||
|
"date" => $proposalFile->modified("d/MM/Y"),
|
||||||
|
"stepLabel" => "Échantillon virtuel - piste statique",
|
||||||
|
];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($DTLProposal) {
|
||||||
|
$numberedGlobalGrade = (int) $proposal->DTLGrade()->value() ?? 0;
|
||||||
|
|
||||||
|
$DTLProposal["grades"] = [
|
||||||
|
"global" => getGlobalEvaluation($numberedGlobalGrade),
|
||||||
|
"position" => [
|
||||||
|
"complexity" => (int) $proposal->DTLComplexityGrade()->value() ?? 0,
|
||||||
|
"weight" => (int) $proposal->DTLWeightGrade()->value() ?? 0,
|
||||||
|
],
|
||||||
|
"indicators" => [
|
||||||
|
[
|
||||||
|
"label" => "design",
|
||||||
|
"value" => (int) $proposal->DTLDesignGrade()->value() ?? 0,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"label" => "ring",
|
||||||
|
"value" => (int) $proposal->DTLRingGrade()->value() ?? 0,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"label" => "shoulder",
|
||||||
|
"value" => (int) $proposal->DTLShoulderGrade()->value() ?? 0,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"label" => "skeleton",
|
||||||
|
"value" => (int) $proposal->DTLSkeletonGrade()->value() ?? 0,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"label" => "foot",
|
||||||
|
"value" => (int) $proposal->DTLFootGrade()->value() ?? 0,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"label" => "bottom",
|
||||||
|
"value" => (int) $proposal->DTLBottomGrade()->value() ?? 0,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$proposals[] = $DTLProposal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $proposals;
|
||||||
}
|
}
|
||||||
|
|
||||||
$project = [
|
$project = [
|
||||||
"title" => $page->title()->value(),
|
"title" => $page->title()->value(),
|
||||||
"url" => $page->url(),
|
"url" => $page->url(),
|
||||||
"modified" => $page->modified("Y-MM-d"),
|
"modified" => $page->modified("Y-MM-d"),
|
||||||
"status" => $page->status(),
|
"status" => $page->status(),
|
||||||
"logo" => $page->client()->isNotEmpty() && $page->client()->toPage() ? $page->client()->toPage()->logo()->toFile()->url() : null,
|
"logo" => $page->client()->isNotEmpty() && $page->client()->toPage()
|
||||||
"steps" => $page->getSteps(),
|
? $page->client()->toPage()->logo()->toFile()->url()
|
||||||
"designToLight" => null
|
: null,
|
||||||
|
"steps" => $page->getSteps(),
|
||||||
|
"designToLight" => $page->isDTLEnabled() ? processDTLProposals($page) : null,
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($page->isDTLEnabled()) {
|
|
||||||
$DTLProposal = null;
|
|
||||||
$proposalLocation = $page->DTLProposalLocation()->value();
|
|
||||||
|
|
||||||
switch ($proposalLocation) {
|
|
||||||
case 'proposal':
|
|
||||||
$proposalPage = $page->find('proposal');
|
|
||||||
$proposalFile = $page->DTLProposal()->toFile();
|
|
||||||
|
|
||||||
if ($proposalPage && $proposalFile) {
|
|
||||||
$index = $proposalPage->pdf()->toFiles()->indexOf($proposalFile);
|
|
||||||
$DTLProposal = [
|
|
||||||
"location" => "proposal",
|
|
||||||
"path" => "/projects/" . $page->slug() . "?dialog=proposal&fileIndex=" . $index,
|
|
||||||
"date" => $proposalFile->modified("Y-MM-d"),
|
|
||||||
"stepLabel" => "Proposition commerciale",
|
|
||||||
];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'industrialIdeation':
|
|
||||||
$proposalPage = $page->find('industrial-ideation');
|
|
||||||
$proposalFile = $page->DTLindustrialIdeation()->toFile();
|
|
||||||
|
|
||||||
if ($proposalPage && $proposalFile) {
|
|
||||||
$index = $proposalPage->pdf()->toFiles()->indexOf($proposalFile);
|
|
||||||
$DTLProposal = [
|
|
||||||
"location" => "proposal",
|
|
||||||
"path" => "/projects/" . $page->slug() . "?dialog=industrial-ideation&fileIndex=" . $index,
|
|
||||||
"date" => $proposalFile->modified("Y-MM-d"),
|
|
||||||
"stepLabel" => "Idéation industrielle"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'virtualSampleDynamicTrack':
|
|
||||||
$proposalPage = $page->DTLVirtualSampleDynamicTrack()->toPage();
|
|
||||||
|
|
||||||
if ($proposalPage) {
|
|
||||||
$DTLProposal = [
|
|
||||||
"location" => "proposal",
|
|
||||||
"path" => "/projects/" . $page->slug() . "?dialog=virtual-sample",
|
|
||||||
"date" => $proposalPage->modified("Y-MM-d"),
|
|
||||||
"stepLabel" => "Échantillon virtuel"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'virtualSampleStaticTrack':
|
|
||||||
$proposalPage = $page->find('virtual-sample');
|
|
||||||
$proposalFile = $page->DTLVirtualSampleStaticTrack()->toFile();
|
|
||||||
|
|
||||||
if ($proposalPage && $proposalFile) {
|
|
||||||
$DTLProposal = [
|
|
||||||
"location" => "proposal",
|
|
||||||
"path" => "/projects/" . $page->slug() . "?dialog=virtual-sample",
|
|
||||||
"date" => $proposalFile->modified("Y-MM-d"),
|
|
||||||
"stepLabel" => "Échantillon virtuel"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($page->DTLGrade()->isNotEmpty()) {
|
|
||||||
$numberedGlobalGrade = (int) $page->DTLGrade()->value() ?? 0;
|
|
||||||
$DTLProposal["grades"] = [
|
|
||||||
"global" => getGlobalEvaluation($numberedGlobalGrade),
|
|
||||||
"indicators" => [
|
|
||||||
[
|
|
||||||
"label" => "design",
|
|
||||||
"value" => (int) $page->DTLDesignGrade()->value() ?? 0,
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"label" => "ring",
|
|
||||||
"value" => (int) $page->DTLRingGrade()->value() ?? 0,
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"label" => "shoulder",
|
|
||||||
"value" => (int) $page->DTLShoulderGrade()->value() ?? 0,
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"label" => "skeleton",
|
|
||||||
"value" => (int) $page->DTLSkeletonGrade()->value() ?? 0,
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"label" => "foot",
|
|
||||||
"value" => (int) $page->DTLFootGrade()->value() ?? 0,
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"label" => "bottom",
|
|
||||||
"value" => (int) $page->DTLBottomGrade()->value() ?? 0,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$project["designToLight"] = $DTLProposal;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$pageData = array_merge($genericData, $project);
|
$pageData = array_merge($genericData, $project);
|
||||||
|
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
"page" => $pageData,
|
"page" => $pageData,
|
||||||
"user" => $userData
|
"user" => $userData,
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,11 @@
|
||||||
<Menu />
|
<Menu />
|
||||||
<RouterView />
|
<RouterView />
|
||||||
</div>
|
</div>
|
||||||
<DTLPanel v-if="isDTLPanelOpen" />
|
<DTLPanel v-if="isDTLPanelOpen" @close="isDTLPanelOpen = false" />
|
||||||
<DTLButton @click="isDTLPanelOpen = !isDTLPanelOpen" />
|
<DTLButton
|
||||||
|
v-if="page?.designToLight?.length > 0"
|
||||||
|
@click="isDTLPanelOpen = !isDTLPanelOpen"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,31 @@
|
||||||
<template>
|
<template>
|
||||||
<button v-if="page?.designToLight?.grades?.global">
|
<button :data-new="hasAlternatives ? true : undefined">{{ content }}</button>
|
||||||
{{ page.designToLight.grades.global.letter }}
|
|
||||||
</button>
|
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { usePageStore } from "../../stores/page";
|
import { usePageStore } from "../../stores/page";
|
||||||
|
import { computed } from "vue";
|
||||||
|
|
||||||
const { page } = storeToRefs(usePageStore());
|
const { page } = storeToRefs(usePageStore());
|
||||||
|
|
||||||
|
const hasAlternatives = computed(() => {
|
||||||
|
return page.value.designToLight.length > 1;
|
||||||
|
});
|
||||||
|
|
||||||
|
const content = computed(() => {
|
||||||
|
if (hasAlternatives.value) return "new";
|
||||||
|
return page.value.designToLight[0].grades.global.letter;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
button {
|
||||||
|
position: fixed;
|
||||||
|
min-width: 4rem;
|
||||||
|
min-height: 2rem;
|
||||||
|
right: 2rem;
|
||||||
|
bottom: 2rem;
|
||||||
|
background-color: #000;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,29 @@
|
||||||
<template>
|
<template>
|
||||||
<aside>
|
<aside>
|
||||||
<p>Données basées sur la proposition du {{ frenchFormattedModified }}</p>
|
<button @click="emits('close')">X</button>
|
||||||
<p>{{ page.designToLight.stepLabel }}</p>
|
<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>
|
||||||
|
|
||||||
<h4>Note globale</h4>
|
<h4>Note globale</h4>
|
||||||
<p>{{ page.designToLight.grades.global.letter }}</p>
|
<p>{{ activeProposal.grades.global.letter }}</p>
|
||||||
<p>{{ page.designToLight.grades.global.mention }}</p>
|
<p>{{ activeProposal.grades.global.mention }}</p>
|
||||||
<input
|
<input type="range" :value="activeProposal.grades.global.number" disabled />
|
||||||
type="range"
|
<p>{{ activeProposal.grades.global.comment }}</p>
|
||||||
:value="page.designToLight.grades.global.number"
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
<p>{{ page.designToLight.grades.global.comment }}</p>
|
|
||||||
|
|
||||||
<h4>Positionnement</h4>
|
<h4>Positionnement</h4>
|
||||||
|
{{ activeProposal.grades.position.complexity }}
|
||||||
|
{{ activeProposal.grades.position.weight }}
|
||||||
|
|
||||||
<h4>Indicateur des composants impliqués</h4>
|
<h4>Indicateur des composants impliqués</h4>
|
||||||
<template
|
<template
|
||||||
v-for="indicator in page.designToLight.grades.indicators"
|
v-for="indicator in activeProposal.grades.indicators"
|
||||||
:key="indicator.value"
|
:key="indicator.value"
|
||||||
>
|
>
|
||||||
<label for="">{{ indicator.label }}</label>
|
<label for="">{{ indicator.label }}</label>
|
||||||
|
|
@ -33,15 +39,30 @@ import { storeToRefs } from "pinia";
|
||||||
import { usePageStore } from "../../stores/page";
|
import { usePageStore } from "../../stores/page";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import "dayjs/locale/fr";
|
import "dayjs/locale/fr";
|
||||||
import { computed } from "vue";
|
import { ref, onBeforeUnmount } from "vue";
|
||||||
|
|
||||||
dayjs.locale("fr");
|
dayjs.locale("fr");
|
||||||
|
|
||||||
const { page } = storeToRefs(usePageStore());
|
const { page } = storeToRefs(usePageStore());
|
||||||
|
|
||||||
const frenchFormattedModified = dayjs(page.value.designToLight.date).format(
|
const emits = defineEmits(["close"]);
|
||||||
"D/MM/YYYY"
|
|
||||||
);
|
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");
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
@ -56,4 +77,8 @@ aside {
|
||||||
background-color: #191919;
|
background-color: #191919;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue