generated from cawa-93/vite-electron-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
848b7b2
commit 0f418e4
Showing
5 changed files
with
699 additions
and
48 deletions.
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
packages/renderer/src/components/nuées/CarteStatutNuée.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<template> | ||
<v-dialog v-model="dialogue"> | ||
<template #activator="{props: propsActivateur}"> | ||
<slot | ||
name="activator" | ||
v-bind="{props: propsActivateur}" | ||
></slot> | ||
</template> | ||
<v-card | ||
class="mx-auto" | ||
:min-width="mdAndUp ? 500 : 300" | ||
> | ||
<v-card-item> | ||
<v-card-title>{{ t('nuées.statut.carte.titre') }}</v-card-title> | ||
</v-card-item> | ||
<v-card-text> | ||
<choisir-statut | ||
:initial="statutChoisi" | ||
@choisir="stt => (statutChoisi = stt)" | ||
> | ||
<template #sélecteur="{choisirNouvelle}"> | ||
<selecteur-nuee | ||
:multiples="false" | ||
@selectionnee="ids => choisirNouvelle(ids[0])" | ||
/> | ||
</template> | ||
</choisir-statut> | ||
</v-card-text> | ||
<v-card-actions> | ||
<v-spacer /> | ||
<v-btn | ||
:disabled="!modifié" | ||
:loading="enModification" | ||
variant="flat" | ||
color="primary" | ||
@click="sauvegarder" | ||
> | ||
{{ t('communs.sauvegarder') }} | ||
</v-btn> | ||
<v-btn | ||
variant="flat" | ||
append-icon="mdi-close" | ||
@click="dialogue = false" | ||
> | ||
{{ t('communs.fermer') }} | ||
</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</v-dialog> | ||
</template> | ||
<script setup lang="ts"> | ||
import {suivre} from '@constl/vue'; | ||
import {computed, ref} from 'vue'; | ||
import {useDisplay} from 'vuetify'; | ||
import type {types} from '@constl/ipa'; | ||
import {கிளிமூக்கை_பயன்படுத்து} from '@lassi-js/kilimukku-vue'; | ||
import {watchEffect} from 'vue'; | ||
import {utiliserConstellation} from '../utils'; | ||
import SelecteurNuee from './SélecteurNuée.vue'; | ||
import ChoisirStatut from '/@/components/communs/ChoisirStatut.vue'; | ||
const props = defineProps<{idNuee: string}>(); | ||
const {மொழியாக்கம்_பயன்படுத்து} = கிளிமூக்கை_பயன்படுத்து(); | ||
const {$மொ: t} = மொழியாக்கம்_பயன்படுத்து(); | ||
const {mdAndUp} = useDisplay(); | ||
const constl = utiliserConstellation(); | ||
// Navigation | ||
const dialogue = ref(false); | ||
// Statut | ||
const statut = suivre(constl.nuées.suivreStatutNuée, {idNuée: props.idNuee}); | ||
const statutChoisi = ref<types.schémaStatut>(); | ||
watchEffect(() => { | ||
statutChoisi.value = statut.value; | ||
}); | ||
const modifié = computed(() => { | ||
return ( | ||
statut.value?.statut !== statutChoisi.value?.statut || | ||
statut.value?.idNouvelle !== statutChoisi.value?.idNouvelle | ||
); | ||
}); | ||
const enModification = ref(false); | ||
const sauvegarder = async () => { | ||
enModification.value = true; | ||
if (statutChoisi.value) | ||
await constl.nuées.changerStatutNuée({ | ||
idNuée: props.idNuee, | ||
statut: statutChoisi.value, | ||
}); | ||
enModification.value = false; | ||
dialogue.value = false; | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.