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,336 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<v-form
|
|
4
|
-
ref="form"
|
|
5
|
-
v-model="formValide"
|
|
6
|
-
@submit.prevent
|
|
7
|
-
>
|
|
8
|
-
<v-combobox
|
|
9
|
-
v-model="codeBudgetaire"
|
|
10
|
-
:items="itemsCombobox"
|
|
11
|
-
item-value="code"
|
|
12
|
-
item-title="code"
|
|
13
|
-
:return-object="false"
|
|
14
|
-
v-bind="$attrs"
|
|
15
|
-
persistent-hint
|
|
16
|
-
variant="outlined"
|
|
17
|
-
hide-details="auto"
|
|
18
|
-
:error="!estValideComplet"
|
|
19
|
-
:rules="reglesVuetify"
|
|
20
|
-
:hint="afficherHint ? placeholder : ''"
|
|
21
|
-
@blur="sauvegarder"
|
|
22
|
-
@keydown.enter="sauvegarder"
|
|
23
|
-
@keydown="caractereAutorises"
|
|
24
|
-
@update:modelValue="gererChangement"
|
|
25
|
-
@paste="gererPaste"
|
|
26
|
-
>
|
|
27
|
-
<template #item="{ props, item }">
|
|
28
|
-
<v-list-item
|
|
29
|
-
v-bind="props"
|
|
30
|
-
:title="item.raw.nom || item.raw.code"
|
|
31
|
-
:subtitle="item.raw.nom ? item.raw.code : undefined"
|
|
32
|
-
/>
|
|
33
|
-
</template>
|
|
34
|
-
</v-combobox>
|
|
35
|
-
</v-form>
|
|
36
|
-
</div>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<script setup lang="ts">
|
|
40
|
-
import { ref, computed, onMounted, nextTick, watch } from 'vue'
|
|
41
|
-
import type { VForm } from 'vuetify/components'
|
|
42
|
-
|
|
43
|
-
const emit = defineEmits<{
|
|
44
|
-
'update:modelValue': [string | null]
|
|
45
|
-
'update:codeBudgetairesProp': [CodeBudgetaireItem[]]
|
|
46
|
-
'update:valide': [boolean]
|
|
47
|
-
}>()
|
|
48
|
-
type CodeBudgetaireItem = string | [string, string]
|
|
49
|
-
|
|
50
|
-
const props = withDefaults(
|
|
51
|
-
defineProps<{
|
|
52
|
-
codeBudgetairesProp: CodeBudgetaireItem[]
|
|
53
|
-
modelValue: string | null
|
|
54
|
-
afficherHint?: boolean
|
|
55
|
-
regleMessageErreur: string
|
|
56
|
-
format?: string
|
|
57
|
-
activerExtension?: boolean
|
|
58
|
-
reglesSupp?: ((v: string) => true | string)[]
|
|
59
|
-
}>(),
|
|
60
|
-
{
|
|
61
|
-
afficherHint: false,
|
|
62
|
-
format: '999-9-99999-999',
|
|
63
|
-
activerExtension: false,
|
|
64
|
-
reglesSupp: () => [],
|
|
65
|
-
},
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
const formValide = ref(false)
|
|
69
|
-
const form = ref<VForm | null>(null)
|
|
70
|
-
const codeBudgetaire = ref(props.modelValue ?? '')
|
|
71
|
-
const derniereValeurSauvegardee = ref<string | null>(null)
|
|
72
|
-
const format = props.format
|
|
73
|
-
const activerExtension = props.activerExtension
|
|
74
|
-
|
|
75
|
-
onMounted(() => {
|
|
76
|
-
derniereValeurSauvegardee.value = codeBudgetaire.value
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
const itemsCombobox = computed(() => {
|
|
80
|
-
return props.codeBudgetairesProp.map(item => {
|
|
81
|
-
if (typeof item === 'string') {
|
|
82
|
-
return {
|
|
83
|
-
code: item,
|
|
84
|
-
nom: '', // pas de nom
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const [code, nomBrut] = item
|
|
89
|
-
const nom = (nomBrut ?? '').toString().trim()
|
|
90
|
-
|
|
91
|
-
return { code, nom }
|
|
92
|
-
})
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
const placeholder = computed(() => {
|
|
96
|
-
const base = format.replace(/9/g, '0')
|
|
97
|
-
const extension = activerExtension ? '-XXX/XXX' : ''
|
|
98
|
-
return base + extension
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
const estValide = computed(() => {
|
|
102
|
-
const val = codeBudgetaire.value?.toUpperCase().trim() || ''
|
|
103
|
-
const base = val.slice(0, 15)
|
|
104
|
-
const extension = val.slice(15)
|
|
105
|
-
|
|
106
|
-
if (!/^\d{3}-\d{1}-\d{5}-\d{3}$/.test(base)) return false
|
|
107
|
-
|
|
108
|
-
if (!activerExtension) return val.length === 15
|
|
109
|
-
|
|
110
|
-
if (val.length === 15) return true
|
|
111
|
-
if (val.length !== 22) return false
|
|
112
|
-
if (extension.length !== 7) return false
|
|
113
|
-
|
|
114
|
-
if (extension[3] !== '/') return false
|
|
115
|
-
if (!/^[A-Z0-9/]$/i.test(extension[0]!)) return false
|
|
116
|
-
|
|
117
|
-
const alphanumAt = [1, 2, 4, 5, 6]
|
|
118
|
-
return alphanumAt.every(i => /^[A-Z0-9]$/i.test(extension[i]!))
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
// Règles Vuetify combinées (interne + supplémentaires)
|
|
122
|
-
const reglesVuetify = computed(() => [
|
|
123
|
-
// règle interne
|
|
124
|
-
() => (estValide.value ? true : props.regleMessageErreur),
|
|
125
|
-
|
|
126
|
-
// règles supplémentaires venant du parent
|
|
127
|
-
...props.reglesSupp.map(rule => {
|
|
128
|
-
return () => rule(codeBudgetaire.value) // on passe la valeur formatée
|
|
129
|
-
}),
|
|
130
|
-
])
|
|
131
|
-
|
|
132
|
-
// Validité globale du composant (interne + toutes les règles supp)
|
|
133
|
-
const estValideComplet = computed(() => {
|
|
134
|
-
if (!estValide.value) return false
|
|
135
|
-
return props.reglesSupp.every(rule => rule(codeBudgetaire.value) === true)
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
const caractereAutorises = (e: KeyboardEvent) => {
|
|
139
|
-
if (e.ctrlKey || e.metaKey) return
|
|
140
|
-
|
|
141
|
-
const touchesSpecifiques = ['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab', 'Home', 'End']
|
|
142
|
-
if (touchesSpecifiques.includes(e.key)) return
|
|
143
|
-
|
|
144
|
-
const input = e.target as HTMLInputElement
|
|
145
|
-
let position = input.selectionStart ?? 0
|
|
146
|
-
|
|
147
|
-
// Gestion de la partie de base (15 premiers caractères)
|
|
148
|
-
if (position < 15) {
|
|
149
|
-
if (!/^\d$/.test(e.key)) {
|
|
150
|
-
e.preventDefault()
|
|
151
|
-
return
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// Insérer chiffre et auto-ajout des tirets
|
|
155
|
-
e.preventDefault()
|
|
156
|
-
|
|
157
|
-
const value = codeBudgetaire.value.replace(/-/g, '')
|
|
158
|
-
const clean = value.slice(0, 12) + e.key
|
|
159
|
-
|
|
160
|
-
let formatted = ''
|
|
161
|
-
if (clean.length > 0) formatted += clean.slice(0, 3)
|
|
162
|
-
if (clean.length > 3) formatted += '-' + clean.slice(3, 4)
|
|
163
|
-
if (clean.length > 4) formatted += '-' + clean.slice(4, 9)
|
|
164
|
-
if (clean.length > 9) formatted += '-' + clean.slice(9, 12)
|
|
165
|
-
|
|
166
|
-
codeBudgetaire.value = formatted.slice(0, 15)
|
|
167
|
-
|
|
168
|
-
nextTick(() => {
|
|
169
|
-
const newPos = codeBudgetaire.value.length
|
|
170
|
-
input.selectionStart = input.selectionEnd = newPos
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
return
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// --- Gestion de l'extension ---
|
|
177
|
-
if (!activerExtension || position >= 22 || codeBudgetaire.value.length >= 22) {
|
|
178
|
-
e.preventDefault()
|
|
179
|
-
return
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const extensionPos = position - 15
|
|
183
|
-
|
|
184
|
-
// Règle 1 : extension[0] = alphanum ou /
|
|
185
|
-
if (extensionPos === 0) {
|
|
186
|
-
if (!/^[A-Z0-9/]$/i.test(e.key)) {
|
|
187
|
-
e.preventDefault()
|
|
188
|
-
return
|
|
189
|
-
}
|
|
190
|
-
return
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// Règle 2 : extension[1,2,4,5,6] = alphanum
|
|
194
|
-
if ([1, 2, 4, 5, 6].includes(extensionPos)) {
|
|
195
|
-
if (!/^[A-Z0-9]$/i.test(e.key)) {
|
|
196
|
-
e.preventDefault()
|
|
197
|
-
return
|
|
198
|
-
}
|
|
199
|
-
return
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// Règle 3 : slash automatique à position 3 (index 18)
|
|
203
|
-
if (extensionPos === 3) {
|
|
204
|
-
e.preventDefault()
|
|
205
|
-
const before = codeBudgetaire.value.slice(0, position)
|
|
206
|
-
const after = codeBudgetaire.value.slice(position)
|
|
207
|
-
codeBudgetaire.value = before + '/' + after
|
|
208
|
-
nextTick(() => {
|
|
209
|
-
input.selectionStart = input.selectionEnd = position + 1
|
|
210
|
-
})
|
|
211
|
-
return
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// Tout autre cas = bloqué
|
|
215
|
-
e.preventDefault()
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
const formaterCodeBudgetaire = (valeur: string): string => {
|
|
219
|
-
if (!valeur) return ''
|
|
220
|
-
|
|
221
|
-
const upper = valeur.toUpperCase().replace(/[^A-Z0-9/]/g, '')
|
|
222
|
-
const chiffres = upper.replace(/[^0-9]/g, '').slice(0, 12)
|
|
223
|
-
|
|
224
|
-
let base = ''
|
|
225
|
-
if (chiffres.length > 0) base += chiffres.slice(0, 3)
|
|
226
|
-
if (chiffres.length > 3) base += '-' + chiffres.slice(3, 4)
|
|
227
|
-
if (chiffres.length > 4) base += '-' + chiffres.slice(4, 9)
|
|
228
|
-
if (chiffres.length > 9) base += '-' + chiffres.slice(9, 12)
|
|
229
|
-
|
|
230
|
-
if (!activerExtension || base.length < 15) return base
|
|
231
|
-
|
|
232
|
-
const reste = upper.slice(chiffres.length).replace(/[^A-Z0-9/]/gi, '')
|
|
233
|
-
|
|
234
|
-
// Extraire les 7 premiers caractères restants pour l’extension
|
|
235
|
-
let ext = reste.slice(0, 7).split('')
|
|
236
|
-
|
|
237
|
-
// Ne garder que le premier slash s’il est à l’index 0 ou 3
|
|
238
|
-
ext = ext.filter((c, i) => {
|
|
239
|
-
if (c !== '/') return true
|
|
240
|
-
return i === 0 || i === 3
|
|
241
|
-
})
|
|
242
|
-
|
|
243
|
-
// Enlever les slash non autorisés
|
|
244
|
-
ext = ext.map((c, i) => {
|
|
245
|
-
if (c === '/' && i !== 0 && i !== 3) return ''
|
|
246
|
-
if (c !== '/' && !/^[A-Z0-9]$/i.test(c)) return ''
|
|
247
|
-
return c
|
|
248
|
-
})
|
|
249
|
-
|
|
250
|
-
// Forcer le slash à la 4e position
|
|
251
|
-
if (ext.length > 3) {
|
|
252
|
-
ext[3] = '/'
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// Réduire à 7 caractères
|
|
256
|
-
ext = ext.slice(0, 7)
|
|
257
|
-
|
|
258
|
-
return (base + ext.join('')).slice(0, 22)
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
const gererPaste = (e: ClipboardEvent) => {
|
|
262
|
-
e.preventDefault()
|
|
263
|
-
const clipboardData = e.clipboardData
|
|
264
|
-
if (!clipboardData) return
|
|
265
|
-
let pasted = clipboardData.getData('text') || ''
|
|
266
|
-
codeBudgetaire.value = formaterCodeBudgetaire(pasted)
|
|
267
|
-
|
|
268
|
-
setTimeout(() => {
|
|
269
|
-
const input = e.target as HTMLInputElement
|
|
270
|
-
input.selectionStart = input.selectionEnd = codeBudgetaire.value.length
|
|
271
|
-
}, 0)
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
const sauvegarder = () => {
|
|
275
|
-
codeBudgetaire.value = formaterCodeBudgetaire(codeBudgetaire.value)
|
|
276
|
-
|
|
277
|
-
if (!estValideComplet.value) return
|
|
278
|
-
if (codeBudgetaire.value === derniereValeurSauvegardee.value) return
|
|
279
|
-
|
|
280
|
-
const codeNormalise = codeBudgetaire.value.trim().toUpperCase()
|
|
281
|
-
|
|
282
|
-
const existe = props.codeBudgetairesProp.some(item => {
|
|
283
|
-
const code = typeof item === 'string' ? item : item[0]
|
|
284
|
-
return code.trim().toUpperCase() === codeNormalise
|
|
285
|
-
})
|
|
286
|
-
|
|
287
|
-
if (!existe) {
|
|
288
|
-
const nouvelleListe = [...props.codeBudgetairesProp, codeBudgetaire.value]
|
|
289
|
-
emit('update:codeBudgetairesProp', nouvelleListe)
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
derniereValeurSauvegardee.value = codeBudgetaire.value
|
|
293
|
-
emit('update:modelValue', codeBudgetaire.value)
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
const extraireCode = (val: unknown): string => {
|
|
297
|
-
if (val == null) return ''
|
|
298
|
-
if (typeof val === 'string') return val
|
|
299
|
-
|
|
300
|
-
// Cas où Vuetify enverrait { code, label }
|
|
301
|
-
if (typeof val === 'object' && 'code' in (val as Record<string, unknown>)) {
|
|
302
|
-
const obj = val as { code?: unknown }
|
|
303
|
-
return typeof obj.code === 'string' ? obj.code : String(obj.code ?? '')
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
return String(val)
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
const gererChangement = (val: unknown) => {
|
|
310
|
-
const code = extraireCode(val)
|
|
311
|
-
codeBudgetaire.value = formaterCodeBudgetaire(code)
|
|
312
|
-
|
|
313
|
-
const valeurFormatee = codeBudgetaire.value.trim().toUpperCase()
|
|
314
|
-
|
|
315
|
-
const estDansListe = props.codeBudgetairesProp.some(item => {
|
|
316
|
-
const codeItem = typeof item === 'string' ? item : item[0]
|
|
317
|
-
return codeItem.trim().toUpperCase() === valeurFormatee
|
|
318
|
-
})
|
|
319
|
-
|
|
320
|
-
if (
|
|
321
|
-
estDansListe &&
|
|
322
|
-
valeurFormatee !== (derniereValeurSauvegardee.value ?? '').toUpperCase() &&
|
|
323
|
-
estValideComplet.value
|
|
324
|
-
) {
|
|
325
|
-
sauvegarder()
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
watch(
|
|
330
|
-
() => codeBudgetaire.value,
|
|
331
|
-
() => {
|
|
332
|
-
emit('update:valide', estValideComplet.value)
|
|
333
|
-
},
|
|
334
|
-
{ immediate: true },
|
|
335
|
-
)
|
|
336
|
-
</script>
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<csqcDialogue
|
|
3
|
-
ref="modale"
|
|
4
|
-
:titre="props.titre"
|
|
5
|
-
:operation-en-cours="operationEnCours"
|
|
6
|
-
activator="supprimer"
|
|
7
|
-
v-bind="$attrs"
|
|
8
|
-
:largeur="props.largeur"
|
|
9
|
-
@ok="confirmer"
|
|
10
|
-
@annuler="annuler"
|
|
11
|
-
>
|
|
12
|
-
<v-form
|
|
13
|
-
ref="form"
|
|
14
|
-
@submit.prevent
|
|
15
|
-
>
|
|
16
|
-
<v-row>
|
|
17
|
-
<v-col
|
|
18
|
-
cols="12"
|
|
19
|
-
class="pa-0 ma-0"
|
|
20
|
-
>
|
|
21
|
-
<span v-html="texte"></span>
|
|
22
|
-
</v-col>
|
|
23
|
-
</v-row>
|
|
24
|
-
</v-form>
|
|
25
|
-
</csqcDialogue>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script lang="ts" setup>
|
|
29
|
-
import { ref } from 'vue'
|
|
30
|
-
import csqcDialogue from './csqcDialogue.vue'
|
|
31
|
-
|
|
32
|
-
const modale = ref<InstanceType<typeof csqcDialogue> | null>(null)
|
|
33
|
-
const utilisateurATermine = ref(false)
|
|
34
|
-
const reponse = ref(false)
|
|
35
|
-
const texte = ref('')
|
|
36
|
-
const modeAlerte = ref(false)
|
|
37
|
-
|
|
38
|
-
const props = defineProps({
|
|
39
|
-
operationEnCours: { type: Boolean, default: false },
|
|
40
|
-
titre: { type: String, default: '' },
|
|
41
|
-
largeur: { type: String, default: '525px' },
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const ouvrir = async (message: string, modeAlerteParam: boolean = false) => {
|
|
45
|
-
texte.value = message
|
|
46
|
-
modeAlerte.value = modeAlerteParam
|
|
47
|
-
utilisateurATermine.value = false
|
|
48
|
-
modale.value?.ouvrir()
|
|
49
|
-
|
|
50
|
-
while (!utilisateurATermine.value) {
|
|
51
|
-
await new Promise(resolve => setTimeout(resolve, 100)) // Attendre 100ms
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return reponse.value
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const confirmer = (): void => {
|
|
58
|
-
reponse.value = true
|
|
59
|
-
utilisateurATermine.value = true
|
|
60
|
-
|
|
61
|
-
if (modeAlerte.value) fermer()
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const annuler = (): void => {
|
|
65
|
-
reponse.value = false
|
|
66
|
-
utilisateurATermine.value = true
|
|
67
|
-
fermer()
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const fermer = (): void => {
|
|
71
|
-
modale.value?.fermer()
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
defineExpose({ ouvrir, fermer })
|
|
75
|
-
</script>
|
package/composants/csqcDate.vue
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-date-input
|
|
3
|
-
v-model="dateValeur"
|
|
4
|
-
v-bind="$attrs"
|
|
5
|
-
input-format="yyyy-MM-dd"
|
|
6
|
-
variant="outlined"
|
|
7
|
-
prepend-icon=""
|
|
8
|
-
prepend-inner-icon="$calendar"
|
|
9
|
-
density="comfortable"
|
|
10
|
-
@update:model-value="formatDate"
|
|
11
|
-
></v-date-input>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import { ref, watch } from 'vue'
|
|
16
|
-
import { VDateInput } from 'vuetify/labs/VDateInput'
|
|
17
|
-
|
|
18
|
-
const props = withDefaults(
|
|
19
|
-
defineProps<{
|
|
20
|
-
modelValue: string | Date | null
|
|
21
|
-
}>(),
|
|
22
|
-
{},
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
const emit = defineEmits(['update:modelValue'])
|
|
26
|
-
const dateValeur = ref<Date | string | null>(props.modelValue)
|
|
27
|
-
|
|
28
|
-
const formatDate = (date: Date | string | null) => {
|
|
29
|
-
if (date == null) {
|
|
30
|
-
emit('update:modelValue', null)
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (typeof date === 'string') {
|
|
35
|
-
emit('update:modelValue', props.modelValue)
|
|
36
|
-
return
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
//Transformer la date en string
|
|
40
|
-
const d = new Date(date)
|
|
41
|
-
const yyyy = d.getFullYear()
|
|
42
|
-
const mm = String(d.getMonth() + 1).padStart(2, '0')
|
|
43
|
-
const dd = String(d.getDate()).padStart(2, '0')
|
|
44
|
-
const formatte = `${yyyy}-${mm}-${dd}`
|
|
45
|
-
dateValeur.value = formatte
|
|
46
|
-
|
|
47
|
-
emit('update:modelValue', dateValeur.value)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Synchronise les props externes avec l'état interne
|
|
51
|
-
watch(
|
|
52
|
-
() => props.modelValue,
|
|
53
|
-
nouvelle => {
|
|
54
|
-
dateValeur.value = nouvelle
|
|
55
|
-
},
|
|
56
|
-
)
|
|
57
|
-
</script>
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-dialog
|
|
3
|
-
v-model="dialog"
|
|
4
|
-
v-bind="$attrs"
|
|
5
|
-
class="pa-0 ma-0"
|
|
6
|
-
:width="largeur"
|
|
7
|
-
:fullscreen="display.xs.value"
|
|
8
|
-
max-width="650"
|
|
9
|
-
:persistent="props.persistant"
|
|
10
|
-
@keydown.esc="!persistant ? annuler : ''"
|
|
11
|
-
@click:outside="!persistant ? annuler : ''"
|
|
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="annuler"
|
|
21
|
-
></v-btn>
|
|
22
|
-
|
|
23
|
-
<v-card-title
|
|
24
|
-
class="pa-0 ma-0 pb-6"
|
|
25
|
-
style="font-size: 24px; white-space: normal; word-break: break-word"
|
|
26
|
-
>
|
|
27
|
-
<slot name="titre"></slot>
|
|
28
|
-
<div text-h5><span v-html="titre"></span></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
|
-
:loading="operationEnCours"
|
|
43
|
-
variant="text"
|
|
44
|
-
@click="annuler"
|
|
45
|
-
>
|
|
46
|
-
{{ btnAnnulerTexte ? btnAnnulerTexte : $t('csqc.bouton.annuler') }}
|
|
47
|
-
</v-btn>
|
|
48
|
-
|
|
49
|
-
<v-btn
|
|
50
|
-
v-if="btnOk"
|
|
51
|
-
class="Gouttiere"
|
|
52
|
-
color="primary"
|
|
53
|
-
:loading="operationEnCours"
|
|
54
|
-
:disabled="btnOkDesactiver"
|
|
55
|
-
variant="flat"
|
|
56
|
-
@click="okBouton"
|
|
57
|
-
>
|
|
58
|
-
{{ btnOkTexte ? btnOkTexte : $t('csqc.bouton.ok') }}
|
|
59
|
-
</v-btn>
|
|
60
|
-
</v-card-actions>
|
|
61
|
-
</v-card>
|
|
62
|
-
</v-dialog>
|
|
63
|
-
</template>
|
|
64
|
-
|
|
65
|
-
<script setup lang="ts">
|
|
66
|
-
import { ref } from 'vue'
|
|
67
|
-
import { useDisplay } from 'vuetify'
|
|
68
|
-
|
|
69
|
-
const display = useDisplay()
|
|
70
|
-
|
|
71
|
-
// Déclaration des props
|
|
72
|
-
const props = defineProps({
|
|
73
|
-
largeur: { type: String, default: '50vw' },
|
|
74
|
-
persistant: { type: Boolean, default: true },
|
|
75
|
-
operationEnCours: { type: Boolean, default: false },
|
|
76
|
-
btnAnnuler: { type: Boolean, default: true },
|
|
77
|
-
btnOk: { type: Boolean, default: true },
|
|
78
|
-
btnAnnulerTexte: { type: String, default: '' },
|
|
79
|
-
btnOkTexte: { type: String, default: '' },
|
|
80
|
-
titre: { type: String, default: '' },
|
|
81
|
-
btnOkDesactiver: { type: Boolean, default: false },
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
// Déclaration des événements émis
|
|
85
|
-
const emit = defineEmits(['annuler', 'ok'])
|
|
86
|
-
|
|
87
|
-
// Gestion de l'état du dialogue
|
|
88
|
-
const dialog = ref(false)
|
|
89
|
-
|
|
90
|
-
// Méthodes pour gérer l'ouverture et la fermeture
|
|
91
|
-
const ouvrir = () => {
|
|
92
|
-
dialog.value = true
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const fermer = () => {
|
|
96
|
-
dialog.value = false
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Gestion des actions des boutons
|
|
100
|
-
const annuler = () => {
|
|
101
|
-
emit('annuler')
|
|
102
|
-
fermer()
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const okBouton = () => {
|
|
106
|
-
emit('ok')
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// permet d'exporter les 2 actions
|
|
110
|
-
defineExpose({ ouvrir, fermer })
|
|
111
|
-
</script>
|
|
112
|
-
|
|
113
|
-
<style lang="css" scoped>
|
|
114
|
-
.v-card__text,
|
|
115
|
-
.v-card__title {
|
|
116
|
-
word-break: normal; /* empeche le wrap de couper un mot en XS */
|
|
117
|
-
}
|
|
118
|
-
</style>
|