codevdesign 0.0.12 → 0.0.14
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/csqcAlerteErreur.vue +86 -86
- package/composants/csqcChaise/chaiseConteneur.vue +330 -330
- package/composants/csqcChaise/chaiseItem.vue +53 -53
- package/composants/csqcConfirmation.vue +74 -74
- package/composants/csqcDialogue.vue +118 -118
- package/composants/csqcOptionSwitch.vue +113 -113
- package/composants/csqcRecherche.vue +158 -158
- package/composants/csqcSnackbar.vue +99 -99
- package/composants/csqcTable/csqcTable.vue +342 -348
- package/composants/csqcTable/csqcTableExportExcel.vue +58 -58
- package/composants/csqcTiroir.vue +150 -150
- package/composants/gabarit/csqcMenu.vue +241 -241
- package/composants/gabarit/pivEntete.vue +111 -111
- package/index.ts +42 -40
- package/modeles/composants/datatableColonne.ts +14 -0
- package/modeles/composants/snackbar.ts +18 -18
- package/modeles/intervention.ts +38 -38
- package/modeles/unite.ts +42 -42
- package/modeles/utilisateur.ts +33 -33
- package/package.json +1 -1
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-icon
|
|
3
|
-
right
|
|
4
|
-
color="grisMoyen"
|
|
5
|
-
@click="exportToXLSX"
|
|
6
|
-
icon="mdi-microsoft-excel"
|
|
7
|
-
>
|
|
8
|
-
</v-icon>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import { utils, writeFileXLSX } from '@e965/xlsx'
|
|
13
|
-
import { defineProps, computed } from 'vue'
|
|
14
|
-
|
|
15
|
-
const props = defineProps<{
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
-
liste: any[]
|
|
18
|
-
nomFichier: string
|
|
19
|
-
chargementListe: boolean
|
|
20
|
-
}>()
|
|
21
|
-
|
|
22
|
-
// Extraction des clés uniques de tous les objets
|
|
23
|
-
const cleDynamique = computed(() => {
|
|
24
|
-
const keys = new Set<string>()
|
|
25
|
-
|
|
26
|
-
// Parcours tous les objets de la liste et ajoute leurs clés
|
|
27
|
-
props.liste.forEach(item => {
|
|
28
|
-
if (typeof item === 'object' && item !== null) {
|
|
29
|
-
Object.keys(item).forEach(key => keys.add(key))
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
return Array.from(keys)
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
// Fonction pour exporter les données en Excel
|
|
36
|
-
const exportToXLSX = () => {
|
|
37
|
-
if (!props.liste.length) {
|
|
38
|
-
console.warn('La liste est vide, exportation annulée.')
|
|
39
|
-
return
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Récupération des en-têtes depuis la fonction cleDynamique
|
|
43
|
-
const headers = cleDynamique.value
|
|
44
|
-
|
|
45
|
-
// Construction des lignes en respectant l'ordre des en-têtes
|
|
46
|
-
const rows = props.liste.map(item => {
|
|
47
|
-
return headers.map(key => (key in item ? item[key] : '')) // Valeur ou vide si absente
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
// Création des données Excel (en-têtes + lignes)
|
|
51
|
-
const data = [headers, ...rows]
|
|
52
|
-
// Génération du fichier Excel
|
|
53
|
-
const ws = utils.aoa_to_sheet(data)
|
|
54
|
-
const wb = utils.book_new()
|
|
55
|
-
utils.book_append_sheet(wb, ws, '1')
|
|
56
|
-
writeFileXLSX(wb, `${props.nomFichier}.xlsx`)
|
|
57
|
-
}
|
|
58
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<v-icon
|
|
3
|
+
right
|
|
4
|
+
color="grisMoyen"
|
|
5
|
+
@click="exportToXLSX"
|
|
6
|
+
icon="mdi-microsoft-excel"
|
|
7
|
+
>
|
|
8
|
+
</v-icon>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import { utils, writeFileXLSX } from '@e965/xlsx'
|
|
13
|
+
import { defineProps, computed } from 'vue'
|
|
14
|
+
|
|
15
|
+
const props = defineProps<{
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
liste: any[]
|
|
18
|
+
nomFichier: string
|
|
19
|
+
chargementListe: boolean
|
|
20
|
+
}>()
|
|
21
|
+
|
|
22
|
+
// Extraction des clés uniques de tous les objets
|
|
23
|
+
const cleDynamique = computed(() => {
|
|
24
|
+
const keys = new Set<string>()
|
|
25
|
+
|
|
26
|
+
// Parcours tous les objets de la liste et ajoute leurs clés
|
|
27
|
+
props.liste.forEach(item => {
|
|
28
|
+
if (typeof item === 'object' && item !== null) {
|
|
29
|
+
Object.keys(item).forEach(key => keys.add(key))
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
return Array.from(keys)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
// Fonction pour exporter les données en Excel
|
|
36
|
+
const exportToXLSX = () => {
|
|
37
|
+
if (!props.liste.length) {
|
|
38
|
+
console.warn('La liste est vide, exportation annulée.')
|
|
39
|
+
return
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Récupération des en-têtes depuis la fonction cleDynamique
|
|
43
|
+
const headers = cleDynamique.value
|
|
44
|
+
|
|
45
|
+
// Construction des lignes en respectant l'ordre des en-têtes
|
|
46
|
+
const rows = props.liste.map(item => {
|
|
47
|
+
return headers.map(key => (key in item ? item[key] : '')) // Valeur ou vide si absente
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
// Création des données Excel (en-têtes + lignes)
|
|
51
|
+
const data = [headers, ...rows]
|
|
52
|
+
// Génération du fichier Excel
|
|
53
|
+
const ws = utils.aoa_to_sheet(data)
|
|
54
|
+
const wb = utils.book_new()
|
|
55
|
+
utils.book_append_sheet(wb, ws, '1')
|
|
56
|
+
writeFileXLSX(wb, `${props.nomFichier}.xlsx`)
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-navigation-drawer
|
|
3
|
-
v-model="visible"
|
|
4
|
-
location="right"
|
|
5
|
-
temporary
|
|
6
|
-
class="pa-0 elevation-2"
|
|
7
|
-
:width="grosseurTiroir"
|
|
8
|
-
:persistent="persistant"
|
|
9
|
-
@keydown.esc="!persistant ? fermeture : ''"
|
|
10
|
-
@click:outside="!persistant ? fermeture : ''"
|
|
11
|
-
>
|
|
12
|
-
<v-card class="pa-0 ma-0 pl-8 pt-8">
|
|
13
|
-
<!-- Bouton en haut à droite -->
|
|
14
|
-
<v-btn
|
|
15
|
-
icon="mdi-close"
|
|
16
|
-
variant="text"
|
|
17
|
-
class="position-absolute couleurHover"
|
|
18
|
-
style="top: 5px; right: 5px"
|
|
19
|
-
@click="fermeture"
|
|
20
|
-
></v-btn>
|
|
21
|
-
|
|
22
|
-
<v-card-title
|
|
23
|
-
class="pa-0 ma-0 pb-6 text-wrap"
|
|
24
|
-
style="font-size: 24px"
|
|
25
|
-
>
|
|
26
|
-
<slot name="titre"></slot>
|
|
27
|
-
<div class="headline">{{ titre }}</div>
|
|
28
|
-
</v-card-title>
|
|
29
|
-
|
|
30
|
-
<v-card-text class="pa-0 ma-0 pb-6 pr-6">
|
|
31
|
-
<v-container>
|
|
32
|
-
<slot></slot>
|
|
33
|
-
<slot name="content"></slot>
|
|
34
|
-
</v-container>
|
|
35
|
-
</v-card-text>
|
|
36
|
-
<v-card-actions class="my-2 d-flex justify-end pr-6 pb-5">
|
|
37
|
-
<slot name="actions"></slot>
|
|
38
|
-
<v-btn
|
|
39
|
-
v-if="btnAnnuler"
|
|
40
|
-
color="primary"
|
|
41
|
-
variant="text"
|
|
42
|
-
:loading="operationEnCours"
|
|
43
|
-
@click="fermeture"
|
|
44
|
-
>
|
|
45
|
-
{{ props.btnAnnulerTexte ? props.btnAnnulerTexte : $t('csqc.bouton.annuler') }}
|
|
46
|
-
</v-btn>
|
|
47
|
-
|
|
48
|
-
<v-btn
|
|
49
|
-
v-if="btnOk"
|
|
50
|
-
class="Gouttiere"
|
|
51
|
-
color="primary"
|
|
52
|
-
variant="flat"
|
|
53
|
-
:loading="operationEnCours"
|
|
54
|
-
:disabled="btnOkDesactiver || operationEnCours"
|
|
55
|
-
@click="okBouton"
|
|
56
|
-
outlined
|
|
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>
|
|
1
|
+
<template>
|
|
2
|
+
<v-navigation-drawer
|
|
3
|
+
v-model="visible"
|
|
4
|
+
location="right"
|
|
5
|
+
temporary
|
|
6
|
+
class="pa-0 elevation-2"
|
|
7
|
+
:width="grosseurTiroir"
|
|
8
|
+
:persistent="persistant"
|
|
9
|
+
@keydown.esc="!persistant ? fermeture : ''"
|
|
10
|
+
@click:outside="!persistant ? fermeture : ''"
|
|
11
|
+
>
|
|
12
|
+
<v-card class="pa-0 ma-0 pl-8 pt-8">
|
|
13
|
+
<!-- Bouton en haut à droite -->
|
|
14
|
+
<v-btn
|
|
15
|
+
icon="mdi-close"
|
|
16
|
+
variant="text"
|
|
17
|
+
class="position-absolute couleurHover"
|
|
18
|
+
style="top: 5px; right: 5px"
|
|
19
|
+
@click="fermeture"
|
|
20
|
+
></v-btn>
|
|
21
|
+
|
|
22
|
+
<v-card-title
|
|
23
|
+
class="pa-0 ma-0 pb-6 text-wrap"
|
|
24
|
+
style="font-size: 24px"
|
|
25
|
+
>
|
|
26
|
+
<slot name="titre"></slot>
|
|
27
|
+
<div class="headline">{{ titre }}</div>
|
|
28
|
+
</v-card-title>
|
|
29
|
+
|
|
30
|
+
<v-card-text class="pa-0 ma-0 pb-6 pr-6">
|
|
31
|
+
<v-container>
|
|
32
|
+
<slot></slot>
|
|
33
|
+
<slot name="content"></slot>
|
|
34
|
+
</v-container>
|
|
35
|
+
</v-card-text>
|
|
36
|
+
<v-card-actions class="my-2 d-flex justify-end pr-6 pb-5">
|
|
37
|
+
<slot name="actions"></slot>
|
|
38
|
+
<v-btn
|
|
39
|
+
v-if="btnAnnuler"
|
|
40
|
+
color="primary"
|
|
41
|
+
variant="text"
|
|
42
|
+
:loading="operationEnCours"
|
|
43
|
+
@click="fermeture"
|
|
44
|
+
>
|
|
45
|
+
{{ props.btnAnnulerTexte ? props.btnAnnulerTexte : $t('csqc.bouton.annuler') }}
|
|
46
|
+
</v-btn>
|
|
47
|
+
|
|
48
|
+
<v-btn
|
|
49
|
+
v-if="btnOk"
|
|
50
|
+
class="Gouttiere"
|
|
51
|
+
color="primary"
|
|
52
|
+
variant="flat"
|
|
53
|
+
:loading="operationEnCours"
|
|
54
|
+
:disabled="btnOkDesactiver || operationEnCours"
|
|
55
|
+
@click="okBouton"
|
|
56
|
+
outlined
|
|
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>
|