codevdesign 1.0.29 → 1.0.31
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 +15 -11
- 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 -328
- 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 -212
- 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/index.ts +0 -75
- 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,328 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="editor">
|
|
3
|
-
<!-- Remount contrôlé pour TinyMCE -->
|
|
4
|
-
<Editor
|
|
5
|
-
v-bind="$attrs"
|
|
6
|
-
v-if="editorReady"
|
|
7
|
-
v-model="editorValue"
|
|
8
|
-
:init="initOptions"
|
|
9
|
-
:disabled="desactiver"
|
|
10
|
-
license-key="gpl"
|
|
11
|
-
@blur="onBlur"
|
|
12
|
-
@keydown="onUserActivity"
|
|
13
|
-
@change="onUserActivity"
|
|
14
|
-
/>
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
import Editor from '@tinymce/tinymce-vue'
|
|
20
|
-
import * as tinymce from 'tinymce/tinymce.js'
|
|
21
|
-
|
|
22
|
-
// Core/skins/thème
|
|
23
|
-
import 'tinymce/icons/default/icons.min.js'
|
|
24
|
-
import 'tinymce/themes/silver/theme.min.js'
|
|
25
|
-
import 'tinymce/models/dom/model.min.js'
|
|
26
|
-
import 'tinymce/skins/ui/oxide/skin.js'
|
|
27
|
-
import 'tinymce/skins/ui/oxide/content.js'
|
|
28
|
-
import 'tinymce/skins/content/default/content.js'
|
|
29
|
-
|
|
30
|
-
// Langue
|
|
31
|
-
import 'tinymce-i18n/langs7/fr_FR'
|
|
32
|
-
|
|
33
|
-
// Plugins
|
|
34
|
-
import 'tinymce/plugins/autoresize/plugin.min.js'
|
|
35
|
-
import 'tinymce/plugins/advlist/plugin.min.js'
|
|
36
|
-
import 'tinymce/plugins/lists/plugin.min.js'
|
|
37
|
-
import 'tinymce/plugins/link/plugin.min.js'
|
|
38
|
-
import 'tinymce/plugins/autolink/plugin.min.js'
|
|
39
|
-
import 'tinymce/plugins/fullscreen/plugin.min.js'
|
|
40
|
-
import 'tinymce/plugins/table/plugin.min.js'
|
|
41
|
-
import 'tinymce/plugins/image/plugin.min.js'
|
|
42
|
-
//import 'tinymce/plugins/emoticons/plugin.min.js'
|
|
43
|
-
//import 'tinymce/plugins/emoticons/js/emojis.min.js'
|
|
44
|
-
import 'tinymce/plugins/code/plugin.min.js'
|
|
45
|
-
|
|
46
|
-
const openLink = (url, target) => {
|
|
47
|
-
if (!url) return
|
|
48
|
-
if (import.meta.env.MODE !== 'development') {
|
|
49
|
-
if (target && target !== '_blank') {
|
|
50
|
-
document.location.href = url
|
|
51
|
-
return
|
|
52
|
-
}
|
|
53
|
-
window.open(url, target || '_blank', 'noopener,noreferrer')
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export default {
|
|
58
|
-
name: 'EditeurForm',
|
|
59
|
-
components: { Editor },
|
|
60
|
-
|
|
61
|
-
props: {
|
|
62
|
-
modelValue: { type: String, default: '' },
|
|
63
|
-
langue: { type: String, default: 'fr_FR' },
|
|
64
|
-
interdireRedimension: { type: Boolean, default: false },
|
|
65
|
-
desactiver: { type: Boolean, default: false },
|
|
66
|
-
plugins: {
|
|
67
|
-
type: [String, Array],
|
|
68
|
-
default: 'autoresize table image link fullscreen advlist lists autolink code',
|
|
69
|
-
},
|
|
70
|
-
interdireImage: { type: Boolean, default: false },
|
|
71
|
-
imageTailleMaximale: { type: Number, default: 5 }, // Mo
|
|
72
|
-
cacherBarreMenu: { type: Boolean, default: false },
|
|
73
|
-
cacherBarreOutils: { type: Boolean, default: false },
|
|
74
|
-
toolbar: {
|
|
75
|
-
type: [String, Array],
|
|
76
|
-
default:
|
|
77
|
-
'bold italic underline strikethrough | fontsizeselect | forecolor backcolor | ' +
|
|
78
|
-
'alignleft aligncenter alignright alignjustify | emoticons | bullist numlist | ' +
|
|
79
|
-
'image | link | outdent indent blockquote | undo redo | fullscreen | removeformat | table | code',
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
emits: ['update:modelValue', 'blur'],
|
|
84
|
-
|
|
85
|
-
data() {
|
|
86
|
-
return {
|
|
87
|
-
editorReady: true,
|
|
88
|
-
_editor: null,
|
|
89
|
-
editorValue: this.modelValue, // lié au v-model
|
|
90
|
-
_reinitPending: false,
|
|
91
|
-
_reinitLock: false,
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
computed: {
|
|
96
|
-
imageTailleMaxMo() {
|
|
97
|
-
const n = Number(this.imageTailleMaximale)
|
|
98
|
-
if (!Number.isFinite(n)) return 5
|
|
99
|
-
return Math.min(100, Math.max(0, n))
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
toolbarEffective() {
|
|
103
|
-
if (this.cacherBarreOutils) return false
|
|
104
|
-
const raw = Array.isArray(this.toolbar) ? this.toolbar.join(' | ') : this.toolbar
|
|
105
|
-
if (!this.interdireImage) return this._normalizeToolbar(raw)
|
|
106
|
-
|
|
107
|
-
const sansImage = raw
|
|
108
|
-
.replace(/\bimage\b/g, '')
|
|
109
|
-
.replace(/\s*\|\s*/g, ' | ')
|
|
110
|
-
.replace(/(\s*\|\s*){2,}/g, ' | ')
|
|
111
|
-
.replace(/^\s*\|\s*|\s*\|\s*$/g, '')
|
|
112
|
-
.replace(/\s{2,}/g, ' ')
|
|
113
|
-
.trim()
|
|
114
|
-
|
|
115
|
-
return this._normalizeToolbar(sansImage)
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
pluginsEffective() {
|
|
119
|
-
const list = (Array.isArray(this.plugins) ? this.plugins : this.plugins.split(/\s+/))
|
|
120
|
-
.map(p => p.trim())
|
|
121
|
-
.filter(Boolean)
|
|
122
|
-
const filtered = this.interdireImage ? list.filter(p => p !== 'image') : list
|
|
123
|
-
return filtered.join(' ')
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
initOptions() {
|
|
127
|
-
const opts = {
|
|
128
|
-
autolink: !this.desactiver,
|
|
129
|
-
autoresize: true,
|
|
130
|
-
automatic_uploads: !this.interdireImage,
|
|
131
|
-
branding: false,
|
|
132
|
-
browser_spellcheck: true,
|
|
133
|
-
content_css: 'default',
|
|
134
|
-
deprecation_warnings: false,
|
|
135
|
-
emoticons_database: 'emojis',
|
|
136
|
-
highlight_on_focus: false,
|
|
137
|
-
image_dimensions: !this.interdireImage,
|
|
138
|
-
language: this.langue === 'en' ? 'en_US' : 'fr_FR',
|
|
139
|
-
license_key: 'gpl',
|
|
140
|
-
menubar: !this.cacherBarreMenu,
|
|
141
|
-
object_resizing: !this.interdireImage,
|
|
142
|
-
paste_data_images: !this.interdireImage,
|
|
143
|
-
plugins: this.pluginsEffective,
|
|
144
|
-
promotion: false,
|
|
145
|
-
readonly: this.desactiver,
|
|
146
|
-
resize: !this.interdireRedimension,
|
|
147
|
-
resize_img_proportional: !this.interdireImage,
|
|
148
|
-
skin_url: 'default',
|
|
149
|
-
statusbar: this.cacherBarreOutils === false,
|
|
150
|
-
theme_advanced_resizing: true,
|
|
151
|
-
theme_advanced_resizing_use_cookie: false,
|
|
152
|
-
toolbar: this.toolbarEffective,
|
|
153
|
-
|
|
154
|
-
// --- File picker seulement si images permises ---
|
|
155
|
-
...(this.interdireImage ? {} : { file_picker_types: 'image' }),
|
|
156
|
-
|
|
157
|
-
setup: editor => {
|
|
158
|
-
this._editor = editor
|
|
159
|
-
|
|
160
|
-
editor.on('init', () => {
|
|
161
|
-
// init ok
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
// Intercepter clics liens
|
|
165
|
-
editor.on('click', e => {
|
|
166
|
-
const a = e.target?.closest?.('a')
|
|
167
|
-
if (!a) return
|
|
168
|
-
const href = a.getAttribute('href')
|
|
169
|
-
const target = a.getAttribute('target')
|
|
170
|
-
if (href) {
|
|
171
|
-
e.preventDefault()
|
|
172
|
-
openLink(href, target)
|
|
173
|
-
}
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
// ENTER sur un lien
|
|
177
|
-
editor.on('keydown', e => {
|
|
178
|
-
if (e.key !== 'Enter') return
|
|
179
|
-
const node = editor.selection?.getNode?.()
|
|
180
|
-
const a = node?.closest?.('a')
|
|
181
|
-
if (a) {
|
|
182
|
-
e.preventDefault()
|
|
183
|
-
openLink(a.getAttribute('href'), a.getAttribute('target'))
|
|
184
|
-
}
|
|
185
|
-
})
|
|
186
|
-
},
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (!this.interdireImage) {
|
|
190
|
-
opts.file_picker_callback = cb => {
|
|
191
|
-
const input = document.createElement('input')
|
|
192
|
-
input.type = 'file'
|
|
193
|
-
input.accept = 'image/*'
|
|
194
|
-
input.onchange = () => {
|
|
195
|
-
const file = input.files?.[0]
|
|
196
|
-
if (!file) return
|
|
197
|
-
|
|
198
|
-
const reader = new FileReader()
|
|
199
|
-
reader.onload = () => {
|
|
200
|
-
const base64 = String(reader.result).split(',')[1]
|
|
201
|
-
const editor = this._editor
|
|
202
|
-
const blobCache = editor?.editorUpload?.blobCache
|
|
203
|
-
if (!blobCache) return
|
|
204
|
-
|
|
205
|
-
const id = 'blobid' + Date.now()
|
|
206
|
-
const blobInfo = blobCache.create(id, file, base64)
|
|
207
|
-
const imageSize = blobInfo.blob().size / 1_000_000
|
|
208
|
-
if (imageSize > this.imageTailleMaxMo) {
|
|
209
|
-
alert('Fichier trop volumineux > ' + this.imageTailleMaxMo + ' Mo')
|
|
210
|
-
return
|
|
211
|
-
}
|
|
212
|
-
blobCache.add(blobInfo)
|
|
213
|
-
cb(blobInfo.blobUri(), { title: file.name })
|
|
214
|
-
}
|
|
215
|
-
reader.readAsDataURL(file)
|
|
216
|
-
}
|
|
217
|
-
input.click()
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
return opts
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
watch: {
|
|
226
|
-
/* v-model (parent -> enfant) */
|
|
227
|
-
modelValue(v) {
|
|
228
|
-
this.editorValue = v
|
|
229
|
-
},
|
|
230
|
-
|
|
231
|
-
/* v-model (enfant -> parent) */
|
|
232
|
-
editorValue(v) {
|
|
233
|
-
this.$emit('update:modelValue', v)
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
// Re-montage propre sur changements des props
|
|
237
|
-
interdireImage() {
|
|
238
|
-
this._scheduleReinit()
|
|
239
|
-
},
|
|
240
|
-
interdireRedimension() {
|
|
241
|
-
this._scheduleReinit()
|
|
242
|
-
},
|
|
243
|
-
toolbar() {
|
|
244
|
-
this._scheduleReinit()
|
|
245
|
-
},
|
|
246
|
-
imageTailleMaximale() {
|
|
247
|
-
this._scheduleReinit()
|
|
248
|
-
},
|
|
249
|
-
plugins() {
|
|
250
|
-
this._scheduleReinit()
|
|
251
|
-
},
|
|
252
|
-
cacherBarreOutils() {
|
|
253
|
-
this._scheduleReinit()
|
|
254
|
-
},
|
|
255
|
-
cacherBarreMenu() {
|
|
256
|
-
this._scheduleReinit()
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
|
|
260
|
-
methods: {
|
|
261
|
-
onBlur() {
|
|
262
|
-
if (!this.desactiver) this.$emit('blur')
|
|
263
|
-
},
|
|
264
|
-
onUserActivity() {},
|
|
265
|
-
insererAuCurseur(texte) {
|
|
266
|
-
const ed = this._editor
|
|
267
|
-
if (!ed) return
|
|
268
|
-
|
|
269
|
-
// Focus sur l'éditeur pour que TinyMCE sache où insérer
|
|
270
|
-
ed.focus()
|
|
271
|
-
|
|
272
|
-
// Insert au curseur (respecte le contexte HTML)
|
|
273
|
-
ed.insertContent(texte)
|
|
274
|
-
},
|
|
275
|
-
_normalizeToolbar(tb) {
|
|
276
|
-
const trimmed = (tb || '').trim()
|
|
277
|
-
return trimmed && trimmed !== '|' ? trimmed : 'undo redo'
|
|
278
|
-
},
|
|
279
|
-
|
|
280
|
-
_scheduleReinit() {
|
|
281
|
-
if (this._reinitPending) return
|
|
282
|
-
this._reinitPending = true
|
|
283
|
-
queueMicrotask(async () => {
|
|
284
|
-
this._reinitPending = false
|
|
285
|
-
await this._reinitEditor()
|
|
286
|
-
})
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
async _reinitEditor() {
|
|
290
|
-
if (this._reinitLock) return
|
|
291
|
-
this._reinitLock = true
|
|
292
|
-
try {
|
|
293
|
-
const ed = this._editor
|
|
294
|
-
if (ed && typeof ed.remove === 'function') {
|
|
295
|
-
try {
|
|
296
|
-
ed.remove()
|
|
297
|
-
} catch (e) {
|
|
298
|
-
console.warn('[Editeur] editor.remove erreur', e)
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
this._editor = null
|
|
302
|
-
|
|
303
|
-
// remount contrôlé
|
|
304
|
-
this.editorReady = false
|
|
305
|
-
await this.$nextTick()
|
|
306
|
-
this.editorReady = true
|
|
307
|
-
await this.$nextTick()
|
|
308
|
-
} finally {
|
|
309
|
-
this._reinitLock = false
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
|
-
|
|
314
|
-
beforeUnmount() {
|
|
315
|
-
try {
|
|
316
|
-
const ed = this._editor
|
|
317
|
-
if (ed && typeof ed.remove === 'function') ed.remove()
|
|
318
|
-
} catch {}
|
|
319
|
-
this._editor = null
|
|
320
|
-
},
|
|
321
|
-
}
|
|
322
|
-
</script>
|
|
323
|
-
|
|
324
|
-
<style scoped>
|
|
325
|
-
.editor a {
|
|
326
|
-
cursor: pointer !important;
|
|
327
|
-
}
|
|
328
|
-
</style>
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-app-bar
|
|
3
|
-
:color="barreCouleur"
|
|
4
|
-
class="px-0 mx-0"
|
|
5
|
-
:style="{
|
|
6
|
-
position: 'sticky',
|
|
7
|
-
// variables CSS pour les couleurs dynamiques
|
|
8
|
-
'--entete-texte': texteCouleur,
|
|
9
|
-
'--entete-icone': iconeCouleur,
|
|
10
|
-
}"
|
|
11
|
-
height="82px"
|
|
12
|
-
>
|
|
13
|
-
<v-row
|
|
14
|
-
class="pt-2"
|
|
15
|
-
@resize="controlAffichage"
|
|
16
|
-
>
|
|
17
|
-
<v-col
|
|
18
|
-
:cols="titreCol"
|
|
19
|
-
class="pr-0 mr-0 pl-5"
|
|
20
|
-
>
|
|
21
|
-
<v-toolbar-title class="titre">
|
|
22
|
-
<!-- Barre de retour -->
|
|
23
|
-
<slot name="retour">
|
|
24
|
-
<v-icon
|
|
25
|
-
v-if="retour"
|
|
26
|
-
size="large"
|
|
27
|
-
start
|
|
28
|
-
:color="iconeCouleur"
|
|
29
|
-
icon="mdi-arrow-left-thin"
|
|
30
|
-
@click="retournerMenu"
|
|
31
|
-
/>
|
|
32
|
-
</slot>
|
|
33
|
-
|
|
34
|
-
<div class="titre-bloc">
|
|
35
|
-
<!-- Titre -->
|
|
36
|
-
<slot name="titre">
|
|
37
|
-
<span class="pl-3 titre-texte">{{ props.titre }}</span>
|
|
38
|
-
</slot>
|
|
39
|
-
|
|
40
|
-
<!-- État -->
|
|
41
|
-
<slot name="etat">
|
|
42
|
-
<span
|
|
43
|
-
v-if="monEtat?.afficher"
|
|
44
|
-
class="pl-10"
|
|
45
|
-
>
|
|
46
|
-
<v-btn
|
|
47
|
-
size="small"
|
|
48
|
-
:color="monEtat.couleur"
|
|
49
|
-
variant="tonal"
|
|
50
|
-
>
|
|
51
|
-
{{ monEtat.texte }}
|
|
52
|
-
</v-btn>
|
|
53
|
-
</span>
|
|
54
|
-
</slot>
|
|
55
|
-
|
|
56
|
-
<!-- État secondaire -->
|
|
57
|
-
<slot name="etatSecondaire">
|
|
58
|
-
<span
|
|
59
|
-
v-if="monEtatSecondaire?.afficher"
|
|
60
|
-
class="pl-3"
|
|
61
|
-
>
|
|
62
|
-
<v-btn
|
|
63
|
-
size="small"
|
|
64
|
-
:color="monEtatSecondaire.couleur"
|
|
65
|
-
variant="tonal"
|
|
66
|
-
>
|
|
67
|
-
{{ monEtatSecondaire.texte }}
|
|
68
|
-
</v-btn>
|
|
69
|
-
</span>
|
|
70
|
-
</slot>
|
|
71
|
-
|
|
72
|
-
<!-- Sous-titre -->
|
|
73
|
-
<slot name="soustitre">
|
|
74
|
-
<span class="pl-3 soustitre-texte">{{ props.soustitre }}</span>
|
|
75
|
-
</slot>
|
|
76
|
-
</div>
|
|
77
|
-
</v-toolbar-title>
|
|
78
|
-
</v-col>
|
|
79
|
-
</v-row>
|
|
80
|
-
|
|
81
|
-
<!-- Barre en bas -->
|
|
82
|
-
<div style="position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background-color: #808a9d" />
|
|
83
|
-
</v-app-bar>
|
|
84
|
-
</template>
|
|
85
|
-
|
|
86
|
-
<script setup lang="ts">
|
|
87
|
-
import { useRouter } from 'vue-router'
|
|
88
|
-
import { ref, computed } from 'vue'
|
|
89
|
-
|
|
90
|
-
interface EnteteEtat {
|
|
91
|
-
afficher: boolean
|
|
92
|
-
couleur: string
|
|
93
|
-
texte: string
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
interface EnteteEtatSecondaire {
|
|
97
|
-
afficher: boolean
|
|
98
|
-
couleur: string
|
|
99
|
-
texte: string
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const router = useRouter()
|
|
103
|
-
|
|
104
|
-
const props = defineProps<{
|
|
105
|
-
titre: string
|
|
106
|
-
soustitre?: string
|
|
107
|
-
retour?: string
|
|
108
|
-
etat?: EnteteEtat
|
|
109
|
-
couleur?: string // couleur de la barre (Vuetify color/hex)
|
|
110
|
-
couleurTexte?: string
|
|
111
|
-
couleurIcone?: string
|
|
112
|
-
etatSecondaire?: EnteteEtatSecondaire
|
|
113
|
-
}>()
|
|
114
|
-
|
|
115
|
-
const titreCol = ref(12)
|
|
116
|
-
|
|
117
|
-
// Fallbacks (tes valeurs actuelles)
|
|
118
|
-
const barreCouleur = computed(() => props.couleur ?? 'white')
|
|
119
|
-
const texteCouleur = computed(() => props.couleurTexte ?? '#223654')
|
|
120
|
-
const iconeCouleur = computed(() => props.couleurIcone ?? 'grisMoyen') // peut être un nom de couleur Vuetify ou un hex
|
|
121
|
-
|
|
122
|
-
const monEtat = computed<EnteteEtat>(() => props.etat ?? { afficher: false, couleur: 'primary', texte: 'test' })
|
|
123
|
-
const monEtatSecondaire = computed<EnteteEtatSecondaire>(
|
|
124
|
-
() => props.etatSecondaire ?? { afficher: false, couleur: 'primary', texte: 'test' },
|
|
125
|
-
)
|
|
126
|
-
|
|
127
|
-
function retournerMenu() {
|
|
128
|
-
if (props.retour) router.push({ name: props.retour })
|
|
129
|
-
}
|
|
130
|
-
function controlAffichage() {
|
|
131
|
-
/* logique resize */
|
|
132
|
-
}
|
|
133
|
-
</script>
|
|
134
|
-
|
|
135
|
-
<style scoped>
|
|
136
|
-
.titre {
|
|
137
|
-
font-size: 1.85rem;
|
|
138
|
-
font-weight: bold;
|
|
139
|
-
margin-bottom: 15px;
|
|
140
|
-
}
|
|
141
|
-
.titre-texte {
|
|
142
|
-
color: var(--entete-texte, #223654);
|
|
143
|
-
}
|
|
144
|
-
.soustitre-texte {
|
|
145
|
-
display: block;
|
|
146
|
-
font-size: 1rem;
|
|
147
|
-
font-weight: normal;
|
|
148
|
-
color: var(--entete-texte, #223654);
|
|
149
|
-
}
|
|
150
|
-
.titre-bloc {
|
|
151
|
-
display: inline-block;
|
|
152
|
-
vertical-align: middle;
|
|
153
|
-
padding-left: 12px;
|
|
154
|
-
}
|
|
155
|
-
/* Couleur de l’icône (retour) + hover */
|
|
156
|
-
.v-icon {
|
|
157
|
-
color: var(--entete-icone, #6b7280); /* grisMoyen approx si hex */
|
|
158
|
-
}
|
|
159
|
-
.v-icon:hover {
|
|
160
|
-
/* tu peux garder une couleur fixe ou calculer une teinte plus foncée si besoin */
|
|
161
|
-
filter: brightness(0.85);
|
|
162
|
-
}
|
|
163
|
-
</style>
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<v-btn
|
|
4
|
-
color="success"
|
|
5
|
-
variant="outlined"
|
|
6
|
-
:loading="chargement"
|
|
7
|
-
class="elevation-0"
|
|
8
|
-
@click="importCsv"
|
|
9
|
-
>
|
|
10
|
-
{{ boutonTexte }}
|
|
11
|
-
<template #append>
|
|
12
|
-
<v-icon icon="mdi-microsoft-excel"></v-icon>
|
|
13
|
-
</template>
|
|
14
|
-
</v-btn>
|
|
15
|
-
|
|
16
|
-
<input
|
|
17
|
-
ref="fileInput"
|
|
18
|
-
type="file"
|
|
19
|
-
accept=".csv"
|
|
20
|
-
style="display: none"
|
|
21
|
-
@change="handleFileUpload"
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<script setup lang="ts">
|
|
27
|
-
import { ref, computed } from 'vue'
|
|
28
|
-
import { useI18n } from 'vue-i18n'
|
|
29
|
-
|
|
30
|
-
// Props
|
|
31
|
-
const props = withDefaults(
|
|
32
|
-
defineProps<{
|
|
33
|
-
boutonTexte?: string
|
|
34
|
-
erreurTexte?: string
|
|
35
|
-
chargement?: boolean
|
|
36
|
-
}>(),
|
|
37
|
-
{
|
|
38
|
-
chargement: false, // défaut
|
|
39
|
-
},
|
|
40
|
-
)
|
|
41
|
-
const emit = defineEmits(['import', 'import-erreur'])
|
|
42
|
-
|
|
43
|
-
const { t } = useI18n()
|
|
44
|
-
|
|
45
|
-
const boutonTexte = computed(() => props.boutonTexte ?? t('csqc.bouton.importer'))
|
|
46
|
-
const erreurTexte = computed(() => props.erreurTexte ?? t('csqc.csqcImportCSV.erreur.lectureFichier'))
|
|
47
|
-
|
|
48
|
-
// Références
|
|
49
|
-
const fileInput = ref<HTMLInputElement | null>(null)
|
|
50
|
-
const csvFile = ref<File | null>(null)
|
|
51
|
-
|
|
52
|
-
// Méthodes
|
|
53
|
-
function importCsv() {
|
|
54
|
-
fileInput.value?.click()
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function handleFileUpload(event: Event) {
|
|
58
|
-
const target = event.target as HTMLInputElement
|
|
59
|
-
const file = target.files?.[0]
|
|
60
|
-
|
|
61
|
-
if (file?.name.toLowerCase().endsWith('.csv')) {
|
|
62
|
-
csvFile.value = file
|
|
63
|
-
|
|
64
|
-
const reader = new FileReader()
|
|
65
|
-
|
|
66
|
-
reader.onload = () => {
|
|
67
|
-
try {
|
|
68
|
-
let text = reader.result as string
|
|
69
|
-
|
|
70
|
-
// Supprime BOM UTF-8 si présent
|
|
71
|
-
if (text.charCodeAt(0) === 0xfeff) {
|
|
72
|
-
text = text.slice(1)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const lignes = text
|
|
76
|
-
.trim()
|
|
77
|
-
.split(/\r?\n/)
|
|
78
|
-
.filter(row => row.trim() !== '') // ignore lignes vides
|
|
79
|
-
|
|
80
|
-
if (lignes.length === 0) {
|
|
81
|
-
emit('import-erreur', 'Le fichier CSV est vide.')
|
|
82
|
-
return
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Détection automatique du séparateur
|
|
86
|
-
const separateur = detecterSeparateur(lignes[0]!)
|
|
87
|
-
|
|
88
|
-
// Découpage des lignes
|
|
89
|
-
const data: string[][] = lignes.map(row => row.split(separateur).map(cell => cell.trim()))
|
|
90
|
-
|
|
91
|
-
emit('import', data)
|
|
92
|
-
} catch (error) {
|
|
93
|
-
emit('import-erreur', erreurTexte || t('csqc.csqcImportCSV.erreur.lectureFichier'))
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
reader.onerror = () => {
|
|
98
|
-
emit('import-erreur', t('csqc.csqcImportCSV.erreur.lectureFichier'))
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
reader.readAsText(file)
|
|
102
|
-
} else {
|
|
103
|
-
const message = erreurTexte || t('csqc.csqcImportCSV.erreur.erreur')
|
|
104
|
-
emit('import-erreur', message)
|
|
105
|
-
csvFile.value = null
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// Fonction pour détecter le séparateur le plus probable
|
|
110
|
-
function detecterSeparateur(ligne: string): string {
|
|
111
|
-
const separateursTestés = [',', ';', '\t', '|']
|
|
112
|
-
let meilleurSeparateur = ','
|
|
113
|
-
let maxColonnes = 0
|
|
114
|
-
|
|
115
|
-
for (const sep of separateursTestés) {
|
|
116
|
-
const nb = ligne.split(sep).length
|
|
117
|
-
if (nb > maxColonnes) {
|
|
118
|
-
maxColonnes = nb
|
|
119
|
-
meilleurSeparateur = sep
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return meilleurSeparateur
|
|
124
|
-
}
|
|
125
|
-
</script>
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<csqcDialogue
|
|
3
|
-
ref="modale"
|
|
4
|
-
:titre="titre"
|
|
5
|
-
activator="supprimer"
|
|
6
|
-
v-bind="$attrs"
|
|
7
|
-
:largeur="largeur"
|
|
8
|
-
@ok="confirmer"
|
|
9
|
-
@annuler="annuler"
|
|
10
|
-
>
|
|
11
|
-
<v-form
|
|
12
|
-
ref="form"
|
|
13
|
-
@submit.prevent
|
|
14
|
-
>
|
|
15
|
-
<v-row>
|
|
16
|
-
<v-col
|
|
17
|
-
cols="12"
|
|
18
|
-
class="pa-0 ma-0"
|
|
19
|
-
>
|
|
20
|
-
<span v-html="texte"></span>
|
|
21
|
-
</v-col>
|
|
22
|
-
</v-row>
|
|
23
|
-
|
|
24
|
-
<v-row>
|
|
25
|
-
<v-col
|
|
26
|
-
cols="12"
|
|
27
|
-
class="pa-0 ma-0"
|
|
28
|
-
>
|
|
29
|
-
<v-text-field
|
|
30
|
-
v-if="!multiligne"
|
|
31
|
-
v-model="reponse"
|
|
32
|
-
autofocus
|
|
33
|
-
@keyup.enter="confirmer"
|
|
34
|
-
/>
|
|
35
|
-
<v-textarea
|
|
36
|
-
v-if="multiligne"
|
|
37
|
-
v-model="reponse"
|
|
38
|
-
:rows="3"
|
|
39
|
-
autofocus
|
|
40
|
-
/>
|
|
41
|
-
</v-col>
|
|
42
|
-
</v-row>
|
|
43
|
-
</v-form>
|
|
44
|
-
</csqcDialogue>
|
|
45
|
-
</template>
|
|
46
|
-
|
|
47
|
-
<script lang="ts" setup>
|
|
48
|
-
import { ref } from 'vue'
|
|
49
|
-
import csqcDialogue from './csqcDialogue.vue'
|
|
50
|
-
|
|
51
|
-
const modale = ref<InstanceType<typeof csqcDialogue> | null>(null)
|
|
52
|
-
const utilisateurATermine = ref(false)
|
|
53
|
-
const reponse = ref<string | null>(null)
|
|
54
|
-
const texte = ref('')
|
|
55
|
-
const titre = ref('')
|
|
56
|
-
const largeur = ref('525px')
|
|
57
|
-
const multiligne = ref(false)
|
|
58
|
-
|
|
59
|
-
const ouvrir = async (
|
|
60
|
-
titreParam: string,
|
|
61
|
-
message: string,
|
|
62
|
-
multiligneParam: boolean = false,
|
|
63
|
-
largeurParam = '525px',
|
|
64
|
-
) => {
|
|
65
|
-
texte.value = message
|
|
66
|
-
titre.value = titreParam
|
|
67
|
-
multiligne.value = multiligneParam
|
|
68
|
-
largeur.value = largeurParam
|
|
69
|
-
utilisateurATermine.value = false
|
|
70
|
-
modale.value?.ouvrir()
|
|
71
|
-
|
|
72
|
-
while (!utilisateurATermine.value) {
|
|
73
|
-
await new Promise(resolve => setTimeout(resolve, 100)) // Attendre 100ms
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return reponse.value
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const confirmer = (): void => {
|
|
80
|
-
utilisateurATermine.value = true
|
|
81
|
-
fermer()
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const annuler = (): void => {
|
|
85
|
-
reponse.value = null
|
|
86
|
-
utilisateurATermine.value = true
|
|
87
|
-
fermer()
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const fermer = (): void => {
|
|
91
|
-
modale.value?.fermer()
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
defineExpose({ ouvrir, fermer })
|
|
95
|
-
</script>
|