codevdesign 0.0.48 → 0.0.49
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/README.md +117 -117
- package/composants/csqcAide.vue +2 -2
- package/composants/csqcAlerteErreur.vue +86 -86
- package/composants/csqcChaise/chaiseItem.vue +53 -53
- package/composants/csqcConfirmation.vue +74 -74
- package/composants/csqcDialogue.vue +3 -4
- package/composants/csqcEntete.vue +127 -127
- package/composants/csqcOptionSwitch.vue +124 -124
- package/composants/csqcRecherche.vue +5 -2
- package/composants/csqcSnackbar.vue +1 -2
- package/composants/csqcTable/csqcTable.vue +389 -389
- package/composants/csqcTable/csqcTableExportExcel.vue +58 -58
- package/composants/csqcTexteBilingue.vue +13 -13
- package/composants/csqcTiroir.vue +1 -2
- package/composants/gabarit/csqcMenu.vue +7 -5
- package/composants/gabarit/pivEntete.vue +9 -6
- package/composants/gabarit/pivPiedPage.vue +70 -70
- package/composants/validateurs.ts +183 -181
- package/index.ts +68 -68
- package/modeles/apiReponse.ts +12 -12
- package/modeles/composants/datatableColonne.ts +14 -14
- package/modeles/composants/snackbar.ts +18 -18
- package/modeles/data.ts +24 -24
- package/modeles/droitIntervention.ts +14 -14
- package/modeles/groupeCE.ts +23 -23
- package/modeles/groupeCEIntervalle.ts +24 -24
- package/modeles/intervention.ts +35 -35
- package/modeles/notificationGabaritDefaut.ts +10 -10
- package/modeles/response.ts +12 -12
- package/modeles/role.ts +31 -31
- package/modeles/roleMin.ts +12 -12
- package/modeles/unite.ts +41 -41
- package/modeles/utilisateur.ts +32 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
# CODEV DESIGN
|
|
2
|
-
|
|
3
|
-
## À propos
|
|
4
|
-
|
|
5
|
-
Composants Vuetify 3 pour les projets Codev
|
|
6
|
-
|
|
7
|
-
## Table des matières
|
|
8
|
-
|
|
9
|
-
- 🪧 [À propos](#à-propos)
|
|
10
|
-
- 📦 [Prérequis](#prérequis)
|
|
11
|
-
- 🚀 [Installation](#installation)
|
|
12
|
-
- 🛠️ [Utilisation](#utilisation)
|
|
13
|
-
- 📚 [Documentation](#documentation)
|
|
14
|
-
- 🏷️ [Gestion des versions](#gestion-des-versions)
|
|
15
|
-
- 📝 [Licence](#licence)
|
|
16
|
-
|
|
17
|
-
## Prérequis
|
|
18
|
-
|
|
19
|
-
Vue 3
|
|
20
|
-
Vuetify 3
|
|
21
|
-
Vue-i18n
|
|
22
|
-
Typescript 5
|
|
23
|
-
"@e965/xlsx"
|
|
24
|
-
|
|
25
|
-
## Installation
|
|
26
|
-
|
|
27
|
-
Installez le package via npm en exécutant la commande suivante dans votre projet :
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
npm install codevdesign
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Utilisation
|
|
34
|
-
|
|
35
|
-
Pour utiliser les traductions fournies par Codev Design, vous devez d'abord configurer Vue-i18n. Voici un exemple de configuration :
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
import { createI18n } from 'vue-i18n'
|
|
39
|
-
import { csqcEn, csqcFr } from 'codevdesign' // Importation des traductions du package `codevdesign`
|
|
40
|
-
|
|
41
|
-
const imports = {
|
|
42
|
-
fr: import.meta.glob('@/locales/**/fr.json', {
|
|
43
|
-
eager: true,
|
|
44
|
-
import: 'default',
|
|
45
|
-
}),
|
|
46
|
-
en: import.meta.glob('@/locales/**/en.json', {
|
|
47
|
-
eager: true,
|
|
48
|
-
import: 'default',
|
|
49
|
-
}),
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Les locales disponibles
|
|
53
|
-
const locales = Object.keys(imports)
|
|
54
|
-
|
|
55
|
-
// Fusionner les traductions locales sans écraser les traductions existantes
|
|
56
|
-
const getLocaleMessages = () =>
|
|
57
|
-
locales.reduce(
|
|
58
|
-
(messages, locale) => ({
|
|
59
|
-
...messages,
|
|
60
|
-
[locale]: {
|
|
61
|
-
// Si la langue est 'fr', fusionner les traductions
|
|
62
|
-
...(locale === 'fr'
|
|
63
|
-
? {
|
|
64
|
-
...Object.values(imports[locale]).reduce(
|
|
65
|
-
(acc, current) => ({
|
|
66
|
-
...acc,
|
|
67
|
-
...current,
|
|
68
|
-
}),
|
|
69
|
-
{},
|
|
70
|
-
),
|
|
71
|
-
...csqcFr, // Ajouter les traductions "fr" du package directement
|
|
72
|
-
}
|
|
73
|
-
: {
|
|
74
|
-
...Object.values(imports[locale]).reduce(
|
|
75
|
-
(acc, current) => ({
|
|
76
|
-
...acc,
|
|
77
|
-
...current,
|
|
78
|
-
}),
|
|
79
|
-
{},
|
|
80
|
-
),
|
|
81
|
-
...csqcEn, // Ajouter les traductions "en" du package directement
|
|
82
|
-
}),
|
|
83
|
-
},
|
|
84
|
-
}),
|
|
85
|
-
{},
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
export default createI18n({
|
|
89
|
-
useScope: 'global',
|
|
90
|
-
messages: getLocaleMessages() || [],
|
|
91
|
-
locale: window.langue,
|
|
92
|
-
legacy: false,
|
|
93
|
-
globalInjection: true,
|
|
94
|
-
fallbackLocale: window.langue,
|
|
95
|
-
silentTranslationWarn: true,
|
|
96
|
-
})
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Vous pouvez importer les composants directement depuis le package Codev Design comme suit :
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
import { pivFooter, pivEntete, csqcMenu, csqcAlerteErreur, csqcSnackbar } from 'codevdesign'
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Ces composants sont prêts à être utilisés dans vos pages ou vos composants Vue.js.
|
|
106
|
-
|
|
107
|
-
## Documentation
|
|
108
|
-
|
|
109
|
-
Un bac à sable interactif avec la documentation détaillée des props des composants est disponible pour les membres de la CDPVD. Vous pouvez y accéder ici : https://espacedev.csqc.ca/codevdesign
|
|
110
|
-
|
|
111
|
-
## Gestion des versions
|
|
112
|
-
|
|
113
|
-
Toutes les versions disponibles ainsi que les journaux des changements apportés sont disponibles sur la page npm du package : https://www.npmjs.com/package/codevdesign?activeTab=versions.
|
|
114
|
-
|
|
115
|
-
## Licence
|
|
116
|
-
|
|
117
|
-
Ce package Codev Design est fourni sans licence spécifique. Vous pouvez l'utiliser dans vos projets à votre discrétion, mais il n'y a aucune garantie légale.
|
|
1
|
+
# CODEV DESIGN
|
|
2
|
+
|
|
3
|
+
## À propos
|
|
4
|
+
|
|
5
|
+
Composants Vuetify 3 pour les projets Codev
|
|
6
|
+
|
|
7
|
+
## Table des matières
|
|
8
|
+
|
|
9
|
+
- 🪧 [À propos](#à-propos)
|
|
10
|
+
- 📦 [Prérequis](#prérequis)
|
|
11
|
+
- 🚀 [Installation](#installation)
|
|
12
|
+
- 🛠️ [Utilisation](#utilisation)
|
|
13
|
+
- 📚 [Documentation](#documentation)
|
|
14
|
+
- 🏷️ [Gestion des versions](#gestion-des-versions)
|
|
15
|
+
- 📝 [Licence](#licence)
|
|
16
|
+
|
|
17
|
+
## Prérequis
|
|
18
|
+
|
|
19
|
+
Vue 3
|
|
20
|
+
Vuetify 3
|
|
21
|
+
Vue-i18n
|
|
22
|
+
Typescript 5
|
|
23
|
+
"@e965/xlsx"
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
Installez le package via npm en exécutant la commande suivante dans votre projet :
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
npm install codevdesign
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Utilisation
|
|
34
|
+
|
|
35
|
+
Pour utiliser les traductions fournies par Codev Design, vous devez d'abord configurer Vue-i18n. Voici un exemple de configuration :
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
import { createI18n } from 'vue-i18n'
|
|
39
|
+
import { csqcEn, csqcFr } from 'codevdesign' // Importation des traductions du package `codevdesign`
|
|
40
|
+
|
|
41
|
+
const imports = {
|
|
42
|
+
fr: import.meta.glob('@/locales/**/fr.json', {
|
|
43
|
+
eager: true,
|
|
44
|
+
import: 'default',
|
|
45
|
+
}),
|
|
46
|
+
en: import.meta.glob('@/locales/**/en.json', {
|
|
47
|
+
eager: true,
|
|
48
|
+
import: 'default',
|
|
49
|
+
}),
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Les locales disponibles
|
|
53
|
+
const locales = Object.keys(imports)
|
|
54
|
+
|
|
55
|
+
// Fusionner les traductions locales sans écraser les traductions existantes
|
|
56
|
+
const getLocaleMessages = () =>
|
|
57
|
+
locales.reduce(
|
|
58
|
+
(messages, locale) => ({
|
|
59
|
+
...messages,
|
|
60
|
+
[locale]: {
|
|
61
|
+
// Si la langue est 'fr', fusionner les traductions
|
|
62
|
+
...(locale === 'fr'
|
|
63
|
+
? {
|
|
64
|
+
...Object.values(imports[locale]).reduce(
|
|
65
|
+
(acc, current) => ({
|
|
66
|
+
...acc,
|
|
67
|
+
...current,
|
|
68
|
+
}),
|
|
69
|
+
{},
|
|
70
|
+
),
|
|
71
|
+
...csqcFr, // Ajouter les traductions "fr" du package directement
|
|
72
|
+
}
|
|
73
|
+
: {
|
|
74
|
+
...Object.values(imports[locale]).reduce(
|
|
75
|
+
(acc, current) => ({
|
|
76
|
+
...acc,
|
|
77
|
+
...current,
|
|
78
|
+
}),
|
|
79
|
+
{},
|
|
80
|
+
),
|
|
81
|
+
...csqcEn, // Ajouter les traductions "en" du package directement
|
|
82
|
+
}),
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
{},
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
export default createI18n({
|
|
89
|
+
useScope: 'global',
|
|
90
|
+
messages: getLocaleMessages() || [],
|
|
91
|
+
locale: window.langue,
|
|
92
|
+
legacy: false,
|
|
93
|
+
globalInjection: true,
|
|
94
|
+
fallbackLocale: window.langue,
|
|
95
|
+
silentTranslationWarn: true,
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Vous pouvez importer les composants directement depuis le package Codev Design comme suit :
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
import { pivFooter, pivEntete, csqcMenu, csqcAlerteErreur, csqcSnackbar } from 'codevdesign'
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Ces composants sont prêts à être utilisés dans vos pages ou vos composants Vue.js.
|
|
106
|
+
|
|
107
|
+
## Documentation
|
|
108
|
+
|
|
109
|
+
Un bac à sable interactif avec la documentation détaillée des props des composants est disponible pour les membres de la CDPVD. Vous pouvez y accéder ici : https://espacedev.csqc.ca/codevdesign
|
|
110
|
+
|
|
111
|
+
## Gestion des versions
|
|
112
|
+
|
|
113
|
+
Toutes les versions disponibles ainsi que les journaux des changements apportés sont disponibles sur la page npm du package : https://www.npmjs.com/package/codevdesign?activeTab=versions.
|
|
114
|
+
|
|
115
|
+
## Licence
|
|
116
|
+
|
|
117
|
+
Ce package Codev Design est fourni sans licence spécifique. Vous pouvez l'utiliser dans vos projets à votre discrétion, mais il n'y a aucune garantie légale.
|
package/composants/csqcAide.vue
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-menu
|
|
3
|
-
:open-on-hover="hover"
|
|
4
3
|
v-if="!isXs"
|
|
4
|
+
:open-on-hover="hover"
|
|
5
5
|
location="top start"
|
|
6
6
|
>
|
|
7
7
|
<template #activator="{ props: activatorProps }">
|
|
8
8
|
<slot name="icone">
|
|
9
9
|
<v-icon
|
|
10
10
|
v-bind="activatorProps"
|
|
11
|
-
@click.stop.prevent
|
|
12
11
|
:style="styleCSS"
|
|
13
12
|
:size="grosseurEffective"
|
|
14
13
|
color="grisMoyen"
|
|
15
14
|
icon="mdi-help-circle"
|
|
15
|
+
@click.stop.prevent
|
|
16
16
|
/>
|
|
17
17
|
</slot>
|
|
18
18
|
</template>
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-if="afficher && erreur"
|
|
4
|
-
:style="retournerStyle"
|
|
5
|
-
>
|
|
6
|
-
<v-alert
|
|
7
|
-
v-model="afficher"
|
|
8
|
-
class="mb-0 text-center hyphen_auto"
|
|
9
|
-
color="#CB381F"
|
|
10
|
-
closable
|
|
11
|
-
@click:close="fermer"
|
|
12
|
-
>
|
|
13
|
-
<span v-html="erreur" /><br />
|
|
14
|
-
<span
|
|
15
|
-
id="messageSoutien"
|
|
16
|
-
style="color: darkgray"
|
|
17
|
-
>{{ messageSoutien }}</span
|
|
18
|
-
>
|
|
19
|
-
</v-alert>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script lang="ts" setup>
|
|
24
|
-
import { computed, ref, watch } from 'vue'
|
|
25
|
-
import { useDisplay } from 'vuetify'
|
|
26
|
-
import { useI18n } from 'vue-i18n'
|
|
27
|
-
|
|
28
|
-
// Définir les props avec les types
|
|
29
|
-
const props = defineProps({
|
|
30
|
-
message: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: true,
|
|
33
|
-
},
|
|
34
|
-
messageSoutien: {
|
|
35
|
-
type: String,
|
|
36
|
-
required: true,
|
|
37
|
-
},
|
|
38
|
-
})
|
|
39
|
-
const { name: displayName } = useDisplay()
|
|
40
|
-
const emit = defineEmits(['fermer:alerte'])
|
|
41
|
-
const { t } = useI18n({ useScope: 'global' })
|
|
42
|
-
|
|
43
|
-
const fermer = (): void => {
|
|
44
|
-
afficher.value = false
|
|
45
|
-
emit('fermer:alerte')
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const afficher = ref(false)
|
|
49
|
-
|
|
50
|
-
// Watcher pour réagir aux changements du message
|
|
51
|
-
watch(
|
|
52
|
-
() => props.message,
|
|
53
|
-
nouveauMessage => {
|
|
54
|
-
if (nouveauMessage && nouveauMessage !== '') {
|
|
55
|
-
afficher.value = true
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
// Computed pour l'erreur, venant du store
|
|
61
|
-
const erreur = computed(() => {
|
|
62
|
-
if (props.message == null || props.message == '') return null
|
|
63
|
-
|
|
64
|
-
if (props.message.indexOf('erreurs.') === 0) return t(props.message)
|
|
65
|
-
|
|
66
|
-
return props.message
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
// Méthode computed pour le style en fonction du breakpoint
|
|
70
|
-
const retournerStyle = computed(() => {
|
|
71
|
-
if (displayName.value === 'xs') {
|
|
72
|
-
return 'top: 0px; right:1%;width: 98%;position: fixed; z-index: 2000;'
|
|
73
|
-
}
|
|
74
|
-
return 'top: 20px; right: 10%; width: 80%; position: fixed; z-index: 2000; margin: 0 auto;'
|
|
75
|
-
})
|
|
76
|
-
</script>
|
|
77
|
-
|
|
78
|
-
<style lang="css" scoped>
|
|
79
|
-
.error {
|
|
80
|
-
padding-top: 0.7rem;
|
|
81
|
-
padding-bottom: 0.7rem;
|
|
82
|
-
}
|
|
83
|
-
:deep(.blanc) {
|
|
84
|
-
color: white;
|
|
85
|
-
}
|
|
86
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="afficher && erreur"
|
|
4
|
+
:style="retournerStyle"
|
|
5
|
+
>
|
|
6
|
+
<v-alert
|
|
7
|
+
v-model="afficher"
|
|
8
|
+
class="mb-0 text-center hyphen_auto"
|
|
9
|
+
color="#CB381F"
|
|
10
|
+
closable
|
|
11
|
+
@click:close="fermer"
|
|
12
|
+
>
|
|
13
|
+
<span v-html="erreur" /><br />
|
|
14
|
+
<span
|
|
15
|
+
id="messageSoutien"
|
|
16
|
+
style="color: darkgray"
|
|
17
|
+
>{{ messageSoutien }}</span
|
|
18
|
+
>
|
|
19
|
+
</v-alert>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts" setup>
|
|
24
|
+
import { computed, ref, watch } from 'vue'
|
|
25
|
+
import { useDisplay } from 'vuetify'
|
|
26
|
+
import { useI18n } from 'vue-i18n'
|
|
27
|
+
|
|
28
|
+
// Définir les props avec les types
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
message: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
messageSoutien: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
const { name: displayName } = useDisplay()
|
|
40
|
+
const emit = defineEmits(['fermer:alerte'])
|
|
41
|
+
const { t } = useI18n({ useScope: 'global' })
|
|
42
|
+
|
|
43
|
+
const fermer = (): void => {
|
|
44
|
+
afficher.value = false
|
|
45
|
+
emit('fermer:alerte')
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const afficher = ref(false)
|
|
49
|
+
|
|
50
|
+
// Watcher pour réagir aux changements du message
|
|
51
|
+
watch(
|
|
52
|
+
() => props.message,
|
|
53
|
+
nouveauMessage => {
|
|
54
|
+
if (nouveauMessage && nouveauMessage !== '') {
|
|
55
|
+
afficher.value = true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
// Computed pour l'erreur, venant du store
|
|
61
|
+
const erreur = computed(() => {
|
|
62
|
+
if (props.message == null || props.message == '') return null
|
|
63
|
+
|
|
64
|
+
if (props.message.indexOf('erreurs.') === 0) return t(props.message)
|
|
65
|
+
|
|
66
|
+
return props.message
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
// Méthode computed pour le style en fonction du breakpoint
|
|
70
|
+
const retournerStyle = computed(() => {
|
|
71
|
+
if (displayName.value === 'xs') {
|
|
72
|
+
return 'top: 0px; right:1%;width: 98%;position: fixed; z-index: 2000;'
|
|
73
|
+
}
|
|
74
|
+
return 'top: 20px; right: 10%; width: 80%; position: fixed; z-index: 2000; margin: 0 auto;'
|
|
75
|
+
})
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<style lang="css" scoped>
|
|
79
|
+
.error {
|
|
80
|
+
padding-top: 0.7rem;
|
|
81
|
+
padding-bottom: 0.7rem;
|
|
82
|
+
}
|
|
83
|
+
:deep(.blanc) {
|
|
84
|
+
color: white;
|
|
85
|
+
}
|
|
86
|
+
</style>
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<v-list-item-content>
|
|
4
|
-
<v-list-item-title>{{ nomUnite }}</v-list-item-title>
|
|
5
|
-
<v-list-item-subtitle v-if="getPreference != ''">
|
|
6
|
-
{{ getPreference }}
|
|
7
|
-
</v-list-item-subtitle>
|
|
8
|
-
<v-list-item-subtitle
|
|
9
|
-
v-if="getPreference == ''"
|
|
10
|
-
class="messageErreurChaiseItem"
|
|
11
|
-
>
|
|
12
|
-
{{ $t('csqc.message.chaiseSelection') }}
|
|
13
|
-
</v-list-item-subtitle>
|
|
14
|
-
</v-list-item-content>
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
<script lang="ts" setup>
|
|
18
|
-
import { computed } from 'vue'
|
|
19
|
-
|
|
20
|
-
// Définition des props
|
|
21
|
-
const props = defineProps<{
|
|
22
|
-
uniteId: number
|
|
23
|
-
preferences: Array<{ chaiseId: number }>
|
|
24
|
-
dictChaisesReleve: Record<number, Array<{ id: number; nom: string }>>
|
|
25
|
-
unites: Array<{ id: number; nom: string }>
|
|
26
|
-
}>()
|
|
27
|
-
|
|
28
|
-
const nomUnite = computed(() => {
|
|
29
|
-
if (!props.uniteId || !props.unites?.length) {
|
|
30
|
-
return ''
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const unite = props.unites.find(u => u.id == props.uniteId)
|
|
34
|
-
return unite?.nom || ''
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
const getPreference = computed(() => {
|
|
38
|
-
for (let i = 0; i < props.dictChaisesReleve[props.uniteId]?.length; i += 1) {
|
|
39
|
-
if (props.preferences.some(p => p.chaiseId == props.dictChaisesReleve[props.uniteId][i].id)) {
|
|
40
|
-
return props.dictChaisesReleve[props.uniteId][i].nom
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return ''
|
|
45
|
-
})
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
<style scoped>
|
|
49
|
-
.messageErreurChaiseItem {
|
|
50
|
-
color: red !important;
|
|
51
|
-
font-style: italic;
|
|
52
|
-
}
|
|
53
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<v-list-item-content>
|
|
4
|
+
<v-list-item-title>{{ nomUnite }}</v-list-item-title>
|
|
5
|
+
<v-list-item-subtitle v-if="getPreference != ''">
|
|
6
|
+
{{ getPreference }}
|
|
7
|
+
</v-list-item-subtitle>
|
|
8
|
+
<v-list-item-subtitle
|
|
9
|
+
v-if="getPreference == ''"
|
|
10
|
+
class="messageErreurChaiseItem"
|
|
11
|
+
>
|
|
12
|
+
{{ $t('csqc.message.chaiseSelection') }}
|
|
13
|
+
</v-list-item-subtitle>
|
|
14
|
+
</v-list-item-content>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { computed } from 'vue'
|
|
19
|
+
|
|
20
|
+
// Définition des props
|
|
21
|
+
const props = defineProps<{
|
|
22
|
+
uniteId: number
|
|
23
|
+
preferences: Array<{ chaiseId: number }>
|
|
24
|
+
dictChaisesReleve: Record<number, Array<{ id: number; nom: string }>>
|
|
25
|
+
unites: Array<{ id: number; nom: string }>
|
|
26
|
+
}>()
|
|
27
|
+
|
|
28
|
+
const nomUnite = computed(() => {
|
|
29
|
+
if (!props.uniteId || !props.unites?.length) {
|
|
30
|
+
return ''
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const unite = props.unites.find(u => u.id == props.uniteId)
|
|
34
|
+
return unite?.nom || ''
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const getPreference = computed(() => {
|
|
38
|
+
for (let i = 0; i < props.dictChaisesReleve[props.uniteId]?.length; i += 1) {
|
|
39
|
+
if (props.preferences.some(p => p.chaiseId == props.dictChaisesReleve[props.uniteId][i].id)) {
|
|
40
|
+
return props.dictChaisesReleve[props.uniteId][i].nom
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return ''
|
|
45
|
+
})
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<style scoped>
|
|
49
|
+
.messageErreurChaiseItem {
|
|
50
|
+
color: red !important;
|
|
51
|
+
font-style: italic;
|
|
52
|
+
}
|
|
53
|
+
</style>
|