codevdesign 1.0.33 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +12 -6
- package/assets/csqc.css +0 -259
- package/composants/csqcAide.vue +0 -55
- package/composants/csqcAlerteErreur.vue +0 -87
- package/composants/csqcChaise/chaiseConteneur.vue +0 -367
- package/composants/csqcChaise/chaiseItem.vue +0 -54
- package/composants/csqcCodeBudgetaireGenerique.vue +0 -336
- package/composants/csqcConfirmation.vue +0 -75
- package/composants/csqcDate.vue +0 -57
- package/composants/csqcDialogue.vue +0 -118
- package/composants/csqcEditeurTexteRiche.vue +0 -380
- package/composants/csqcEntete.vue +0 -163
- package/composants/csqcImportCSV.vue +0 -125
- package/composants/csqcModaleSaisie.vue +0 -95
- package/composants/csqcOptionSwitch.vue +0 -120
- package/composants/csqcRecherche.vue +0 -213
- package/composants/csqcRechercheUtilisateur.vue +0 -197
- package/composants/csqcSnackbar.vue +0 -88
- package/composants/csqcTable/csqcTable.vue +0 -383
- package/composants/csqcTable/csqcTableExportExcel.vue +0 -58
- package/composants/csqcTable/csqcTableModaleChoixColonnes.vue +0 -586
- package/composants/csqcTexteBilingue.vue +0 -175
- package/composants/csqcTiroir.vue +0 -156
- package/composants/gabarit/csqcMenu.vue +0 -281
- package/composants/gabarit/pivEntete.vue +0 -205
- package/composants/gabarit/pivPiedPage.vue +0 -70
- package/composants/gabarit/vueDefault.vue +0 -5
- package/composants/validateurs.ts +0 -183
- package/enums/choixLangue.ts +0 -10
- package/index.ts +0 -74
- package/locales/en.json +0 -100
- package/locales/fr.json +0 -101
- package/modeles/apiReponse.ts +0 -12
- package/modeles/assurancesAssuranceGeneraleGrics.ts +0 -10
- package/modeles/assurancesAssurancePersonnelleGrics.ts +0 -13
- package/modeles/assurancesContratGrics.ts +0 -14
- package/modeles/assurancesDetailsPrimeReguliereGrics.ts +0 -12
- package/modeles/assurancesDonneesAssureurGrics.ts +0 -13
- package/modeles/assurancesEmployeGrics.ts +0 -11
- package/modeles/assurancesGrics.ts +0 -14
- package/modeles/assurancesRegimeAssuranceGrics.ts +0 -9
- package/modeles/assurancesRegimeBaseEmployeurGrics.ts +0 -9
- package/modeles/assurancesRegimeBaseGrics.ts +0 -9
- package/modeles/composants/csqcMenuModele.ts +0 -18
- package/modeles/composants/datatableColonne.ts +0 -31
- package/modeles/composants/snackbar.ts +0 -18
- package/modeles/data.ts +0 -24
- package/modeles/droitIntervention.ts +0 -14
- package/modeles/employeAdresseGrics.ts +0 -13
- package/modeles/employeAdressesPersonnellesGrics.ts +0 -12
- package/modeles/employeAffectationCorpsEmploiGrics.ts +0 -9
- package/modeles/employeBanquesCongeBanqueGrics.ts +0 -9
- package/modeles/employeBanquesCongeGrics.ts +0 -14
- package/modeles/employeBanquesCongeRegimeAbsenceGrics.ts +0 -9
- package/modeles/employeCourrielsPersonnels.ts +0 -9
- package/modeles/employeCourrielsProfessionnels.ts +0 -9
- package/modeles/employeEmploisCategorieGrics.ts +0 -9
- package/modeles/employeEmploisClasseGrics.ts +0 -9
- package/modeles/employeEmploisCorpsEmploiGrics.ts +0 -9
- package/modeles/employeEmploisEtatEmploiGrics.ts +0 -9
- package/modeles/employeEmploisGrics.ts +0 -37
- package/modeles/employeEmploisGroupePaieGrics.ts +0 -9
- package/modeles/employeEmploisLieuTravailPrincipalGrics.ts +0 -10
- package/modeles/employeEmploisLieuxTravailSecondairesGrics.ts +0 -10
- package/modeles/employeEmploisRegimeAbsenceGrics.ts +0 -9
- package/modeles/employeEmploisSecteurGrics.ts +0 -9
- package/modeles/employeEmploisStatutEngagementGrics.ts +0 -9
- package/modeles/employeExperienceEmploiGrics.ts +0 -9
- package/modeles/employeExperienceEmployeGrics.ts +0 -12
- package/modeles/employeExperienceExperiencesGrics.ts +0 -11
- package/modeles/employeExperienceExperiencesTotalesGrics.ts +0 -15
- package/modeles/employeExperienceGrics.ts +0 -17
- package/modeles/employeGrics.ts +0 -31
- package/modeles/employeMinsLsCodev.ts +0 -10
- package/modeles/employeTelephoneGrics.ts +0 -12
- package/modeles/employeTelephonesPersonnelsGrics.ts +0 -11
- package/modeles/employeTelephonesProfessionnelsGrics.ts +0 -11
- package/modeles/groupeCE.ts +0 -14
- package/modeles/groupeCEIntervalle.ts +0 -13
- package/modeles/historiquesAbsenceBanqueGrics.ts +0 -9
- package/modeles/historiquesAbsenceGrics.ts +0 -21
- package/modeles/historiquesAbsenceLieuTravailGrics.ts +0 -9
- package/modeles/historiquesAbsenceSousBanqueGrics.ts +0 -9
- package/modeles/intervention.ts +0 -35
- package/modeles/motifsAbsenceBanque.ts +0 -9
- package/modeles/motifsAbsenceGrics.ts +0 -17
- package/modeles/motifsAbsenceRegimeAbsence.ts +0 -9
- package/modeles/motifsAbsenceSousMotifs.ts +0 -9
- package/modeles/motifsAbsenceTraitementBanques.ts +0 -11
- package/modeles/notificationGabaritDefaut.ts +0 -10
- package/modeles/response.ts +0 -12
- package/modeles/role.ts +0 -31
- package/modeles/roleMin.ts +0 -12
- package/modeles/syndicat.ts +0 -26
- package/modeles/syndicatGroupeCe.ts +0 -10
- package/modeles/syndicatResponsable.ts +0 -15
- package/modeles/syndicatUnite.ts +0 -10
- package/modeles/typeEnseignement.ts +0 -14
- package/modeles/typeTelephone.ts +0 -12
- package/modeles/unite.ts +0 -23
- package/modeles/uniteTypeEnseignement.ts +0 -12
- package/modeles/utilisateur.ts +0 -15
- package/outils/appAxios.ts +0 -116
- package/outils/csqcOutils.ts +0 -366
- package/outils/rafraichisseurToken.ts +0 -187
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-row dense>
|
|
3
|
-
<v-col
|
|
4
|
-
v-if="afficherChampFr"
|
|
5
|
-
cols="12"
|
|
6
|
-
>
|
|
7
|
-
<label
|
|
8
|
-
v-if="!libelleInterieur"
|
|
9
|
-
:for="`saisieChampFr-${cleTradFr}`"
|
|
10
|
-
:class="{ libelle: true, required: estRequis }"
|
|
11
|
-
>{{ $t(cleTradFr) }}
|
|
12
|
-
</label>
|
|
13
|
-
<csqcAide
|
|
14
|
-
v-if="props.aide && !libelleInterieur"
|
|
15
|
-
:aide="props.aide"
|
|
16
|
-
hover
|
|
17
|
-
:style-css="'padding-bottom:6px;padding-left:8px;'"
|
|
18
|
-
/>
|
|
19
|
-
<v-textarea
|
|
20
|
-
v-if="textarea"
|
|
21
|
-
:id="`saisieChampFr-${cleTradFr}`"
|
|
22
|
-
v-model="model[champs.Francais]"
|
|
23
|
-
density="comfortable"
|
|
24
|
-
v-bind="$attrs"
|
|
25
|
-
rows="1"
|
|
26
|
-
:label="libelleInterieur ? $t(cleTradFr) : ''"
|
|
27
|
-
:rules="reglesInterne"
|
|
28
|
-
:autofocus="autofocus && afficherChampFr"
|
|
29
|
-
/>
|
|
30
|
-
<v-text-field
|
|
31
|
-
v-else
|
|
32
|
-
:id="`saisieChampFr-${cleTradFr}`"
|
|
33
|
-
v-model="model[champs.Francais]"
|
|
34
|
-
density="comfortable"
|
|
35
|
-
v-bind="$attrs"
|
|
36
|
-
:label="libelleInterieur ? $t(cleTradFr) : ''"
|
|
37
|
-
:rules="reglesInterne"
|
|
38
|
-
:autofocus="autofocus && afficherChampFr"
|
|
39
|
-
/>
|
|
40
|
-
</v-col>
|
|
41
|
-
<v-col
|
|
42
|
-
v-if="afficherChampEn"
|
|
43
|
-
cols="12"
|
|
44
|
-
>
|
|
45
|
-
<label
|
|
46
|
-
v-if="!libelleInterieur"
|
|
47
|
-
:for="`saisieChampEn-${cleTradEn}`"
|
|
48
|
-
:class="{ libelle: true, required: estRequis }"
|
|
49
|
-
>{{ $t(cleTradEn) }}</label
|
|
50
|
-
><csqcAide
|
|
51
|
-
v-if="props.aide && !libelleInterieur"
|
|
52
|
-
:aide="props.aide"
|
|
53
|
-
hover
|
|
54
|
-
:style-css="'padding-bottom:6px;padding-left:8px;'"
|
|
55
|
-
/>
|
|
56
|
-
<v-textarea
|
|
57
|
-
v-if="textarea"
|
|
58
|
-
:id="`saisieChampEn-${cleTradEn}`"
|
|
59
|
-
v-model="model[champs.Anglais]"
|
|
60
|
-
rows="1"
|
|
61
|
-
v-bind="$attrs"
|
|
62
|
-
density="comfortable"
|
|
63
|
-
:label="libelleInterieur ? $t(cleTradEn) : ''"
|
|
64
|
-
:rules="reglesInterne"
|
|
65
|
-
:autofocus="autofocus && !afficherChampFr"
|
|
66
|
-
/>
|
|
67
|
-
<v-text-field
|
|
68
|
-
v-else
|
|
69
|
-
:id="`saisieChampEn-${cleTradEn}`"
|
|
70
|
-
v-model="model[champs.Anglais]"
|
|
71
|
-
density="comfortable"
|
|
72
|
-
v-bind="$attrs"
|
|
73
|
-
:label="libelleInterieur ? $t(cleTradEn) : ''"
|
|
74
|
-
:rules="reglesInterne"
|
|
75
|
-
:autofocus="autofocus && !afficherChampFr"
|
|
76
|
-
/>
|
|
77
|
-
</v-col>
|
|
78
|
-
</v-row>
|
|
79
|
-
</template>
|
|
80
|
-
|
|
81
|
-
<script setup lang="ts" generic="T extends { id: number }">
|
|
82
|
-
import { estRequis as estRequisRegle, estUniqueBilingue, estMinimumLongueur, estMaximumLongueur } from './validateurs'
|
|
83
|
-
import { ChoixLangue } from '@/enums/choixLangue'
|
|
84
|
-
import csqcAide from './csqcAide.vue'
|
|
85
|
-
import { computed, type PropType, toRefs } from 'vue'
|
|
86
|
-
import { useI18n } from 'vue-i18n'
|
|
87
|
-
const { t } = useI18n({ useScope: 'global' })
|
|
88
|
-
|
|
89
|
-
const props = defineProps<{
|
|
90
|
-
aide?: string
|
|
91
|
-
textarea?: boolean
|
|
92
|
-
libelleInterieur?: boolean
|
|
93
|
-
estRequis?: boolean
|
|
94
|
-
autofocus?: boolean
|
|
95
|
-
estUniqueValeurs?: T[]
|
|
96
|
-
minimumLongueur?: number
|
|
97
|
-
maximumLongueur?: number
|
|
98
|
-
regles?: ((v: string) => string | true)[]
|
|
99
|
-
langue: ChoixLangue
|
|
100
|
-
i18nLibelleRacine: string
|
|
101
|
-
champs: { ['Francais']: keyof T; ['Anglais']: keyof T }
|
|
102
|
-
}>()
|
|
103
|
-
|
|
104
|
-
const { textarea, libelleInterieur, autofocus, estUniqueValeurs, regles, langue, i18nLibelleRacine, champs } =
|
|
105
|
-
toRefs(props)
|
|
106
|
-
|
|
107
|
-
const minimumLongueur = computed(() => props.minimumLongueur)
|
|
108
|
-
const maximumLongueur = computed(() => props.maximumLongueur)
|
|
109
|
-
const estRequis = computed(() => props.estRequis)
|
|
110
|
-
|
|
111
|
-
const model = defineModel({
|
|
112
|
-
type: Object as PropType<T>,
|
|
113
|
-
required: true,
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
const reglesInterne = computed(() => {
|
|
117
|
-
const _regles: ((v: string) => string | true)[] = regles.value ?? []
|
|
118
|
-
|
|
119
|
-
if (minimumLongueur.value && maximumLongueur.value && minimumLongueur.value > maximumLongueur.value) {
|
|
120
|
-
console.error(
|
|
121
|
-
`CsqcTexteBilingue - Longueur min > max. (Min ${minimumLongueur.value} > Max ${maximumLongueur.value})`,
|
|
122
|
-
)
|
|
123
|
-
throw Error(
|
|
124
|
-
`CsqcTexteBilingue - Longueur min > max. (Min ${minimumLongueur.value} > Max ${maximumLongueur.value})`,
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (estRequis.value) _regles.push(v => estRequisRegle(v, t))
|
|
129
|
-
|
|
130
|
-
if (estUniqueValeurs.value) {
|
|
131
|
-
_regles.push(v =>
|
|
132
|
-
estUniqueBilingue(
|
|
133
|
-
v,
|
|
134
|
-
model.value,
|
|
135
|
-
{
|
|
136
|
-
champs: { Anglais: champs.value.Anglais, Francais: champs.value.Francais },
|
|
137
|
-
valeurs: estUniqueValeurs.value!,
|
|
138
|
-
langueCss: langue.value,
|
|
139
|
-
},
|
|
140
|
-
t,
|
|
141
|
-
),
|
|
142
|
-
)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (minimumLongueur.value !== undefined) _regles.push(v => estMinimumLongueur(v, minimumLongueur.value!, t))
|
|
146
|
-
|
|
147
|
-
if (maximumLongueur.value !== undefined) _regles.push(v => estMaximumLongueur(v, maximumLongueur.value!, t))
|
|
148
|
-
|
|
149
|
-
return _regles
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
// Clés i18n
|
|
153
|
-
const cleTradEn = computed(() => {
|
|
154
|
-
switch (langue.value) {
|
|
155
|
-
case ChoixLangue.Bilingue:
|
|
156
|
-
case ChoixLangue.Anglais:
|
|
157
|
-
return `${i18nLibelleRacine.value}.${String(champs.value.Anglais)}`
|
|
158
|
-
default:
|
|
159
|
-
return 'cle_manquante'
|
|
160
|
-
}
|
|
161
|
-
})
|
|
162
|
-
|
|
163
|
-
const cleTradFr = computed(() => {
|
|
164
|
-
switch (langue.value) {
|
|
165
|
-
case ChoixLangue.Bilingue:
|
|
166
|
-
case ChoixLangue.Francais:
|
|
167
|
-
return `${i18nLibelleRacine.value}.${String(champs.value.Francais)}`
|
|
168
|
-
default:
|
|
169
|
-
return 'cle_manquante'
|
|
170
|
-
}
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
const afficherChampFr = computed(() => langue.value === ChoixLangue.Francais || langue.value === ChoixLangue.Bilingue)
|
|
174
|
-
const afficherChampEn = computed(() => langue.value === ChoixLangue.Anglais || langue.value === ChoixLangue.Bilingue)
|
|
175
|
-
</script>
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-navigation-drawer
|
|
3
|
-
v-model="visible"
|
|
4
|
-
location="right"
|
|
5
|
-
temporary
|
|
6
|
-
v-bind="$attrs"
|
|
7
|
-
:width="grosseurTiroir"
|
|
8
|
-
class="pa-0 elevation-2 csqc-ligneBleue"
|
|
9
|
-
:persistent="persistant"
|
|
10
|
-
@keydown.esc="!persistant ? fermeture : ''"
|
|
11
|
-
@click:outside="!persistant ? fermeture : ''"
|
|
12
|
-
>
|
|
13
|
-
<v-card class="pa-0 ma-0 pl-8 pt-8">
|
|
14
|
-
<!-- Bouton en haut à droite -->
|
|
15
|
-
<v-btn
|
|
16
|
-
icon="mdi-close"
|
|
17
|
-
variant="text"
|
|
18
|
-
class="position-absolute couleurHover"
|
|
19
|
-
style="top: 5px; right: 5px"
|
|
20
|
-
@click="fermeture"
|
|
21
|
-
></v-btn>
|
|
22
|
-
|
|
23
|
-
<v-card-title
|
|
24
|
-
class="pa-0 ma-0 pb-6 text-wrap"
|
|
25
|
-
style="font-size: 24px"
|
|
26
|
-
>
|
|
27
|
-
<slot name="titre"></slot>
|
|
28
|
-
<div text-h5>{{ titre }}</div>
|
|
29
|
-
</v-card-title>
|
|
30
|
-
|
|
31
|
-
<v-card-text class="pa-0 ma-0 pb-6 pr-6">
|
|
32
|
-
<v-container>
|
|
33
|
-
<slot></slot>
|
|
34
|
-
<slot name="content"></slot>
|
|
35
|
-
</v-container>
|
|
36
|
-
</v-card-text>
|
|
37
|
-
<v-card-actions class="my-2 d-flex justify-end pr-6 pb-5">
|
|
38
|
-
<slot name="actions"></slot>
|
|
39
|
-
<v-btn
|
|
40
|
-
v-if="btnAnnuler"
|
|
41
|
-
color="primary"
|
|
42
|
-
variant="text"
|
|
43
|
-
:loading="operationEnCours"
|
|
44
|
-
@click="fermeture"
|
|
45
|
-
>
|
|
46
|
-
{{ props.btnAnnulerTexte ? props.btnAnnulerTexte : $t('csqc.bouton.annuler') }}
|
|
47
|
-
</v-btn>
|
|
48
|
-
|
|
49
|
-
<v-btn
|
|
50
|
-
v-if="btnOk"
|
|
51
|
-
class="Gouttiere"
|
|
52
|
-
color="primary"
|
|
53
|
-
variant="flat"
|
|
54
|
-
:loading="operationEnCours"
|
|
55
|
-
:disabled="btnOkDesactiver || operationEnCours"
|
|
56
|
-
@click="okBouton"
|
|
57
|
-
>
|
|
58
|
-
{{ props.btnOkTexte ? props.btnOkTexte : $t('csqc.bouton.ok') }}
|
|
59
|
-
</v-btn>
|
|
60
|
-
</v-card-actions>
|
|
61
|
-
</v-card>
|
|
62
|
-
</v-navigation-drawer>
|
|
63
|
-
</template>
|
|
64
|
-
<script lang="ts" setup>
|
|
65
|
-
import { ref, computed } from 'vue'
|
|
66
|
-
import { useDisplay } from 'vuetify'
|
|
67
|
-
|
|
68
|
-
const visible = ref(false)
|
|
69
|
-
const display = useDisplay()
|
|
70
|
-
|
|
71
|
-
// Déclaration des props
|
|
72
|
-
const props = defineProps({
|
|
73
|
-
titre: {
|
|
74
|
-
type: String,
|
|
75
|
-
default: '',
|
|
76
|
-
required: false,
|
|
77
|
-
},
|
|
78
|
-
btnAnnuler: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
default: true,
|
|
81
|
-
required: false,
|
|
82
|
-
},
|
|
83
|
-
btnOk: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
default: true,
|
|
86
|
-
required: false,
|
|
87
|
-
},
|
|
88
|
-
btnAnnulerTexte: {
|
|
89
|
-
type: String,
|
|
90
|
-
default: '',
|
|
91
|
-
required: false,
|
|
92
|
-
},
|
|
93
|
-
btnOkDesactiver: {
|
|
94
|
-
type: Boolean,
|
|
95
|
-
default: false,
|
|
96
|
-
required: false,
|
|
97
|
-
},
|
|
98
|
-
operationEnCours: { type: Boolean, default: false },
|
|
99
|
-
persistant: { type: Boolean, default: true },
|
|
100
|
-
btnOkTexte: {
|
|
101
|
-
type: String,
|
|
102
|
-
default: '',
|
|
103
|
-
required: false,
|
|
104
|
-
},
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
// Déclaration des événements
|
|
108
|
-
const emit = defineEmits(['fermer', 'ok'])
|
|
109
|
-
|
|
110
|
-
// Méthodes
|
|
111
|
-
const ouvrir = () => {
|
|
112
|
-
visible.value = true
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const fermer = () => {
|
|
116
|
-
visible.value = false
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const fermeture = () => {
|
|
120
|
-
emit('fermer')
|
|
121
|
-
fermer()
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const okBouton = () => {
|
|
125
|
-
emit('ok')
|
|
126
|
-
fermer()
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Calcul des tailles du tiroir en fonction du breakpoint
|
|
130
|
-
const grosseurTiroir = computed(() => {
|
|
131
|
-
switch (display.name.value) {
|
|
132
|
-
case 'xs':
|
|
133
|
-
return ''
|
|
134
|
-
case 'sm':
|
|
135
|
-
return 0.95 * display.width.value
|
|
136
|
-
case 'md':
|
|
137
|
-
return 0.8 * display.width.value
|
|
138
|
-
case 'lg':
|
|
139
|
-
return 0.7 * display.width.value
|
|
140
|
-
case 'xl':
|
|
141
|
-
return 0.6 * display.width.value
|
|
142
|
-
case 'xxl':
|
|
143
|
-
return 0.5 * display.width.value
|
|
144
|
-
default:
|
|
145
|
-
return ''
|
|
146
|
-
}
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
defineExpose({ ouvrir, fermer })
|
|
150
|
-
</script>
|
|
151
|
-
|
|
152
|
-
<style>
|
|
153
|
-
.csqc-ligneBleue {
|
|
154
|
-
border-left: 30px #095797 solid !important;
|
|
155
|
-
}
|
|
156
|
-
</style>
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- desktop -->
|
|
3
|
-
<div v-if="!estMobile">
|
|
4
|
-
<v-toolbar
|
|
5
|
-
class="pa-0 ajouterPointeur barreMenu"
|
|
6
|
-
:border="false"
|
|
7
|
-
elevation="2"
|
|
8
|
-
>
|
|
9
|
-
<div
|
|
10
|
-
v-for="item in filtrerMenuItems"
|
|
11
|
-
:key="item.nom"
|
|
12
|
-
class="pt-1"
|
|
13
|
-
>
|
|
14
|
-
<v-btn
|
|
15
|
-
v-if="doitAfficherItemMenu(item)"
|
|
16
|
-
variant="text"
|
|
17
|
-
:to="item.path"
|
|
18
|
-
:active="item.path === route"
|
|
19
|
-
:active-color="'white'"
|
|
20
|
-
:style="'min-width: 100px;'"
|
|
21
|
-
>{{ item.nom }}</v-btn
|
|
22
|
-
>
|
|
23
|
-
</div>
|
|
24
|
-
<v-spacer></v-spacer>
|
|
25
|
-
<!-- Sous Liste -->
|
|
26
|
-
<v-menu
|
|
27
|
-
v-for="(item, index) in filtrerSousListe"
|
|
28
|
-
:key="index"
|
|
29
|
-
open-on-hover
|
|
30
|
-
>
|
|
31
|
-
<template #activator="{ props }">
|
|
32
|
-
<v-btn
|
|
33
|
-
color="white"
|
|
34
|
-
v-bind="props"
|
|
35
|
-
:active="estActifSousliste(item)"
|
|
36
|
-
>
|
|
37
|
-
{{ item.nom }}
|
|
38
|
-
</v-btn>
|
|
39
|
-
</template>
|
|
40
|
-
|
|
41
|
-
<v-list
|
|
42
|
-
style="background-color: #223654 !important"
|
|
43
|
-
min-width="230px"
|
|
44
|
-
>
|
|
45
|
-
<v-list-item
|
|
46
|
-
v-for="(sousitem, sousindex) in obtenirItemsSousListeSelonDroits(item.id)"
|
|
47
|
-
:key="sousindex"
|
|
48
|
-
>
|
|
49
|
-
<v-btn
|
|
50
|
-
:max-height="35"
|
|
51
|
-
width="100%"
|
|
52
|
-
class="params_item"
|
|
53
|
-
:to="sousitem.path"
|
|
54
|
-
variant="text"
|
|
55
|
-
:active="sousitem.path === route"
|
|
56
|
-
>{{ sousitem.nom }}</v-btn
|
|
57
|
-
>
|
|
58
|
-
</v-list-item>
|
|
59
|
-
</v-list>
|
|
60
|
-
</v-menu>
|
|
61
|
-
<v-btn
|
|
62
|
-
v-if="btnDeconnexion"
|
|
63
|
-
variant="text"
|
|
64
|
-
:style="'min-width: 100px;'"
|
|
65
|
-
@click="deconnexion"
|
|
66
|
-
>{{ $t('csqc.csqcMenu.deconnexion') }}</v-btn
|
|
67
|
-
>
|
|
68
|
-
</v-toolbar>
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<!-- mobile -->
|
|
72
|
-
<div v-else>
|
|
73
|
-
<v-toolbar class="pa-0 ajouterPointeur barreMenuMobile">
|
|
74
|
-
<v-app-bar-nav-icon
|
|
75
|
-
variant="text"
|
|
76
|
-
@click.stop="menu = !menu"
|
|
77
|
-
></v-app-bar-nav-icon>
|
|
78
|
-
<v-toolbar-title
|
|
79
|
-
><label
|
|
80
|
-
class="ajouterPointeur"
|
|
81
|
-
style="color: white !important"
|
|
82
|
-
>{{ $t('menu.menu') }}</label
|
|
83
|
-
>
|
|
84
|
-
</v-toolbar-title>
|
|
85
|
-
</v-toolbar>
|
|
86
|
-
|
|
87
|
-
<!-- mobile -->
|
|
88
|
-
<v-navigation-drawer
|
|
89
|
-
v-model="menu"
|
|
90
|
-
nav
|
|
91
|
-
>
|
|
92
|
-
<v-list>
|
|
93
|
-
<!-- Menu principal -->
|
|
94
|
-
<template
|
|
95
|
-
v-for="item in filtrerMenuItems"
|
|
96
|
-
:key="item.nom"
|
|
97
|
-
>
|
|
98
|
-
<v-list-item
|
|
99
|
-
:to="item.path"
|
|
100
|
-
:active="item.path === route"
|
|
101
|
-
:title="item.nom"
|
|
102
|
-
/>
|
|
103
|
-
</template>
|
|
104
|
-
|
|
105
|
-
<!-- Sous-listes -->
|
|
106
|
-
<template
|
|
107
|
-
v-for="item in filtrerSousListe"
|
|
108
|
-
:key="item.id"
|
|
109
|
-
>
|
|
110
|
-
<v-list-group :value="item.nom">
|
|
111
|
-
<template #activator="{ props }">
|
|
112
|
-
<v-list-item
|
|
113
|
-
v-bind="props"
|
|
114
|
-
:title="item.nom"
|
|
115
|
-
/>
|
|
116
|
-
</template>
|
|
117
|
-
|
|
118
|
-
<template
|
|
119
|
-
v-for="(sousitem, index) in obtenirItemsSousListeSelonDroits(item.id)"
|
|
120
|
-
:key="index"
|
|
121
|
-
>
|
|
122
|
-
<v-list-item
|
|
123
|
-
:title="sousitem.nom"
|
|
124
|
-
:value="sousitem.nom"
|
|
125
|
-
:to="sousitem.path"
|
|
126
|
-
/>
|
|
127
|
-
</template>
|
|
128
|
-
</v-list-group>
|
|
129
|
-
</template>
|
|
130
|
-
|
|
131
|
-
<!-- ✅ Déconnexion : UNE seule fois -->
|
|
132
|
-
<v-list-item
|
|
133
|
-
v-if="btnDeconnexion"
|
|
134
|
-
:title="$t('csqc.csqcMenu.deconnexion')"
|
|
135
|
-
@click="deconnexion"
|
|
136
|
-
/>
|
|
137
|
-
</v-list>
|
|
138
|
-
</v-navigation-drawer>
|
|
139
|
-
</div>
|
|
140
|
-
</template>
|
|
141
|
-
|
|
142
|
-
<script setup lang="ts">
|
|
143
|
-
import type { MenuItem, SousListe, SousListeItems } from '../../modeles/composants/csqcMenuModele'
|
|
144
|
-
import { ref, computed } from 'vue'
|
|
145
|
-
|
|
146
|
-
const props = defineProps({
|
|
147
|
-
estMobile: {
|
|
148
|
-
type: Boolean,
|
|
149
|
-
required: true,
|
|
150
|
-
},
|
|
151
|
-
btnDeconnexion: {
|
|
152
|
-
type: Boolean,
|
|
153
|
-
required: false,
|
|
154
|
-
},
|
|
155
|
-
route: {
|
|
156
|
-
type: String,
|
|
157
|
-
required: true,
|
|
158
|
-
},
|
|
159
|
-
menuItems: {
|
|
160
|
-
type: Array as () => MenuItem[],
|
|
161
|
-
required: true,
|
|
162
|
-
},
|
|
163
|
-
sousliste: {
|
|
164
|
-
type: Array as () => SousListe[],
|
|
165
|
-
required: false,
|
|
166
|
-
default: () => [],
|
|
167
|
-
},
|
|
168
|
-
souslisteItems: {
|
|
169
|
-
type: Array as () => SousListeItems[],
|
|
170
|
-
required: false,
|
|
171
|
-
default: () => [],
|
|
172
|
-
},
|
|
173
|
-
droitsMap: {
|
|
174
|
-
type: Object as () => Record<string, boolean>,
|
|
175
|
-
required: true,
|
|
176
|
-
default: () => ({}),
|
|
177
|
-
},
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
const menu = ref<boolean>(false)
|
|
181
|
-
const emit = defineEmits(['deconnexion'])
|
|
182
|
-
|
|
183
|
-
/*const verifierDroits = (monelement: string) => {
|
|
184
|
-
return props.droitsMap[monelement] || false
|
|
185
|
-
}*/
|
|
186
|
-
|
|
187
|
-
const deconnexion = () => {
|
|
188
|
-
emit('deconnexion')
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const doitAfficherItemMenu = (item: MenuItem) => {
|
|
192
|
-
return props.droitsMap[item.droit] || false
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
const filtrerMenuItems = computed(() => {
|
|
196
|
-
return props.menuItems.filter(item => props.droitsMap[item.droit])
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
const filtrerSousListe = computed(() => {
|
|
200
|
-
return props.sousliste.filter(item => props.droitsMap[item.droit])
|
|
201
|
-
})
|
|
202
|
-
|
|
203
|
-
const obtenirItemsSousListeSelonDroits = (monitemId: number) => {
|
|
204
|
-
return props.souslisteItems.filter(item => item.parentId === monitemId && props.droitsMap[item.droit])
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Vérifie si un item de la sous-liste est actif (route correspond à un item)
|
|
208
|
-
const estActifSousliste = (item: SousListe) => {
|
|
209
|
-
// Vérifie si un des sous-items correspond à la route
|
|
210
|
-
return obtenirItemsSousListeSelonDroits(item.id).some(sousitem => sousitem.path === props.route)
|
|
211
|
-
}
|
|
212
|
-
</script>
|
|
213
|
-
<style lang="css" scoped>
|
|
214
|
-
/* desktop background de la barre de menu et hauteur */
|
|
215
|
-
.v-toolbar {
|
|
216
|
-
background-color: #223654;
|
|
217
|
-
height: 64px;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/* desktop couleur du texte de la barre, marge du haut, padding */
|
|
221
|
-
.barreMenu {
|
|
222
|
-
color: white !important;
|
|
223
|
-
padding: 0 10px 0 10px !important;
|
|
224
|
-
}
|
|
225
|
-
/* desktop */
|
|
226
|
-
.v-btn {
|
|
227
|
-
font-weight: 400;
|
|
228
|
-
height: 72px !important;
|
|
229
|
-
}
|
|
230
|
-
/* desktop */
|
|
231
|
-
.v-btn--active {
|
|
232
|
-
font-weight: 600 !important;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/* desktop empeche le texte parametre detre trop bas */
|
|
236
|
-
.params {
|
|
237
|
-
padding-top: 5px !important;
|
|
238
|
-
}
|
|
239
|
-
/* desktop */
|
|
240
|
-
.params_item {
|
|
241
|
-
font-weight: 400;
|
|
242
|
-
color: white !important;
|
|
243
|
-
background-color: #223654 !important;
|
|
244
|
-
}
|
|
245
|
-
/* desktop */
|
|
246
|
-
.params_item.v-btn--active {
|
|
247
|
-
color: white !important;
|
|
248
|
-
font-weight: 600 !important;
|
|
249
|
-
}
|
|
250
|
-
/* desktop */
|
|
251
|
-
.params_item.v-btn--active:hover {
|
|
252
|
-
color: white !important;
|
|
253
|
-
background-color: #223654 !important;
|
|
254
|
-
}
|
|
255
|
-
/* desktop */
|
|
256
|
-
.params_item.v-btn--active:hover::before {
|
|
257
|
-
color: #ffffff80 !important;
|
|
258
|
-
}
|
|
259
|
-
/* desktop */
|
|
260
|
-
.params_item.v-btn--active::before {
|
|
261
|
-
opacity: 0.24;
|
|
262
|
-
border-radius: 0;
|
|
263
|
-
color: #ffffff80 !important;
|
|
264
|
-
margin-top: 1px !important;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/* mobile couleur du texte de la barre, marge du haut, padding */
|
|
268
|
-
.barreMenuMobile {
|
|
269
|
-
color: white !important;
|
|
270
|
-
padding: 0 10px 0 10px !important;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/* mobile drawer apparait sous les app bar */
|
|
274
|
-
.v-navigation-drawer {
|
|
275
|
-
top: 132px !important;
|
|
276
|
-
}
|
|
277
|
-
/* mobile drawer, Calcule la hauteur comme étant 100% moins 132px pour afficher le scroll */
|
|
278
|
-
:deep(.v-navigation-drawer__content) {
|
|
279
|
-
height: calc(100% - 132px);
|
|
280
|
-
}
|
|
281
|
-
</style>
|