codevdesign 0.0.96 → 0.0.98
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/composants/csqcChaise/chaiseConteneur.vue +3 -1
- package/composants/csqcRecherche.vue +212 -212
- package/composants/csqcTable/csqcTable.vue +382 -386
- package/composants/gabarit/pivEntete.vue +118 -118
- package/index.ts +7 -1
- package/locales/fr.json +2 -1
- package/outils/appAxios.ts +117 -0
- package/outils/rafraichisseurToken.ts +167 -0
- package/package.json +1 -1
|
@@ -1,386 +1,382 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<v-row v-if="barreHautAfficher">
|
|
4
|
-
<slot name="ligne" />
|
|
5
|
-
<!-- Affichage de la boite de recherche-->
|
|
6
|
-
<v-col>
|
|
7
|
-
<slot name="recherche"></slot>
|
|
8
|
-
<Recherche
|
|
9
|
-
:afficher="rechercheAfficher"
|
|
10
|
-
:recherche-texte="rechercheTexte"
|
|
11
|
-
:chargement="chargementListe"
|
|
12
|
-
:recherche="recherche"
|
|
13
|
-
:recherche-avancee="rechercheAvancee"
|
|
14
|
-
:recherche-avancee-texte="rechercheAvanceeTexte"
|
|
15
|
-
:recherche-avancee-largeur="rechercheAvanceeLargeur"
|
|
16
|
-
:recherche-avancee-style="rechercheAvanceeStyle"
|
|
17
|
-
class="flex-grow-1"
|
|
18
|
-
@update:recherche="chargerRecherche"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
:
|
|
39
|
-
:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
:
|
|
67
|
-
:
|
|
68
|
-
:
|
|
69
|
-
:
|
|
70
|
-
:
|
|
71
|
-
:
|
|
72
|
-
:
|
|
73
|
-
:
|
|
74
|
-
:
|
|
75
|
-
:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<!--
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<!--
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
:
|
|
121
|
-
:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
</
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
import
|
|
134
|
-
import
|
|
135
|
-
import
|
|
136
|
-
|
|
137
|
-
//import
|
|
138
|
-
import
|
|
139
|
-
import
|
|
140
|
-
import
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
//
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
//
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
//
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
//
|
|
179
|
-
//
|
|
180
|
-
//
|
|
181
|
-
//
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
//
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
const
|
|
207
|
-
const
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
.
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
.
|
|
369
|
-
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
.text-grisMoyen:hover {
|
|
384
|
-
color: #095797 !important;
|
|
385
|
-
}
|
|
386
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<v-row v-if="barreHautAfficher">
|
|
4
|
+
<slot name="ligne" />
|
|
5
|
+
<!-- Affichage de la boite de recherche-->
|
|
6
|
+
<v-col>
|
|
7
|
+
<slot name="recherche"></slot>
|
|
8
|
+
<Recherche
|
|
9
|
+
:afficher="rechercheAfficher"
|
|
10
|
+
:recherche-texte="rechercheTexte"
|
|
11
|
+
:chargement="chargementListe"
|
|
12
|
+
:recherche="recherche"
|
|
13
|
+
:recherche-avancee="rechercheAvancee"
|
|
14
|
+
:recherche-avancee-texte="rechercheAvanceeTexte"
|
|
15
|
+
:recherche-avancee-largeur="rechercheAvanceeLargeur"
|
|
16
|
+
:recherche-avancee-style="rechercheAvanceeStyle"
|
|
17
|
+
class="flex-grow-1"
|
|
18
|
+
@update:recherche="chargerRecherche"
|
|
19
|
+
@panneau:etat="onPanelChange"
|
|
20
|
+
>
|
|
21
|
+
<template #milieu>
|
|
22
|
+
<slot name="milieu" />
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<template #droite>
|
|
26
|
+
<slot name="droite" />
|
|
27
|
+
<v-btn
|
|
28
|
+
v-if="btnAjouter"
|
|
29
|
+
color="primary"
|
|
30
|
+
class="ml-1 float-right"
|
|
31
|
+
@click.stop="ajouter"
|
|
32
|
+
>
|
|
33
|
+
{{ props.btnAjouterTexte ? props.btnAjouterTexte : $t('csqc.bouton.ajouter') }}
|
|
34
|
+
</v-btn>
|
|
35
|
+
|
|
36
|
+
<exportExcelComponent
|
|
37
|
+
v-if="excel"
|
|
38
|
+
:liste="filteredItems"
|
|
39
|
+
:chargement-liste="chargementListe"
|
|
40
|
+
:nom-fichier="excelNomFichier"
|
|
41
|
+
class="mt-1 ml-1 float-right"
|
|
42
|
+
/>
|
|
43
|
+
</template>
|
|
44
|
+
<template #rechercheAvanceeTitre>
|
|
45
|
+
<slot name="rechercheAvanceeTitre" />
|
|
46
|
+
</template>
|
|
47
|
+
<template #rechercheAvanceeApresTitre>
|
|
48
|
+
<slot name="rechercheAvanceeApresTitre" />
|
|
49
|
+
</template>
|
|
50
|
+
<template #rechercheAvancee>
|
|
51
|
+
<slot name="rechercheAvancee" />
|
|
52
|
+
</template>
|
|
53
|
+
</Recherche>
|
|
54
|
+
</v-col>
|
|
55
|
+
</v-row>
|
|
56
|
+
|
|
57
|
+
<!-- datatable-->
|
|
58
|
+
<v-row>
|
|
59
|
+
<v-col
|
|
60
|
+
cols="12"
|
|
61
|
+
class="d-flex ControlesDatatable flex-wrap"
|
|
62
|
+
>
|
|
63
|
+
<v-data-table
|
|
64
|
+
ref="datatable"
|
|
65
|
+
color="green"
|
|
66
|
+
:headers="colonnes"
|
|
67
|
+
:item-key="itemKey"
|
|
68
|
+
:items="liste"
|
|
69
|
+
:search="recherche"
|
|
70
|
+
:loading="chargementListe"
|
|
71
|
+
:hover="hover"
|
|
72
|
+
:density="densite"
|
|
73
|
+
:items-per-page="itemsParPage"
|
|
74
|
+
:item-per-page-options="itemsParPageOptions"
|
|
75
|
+
:sort-by="triDepart"
|
|
76
|
+
:multi-sort="estMultiTriActif"
|
|
77
|
+
@click:row="cliqueLigne"
|
|
78
|
+
>
|
|
79
|
+
<!-- utilisation des slots via le component parent-->
|
|
80
|
+
<!-- eslint-disable-next-line -->
|
|
81
|
+
<template
|
|
82
|
+
v-for="(_, slot) of $slots"
|
|
83
|
+
:key="slot"
|
|
84
|
+
#[slot]="scope"
|
|
85
|
+
>
|
|
86
|
+
<slot
|
|
87
|
+
:name="slot"
|
|
88
|
+
v-bind="scope"
|
|
89
|
+
/>
|
|
90
|
+
</template>
|
|
91
|
+
|
|
92
|
+
<!-- boutons supprimer et modifier -->
|
|
93
|
+
<!-- eslint-disable-next-line -->
|
|
94
|
+
<template v-slot:item.action="{ item }">
|
|
95
|
+
<slot name="actionsCustom"></slot>
|
|
96
|
+
<v-icon
|
|
97
|
+
v-if="props.btnSupprimer"
|
|
98
|
+
size="large"
|
|
99
|
+
class="iconeSupprimer float-right"
|
|
100
|
+
@click.stop.prevent="ouvrirModaleSupprimer(item)"
|
|
101
|
+
>
|
|
102
|
+
mdi-delete
|
|
103
|
+
</v-icon>
|
|
104
|
+
|
|
105
|
+
<v-icon
|
|
106
|
+
v-if="props.btnModifier"
|
|
107
|
+
size="large"
|
|
108
|
+
class="iconeEditer float-right"
|
|
109
|
+
@click.stop.prevent="modifier(item)"
|
|
110
|
+
>
|
|
111
|
+
mdi-pencil
|
|
112
|
+
</v-icon>
|
|
113
|
+
</template>
|
|
114
|
+
</v-data-table>
|
|
115
|
+
|
|
116
|
+
<!-- Fenêtre de suppression -->
|
|
117
|
+
<confirmation
|
|
118
|
+
v-if="props.btnSupprimer"
|
|
119
|
+
ref="modaleSupprimer"
|
|
120
|
+
:texte="supprimerTexte"
|
|
121
|
+
:titre="supprimerTitreTexte"
|
|
122
|
+
:largeur="modaleSupprimerLargeur"
|
|
123
|
+
@confirmer="supprimer"
|
|
124
|
+
/>
|
|
125
|
+
</v-col>
|
|
126
|
+
</v-row>
|
|
127
|
+
</div>
|
|
128
|
+
</template>
|
|
129
|
+
|
|
130
|
+
<script setup lang="ts">
|
|
131
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
132
|
+
|
|
133
|
+
import { ref, computed, type Slots, type PropType } from 'vue'
|
|
134
|
+
import Recherche from '../csqcRecherche.vue'
|
|
135
|
+
import confirmation from '../csqcConfirmation.vue'
|
|
136
|
+
import exportExcelComponent from './csqcTableExportExcel.vue'
|
|
137
|
+
//import ModaleChoix from './csqc-table-modale-choix-colonnes.vue';
|
|
138
|
+
//import axios from 'axios'
|
|
139
|
+
import { useI18n } from 'vue-i18n'
|
|
140
|
+
import Colonne from '../../modeles/composants/datatableColonne'
|
|
141
|
+
import type { SortItem } from 'vuetify/lib/components/VDataTable/composables/sort.mjs'
|
|
142
|
+
|
|
143
|
+
// Props
|
|
144
|
+
const props = defineProps({
|
|
145
|
+
barreHautAfficher: { type: Boolean, default: true },
|
|
146
|
+
btnAjouter: { type: Boolean, default: true },
|
|
147
|
+
btnAjouterTexte: { type: String, default: '' },
|
|
148
|
+
btnModifier: { type: Boolean, default: true },
|
|
149
|
+
btnSupprimer: { type: Boolean, default: true },
|
|
150
|
+
chargementListe: { type: Boolean, default: false },
|
|
151
|
+
operationEnCours: { type: Boolean, default: false },
|
|
152
|
+
//choixSwitchOptionDepart: { type: Boolean, default: false },
|
|
153
|
+
// classeRangee: { type: String, default: '' },
|
|
154
|
+
colonnes: {
|
|
155
|
+
type: Array as PropType<Colonne[]>,
|
|
156
|
+
default: () => [],
|
|
157
|
+
},
|
|
158
|
+
densite: { type: String as PropType<'default' | 'comfortable' | 'compact'>, default: 'default' },
|
|
159
|
+
excel: { type: Boolean, default: false },
|
|
160
|
+
excelNomFichier: { type: String, default: 'csqc' },
|
|
161
|
+
//filtresDepart: { type: Object, default: null },
|
|
162
|
+
//flechesTri: { type: Boolean, default: false },
|
|
163
|
+
formulaireId: { type: Number, default: -1 },
|
|
164
|
+
identifiant: {
|
|
165
|
+
type: [String, null] as PropType<string | null>,
|
|
166
|
+
default: null,
|
|
167
|
+
},
|
|
168
|
+
itemKey: { type: String, default: 'id' },
|
|
169
|
+
itemsParPage: { type: Number, default: 10 },
|
|
170
|
+
liste: {
|
|
171
|
+
type: Array as PropType<Record<string, any>[]>,
|
|
172
|
+
default: () => [],
|
|
173
|
+
},
|
|
174
|
+
hover: { type: Boolean, default: false },
|
|
175
|
+
// modulerDense: { type: Boolean, default: false },
|
|
176
|
+
// multifiltre: { type: Boolean, default: false },
|
|
177
|
+
itemsParPageOptions: { type: Array, default: () => [10, 25, 30, -1] },
|
|
178
|
+
//pageCourante: { type: Number, default: 1 },
|
|
179
|
+
//paginationBottom: { type: Boolean, default: true },
|
|
180
|
+
// paginationTop: { type: Boolean, default: false },
|
|
181
|
+
// permettreChoixColonnes: { type: Boolean, default: false },
|
|
182
|
+
// rechercheDepart: { type: String, default: '' },
|
|
183
|
+
rechercheTexte: { type: String, default: '' },
|
|
184
|
+
rechercheAfficher: { type: Boolean, default: true },
|
|
185
|
+
rechercheAvancee: { type: Boolean, default: false },
|
|
186
|
+
rechercheAvanceeTexte: { type: String, default: '' },
|
|
187
|
+
rechercheAvanceeLargeur: { type: Number, default: 12 },
|
|
188
|
+
rechercheAvanceeStyle: { type: String, default: '' },
|
|
189
|
+
// selectionChoixColonnesDepart: { type: String, default: '' },
|
|
190
|
+
// showSelect: { type: Boolean, default: false },
|
|
191
|
+
|
|
192
|
+
modaleSupprimerChamp: { type: String, default: '' },
|
|
193
|
+
modaleSupprimerTexte: { type: String, default: '' },
|
|
194
|
+
modaleSupprimerTitre: { type: String, default: '' },
|
|
195
|
+
modaleSupprimerLargeur: { type: String, default: '525px' },
|
|
196
|
+
triDescDepart: { type: Boolean, default: false },
|
|
197
|
+
triParDepart: {
|
|
198
|
+
type: [Array, String] as PropType<string | string[] | SortItem[] | undefined>,
|
|
199
|
+
default: undefined,
|
|
200
|
+
},
|
|
201
|
+
//urlbase: { type: String, default: '' },
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
205
|
+
const slots = defineSlots<Slots>()
|
|
206
|
+
const { t } = useI18n({ useScope: 'global' })
|
|
207
|
+
const itemSelectionne = ref(null)
|
|
208
|
+
const modaleSupprimer = ref<InstanceType<typeof confirmation> | null>(null)
|
|
209
|
+
const supprimerTexte = computed(() => {
|
|
210
|
+
if (itemSelectionne.value == null) return ''
|
|
211
|
+
|
|
212
|
+
if (props.modaleSupprimerTexte != null && props.modaleSupprimerTexte != '') return props.modaleSupprimerTexte
|
|
213
|
+
|
|
214
|
+
return t('csqc.message.supprimerMessage', { nom: itemSelectionne?.value[props.modaleSupprimerChamp] ?? '' })
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
const supprimerTitreTexte = computed(() => props.modaleSupprimerTitre || t('csqc.message.supprimerTitre'))
|
|
218
|
+
|
|
219
|
+
// Fonction pour ouvrir le dialogue pour un item spécifique
|
|
220
|
+
const ouvrirModaleSupprimer = (item: any) => {
|
|
221
|
+
itemSelectionne.value = item
|
|
222
|
+
|
|
223
|
+
//modaleSupprimer.value?.ouvrir()
|
|
224
|
+
emit('supprimer', itemSelectionne.value)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const supprimer = () => {
|
|
228
|
+
emit('supprimer', itemSelectionne.value)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const recherche = ref<string>('')
|
|
232
|
+
const chargerRecherche = (val: string) => {
|
|
233
|
+
recherche.value = val
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const ajouter = () => {
|
|
237
|
+
emit('ajouter')
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
241
|
+
const cliqueLigne = (e: Event, { item }: { item: any }) => {
|
|
242
|
+
emit('cliqueLigne', item)
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const modifier = (item: any) => {
|
|
246
|
+
emit('modifier', item)
|
|
247
|
+
}
|
|
248
|
+
const filteredItems = computed(() => {
|
|
249
|
+
if (!recherche.value) return props.liste // Si rien écrit, affiche tout
|
|
250
|
+
|
|
251
|
+
return props.liste.filter(item =>
|
|
252
|
+
Object.values(item).some(val => String(val).toLowerCase().includes(recherche.value.toLowerCase())),
|
|
253
|
+
)
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
const triDepart = computed<SortItem[] | undefined>(() => {
|
|
257
|
+
if (props.triParDepart == null) return undefined
|
|
258
|
+
|
|
259
|
+
const ordre = props.triDescDepart ? 'desc' : 'asc'
|
|
260
|
+
|
|
261
|
+
if (typeof props.triParDepart === 'string') return [{ key: props.triParDepart, order: ordre }]
|
|
262
|
+
|
|
263
|
+
//On a un tableau de tri
|
|
264
|
+
let retour: SortItem[] = []
|
|
265
|
+
for (let i = 0; i < props.triParDepart.length; i += 1) {
|
|
266
|
+
const tri = props.triParDepart[i]!
|
|
267
|
+
if (typeof tri == 'string') retour.push({ key: tri, order: ordre })
|
|
268
|
+
else retour.push(tri) //C'est un SortItem déjà bâti
|
|
269
|
+
}
|
|
270
|
+
return retour
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
const estMultiTriActif = computed(() => {
|
|
274
|
+
if (props.triParDepart == null) return false
|
|
275
|
+
|
|
276
|
+
if (typeof props.triParDepart === 'string') return false
|
|
277
|
+
|
|
278
|
+
return true
|
|
279
|
+
})
|
|
280
|
+
|
|
281
|
+
const onPanelChange = (val: boolean) => {
|
|
282
|
+
emit('panneau:etat', val)
|
|
283
|
+
}
|
|
284
|
+
const emit = defineEmits(['ajouter', 'cliqueLigne', 'supprimer', 'modifier', 'donneesExportees', 'panneau:etat'])
|
|
285
|
+
</script>
|
|
286
|
+
|
|
287
|
+
<style scoped lang="css">
|
|
288
|
+
.ControlesDatatable {
|
|
289
|
+
gap: 4px;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/* barre de recherche design QC*/
|
|
293
|
+
.BarreRecherche {
|
|
294
|
+
min-height: 40px;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.BarreRechercheBackIcone {
|
|
298
|
+
border-right: 1px solid #808a9d;
|
|
299
|
+
border-top: 1px solid #808a9d;
|
|
300
|
+
border-bottom: 1px solid #808a9d;
|
|
301
|
+
background-color: #095797 !important;
|
|
302
|
+
height: 40px !important;
|
|
303
|
+
width: 40px !important;
|
|
304
|
+
max-width: 40px !important;
|
|
305
|
+
min-width: 40px !important;
|
|
306
|
+
padding-right: 0 !important;
|
|
307
|
+
padding-left: 0 !important;
|
|
308
|
+
border-radius: 0;
|
|
309
|
+
margin-left: -16px;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* icone loupe */
|
|
313
|
+
.BarreRechercheIcone {
|
|
314
|
+
font-size: 34px !important;
|
|
315
|
+
margin-left: 1px !important;
|
|
316
|
+
margin-top: 2px !important;
|
|
317
|
+
color: white !important;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* datatable contour */
|
|
321
|
+
.v-data-table {
|
|
322
|
+
border: 1px solid #d3d3d3;
|
|
323
|
+
border-radius: 5px;
|
|
324
|
+
overflow: hidden;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/* hover */
|
|
328
|
+
.v-data-table:hover {
|
|
329
|
+
cursor: pointer !important;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/* datatable row */
|
|
333
|
+
.v-data-table .v-table__wrapper > table > thead > tr > td,
|
|
334
|
+
.v-data-table .v-table__wrapper > table > thead > tr th,
|
|
335
|
+
.v-data-table .v-table__wrapper > table tbody > tr > td,
|
|
336
|
+
.v-data-table .v-table__wrapper > table tbody > tr th {
|
|
337
|
+
background-color: #d3d3d375 !important;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/* datatable header contour */
|
|
341
|
+
.v-data-table .v-table__wrapper > table > thead > tr > th,
|
|
342
|
+
.v-data-table .v-table__wrapper > table tbody > tr > th {
|
|
343
|
+
background-color: white !important;
|
|
344
|
+
border-bottom: 4px #223654 solid !important;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/* datatable header intérieur*/
|
|
348
|
+
.v-data-table-header__content {
|
|
349
|
+
background-color: white !important;
|
|
350
|
+
color: #223654 !important;
|
|
351
|
+
font-weight: 600;
|
|
352
|
+
font-size: 15px;
|
|
353
|
+
height: 46px;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/* datatable footer */
|
|
357
|
+
.v-data-table-footer {
|
|
358
|
+
background-color: white !important;
|
|
359
|
+
border-top: 4px #223654 solid !important;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/* datatable row hover */
|
|
363
|
+
.v-data-table .v-table__wrapper > table tbody > tr:hover > td,
|
|
364
|
+
.v-data-table .v-table__wrapper > table tbody > tr:hover {
|
|
365
|
+
background-color: #e0e0e0 !important;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.iconeSupprimer:hover {
|
|
369
|
+
color: red;
|
|
370
|
+
}
|
|
371
|
+
.v-icon.v-icon.v-icon--link.iconeSupprimer:hover {
|
|
372
|
+
color: red !important;
|
|
373
|
+
}
|
|
374
|
+
.iconeEditer:hover {
|
|
375
|
+
color: #095797;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/* hover icone à droite du ajouter*/
|
|
379
|
+
.text-grisMoyen:hover {
|
|
380
|
+
color: #095797 !important;
|
|
381
|
+
}
|
|
382
|
+
</style>
|