codevdesign 1.0.31 → 1.0.33
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/assets/csqc.css +259 -0
- package/composants/csqcAide.vue +55 -0
- package/composants/csqcAlerteErreur.vue +87 -0
- package/composants/csqcChaise/chaiseConteneur.vue +367 -0
- package/composants/csqcChaise/chaiseItem.vue +54 -0
- package/composants/csqcCodeBudgetaireGenerique.vue +336 -0
- package/composants/csqcConfirmation.vue +75 -0
- package/composants/csqcDate.vue +57 -0
- package/composants/csqcDialogue.vue +118 -0
- package/composants/csqcEditeurTexteRiche.vue +380 -0
- package/composants/csqcEntete.vue +163 -0
- package/composants/csqcImportCSV.vue +125 -0
- package/composants/csqcModaleSaisie.vue +95 -0
- package/composants/csqcOptionSwitch.vue +120 -0
- package/composants/csqcRecherche.vue +213 -0
- package/composants/csqcRechercheUtilisateur.vue +197 -0
- package/composants/csqcSnackbar.vue +88 -0
- package/composants/csqcTable/csqcTable.vue +383 -0
- package/composants/csqcTable/csqcTableExportExcel.vue +58 -0
- package/composants/csqcTable/csqcTableModaleChoixColonnes.vue +586 -0
- package/composants/csqcTexteBilingue.vue +175 -0
- package/composants/csqcTiroir.vue +156 -0
- package/composants/gabarit/csqcMenu.vue +281 -0
- package/composants/gabarit/pivEntete.vue +205 -0
- package/composants/gabarit/pivPiedPage.vue +70 -0
- package/composants/gabarit/vueDefault.vue +5 -0
- package/composants/validateurs.ts +183 -0
- package/enums/choixLangue.ts +10 -0
- package/index.ts +74 -0
- package/locales/en.json +100 -0
- package/locales/fr.json +101 -0
- package/modeles/apiReponse.ts +12 -0
- package/modeles/assurancesAssuranceGeneraleGrics.ts +10 -0
- package/modeles/assurancesAssurancePersonnelleGrics.ts +13 -0
- package/modeles/assurancesContratGrics.ts +14 -0
- package/modeles/assurancesDetailsPrimeReguliereGrics.ts +12 -0
- package/modeles/assurancesDonneesAssureurGrics.ts +13 -0
- package/modeles/assurancesEmployeGrics.ts +11 -0
- package/modeles/assurancesGrics.ts +14 -0
- package/modeles/assurancesRegimeAssuranceGrics.ts +9 -0
- package/modeles/assurancesRegimeBaseEmployeurGrics.ts +9 -0
- package/modeles/assurancesRegimeBaseGrics.ts +9 -0
- package/modeles/composants/csqcMenuModele.ts +18 -0
- package/modeles/composants/datatableColonne.ts +31 -0
- package/modeles/composants/snackbar.ts +18 -0
- package/modeles/data.ts +24 -0
- package/modeles/droitIntervention.ts +14 -0
- package/modeles/employeAdresseGrics.ts +13 -0
- package/modeles/employeAdressesPersonnellesGrics.ts +12 -0
- package/modeles/employeAffectationCorpsEmploiGrics.ts +9 -0
- package/modeles/employeBanquesCongeBanqueGrics.ts +9 -0
- package/modeles/employeBanquesCongeGrics.ts +14 -0
- package/modeles/employeBanquesCongeRegimeAbsenceGrics.ts +9 -0
- package/modeles/employeCourrielsPersonnels.ts +9 -0
- package/modeles/employeCourrielsProfessionnels.ts +9 -0
- package/modeles/employeEmploisCategorieGrics.ts +9 -0
- package/modeles/employeEmploisClasseGrics.ts +9 -0
- package/modeles/employeEmploisCorpsEmploiGrics.ts +9 -0
- package/modeles/employeEmploisEtatEmploiGrics.ts +9 -0
- package/modeles/employeEmploisGrics.ts +37 -0
- package/modeles/employeEmploisGroupePaieGrics.ts +9 -0
- package/modeles/employeEmploisLieuTravailPrincipalGrics.ts +10 -0
- package/modeles/employeEmploisLieuxTravailSecondairesGrics.ts +10 -0
- package/modeles/employeEmploisRegimeAbsenceGrics.ts +9 -0
- package/modeles/employeEmploisSecteurGrics.ts +9 -0
- package/modeles/employeEmploisStatutEngagementGrics.ts +9 -0
- package/modeles/employeExperienceEmploiGrics.ts +9 -0
- package/modeles/employeExperienceEmployeGrics.ts +12 -0
- package/modeles/employeExperienceExperiencesGrics.ts +11 -0
- package/modeles/employeExperienceExperiencesTotalesGrics.ts +15 -0
- package/modeles/employeExperienceGrics.ts +17 -0
- package/modeles/employeGrics.ts +31 -0
- package/modeles/employeMinsLsCodev.ts +10 -0
- package/modeles/employeTelephoneGrics.ts +12 -0
- package/modeles/employeTelephonesPersonnelsGrics.ts +11 -0
- package/modeles/employeTelephonesProfessionnelsGrics.ts +11 -0
- package/modeles/groupeCE.ts +14 -0
- package/modeles/groupeCEIntervalle.ts +13 -0
- package/modeles/historiquesAbsenceBanqueGrics.ts +9 -0
- package/modeles/historiquesAbsenceGrics.ts +21 -0
- package/modeles/historiquesAbsenceLieuTravailGrics.ts +9 -0
- package/modeles/historiquesAbsenceSousBanqueGrics.ts +9 -0
- package/modeles/intervention.ts +35 -0
- package/modeles/motifsAbsenceBanque.ts +9 -0
- package/modeles/motifsAbsenceGrics.ts +17 -0
- package/modeles/motifsAbsenceRegimeAbsence.ts +9 -0
- package/modeles/motifsAbsenceSousMotifs.ts +9 -0
- package/modeles/motifsAbsenceTraitementBanques.ts +11 -0
- package/modeles/notificationGabaritDefaut.ts +10 -0
- package/modeles/response.ts +12 -0
- package/modeles/role.ts +31 -0
- package/modeles/roleMin.ts +12 -0
- package/modeles/syndicat.ts +26 -0
- package/modeles/syndicatGroupeCe.ts +10 -0
- package/modeles/syndicatResponsable.ts +15 -0
- package/modeles/syndicatUnite.ts +10 -0
- package/modeles/typeEnseignement.ts +14 -0
- package/modeles/typeTelephone.ts +12 -0
- package/modeles/unite.ts +23 -0
- package/modeles/uniteTypeEnseignement.ts +12 -0
- package/modeles/utilisateur.ts +15 -0
- package/outils/appAxios.ts +116 -0
- package/outils/csqcOutils.ts +366 -0
- package/outils/rafraichisseurToken.ts +187 -0
- package/package.json +11 -15
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { EmployeExperienceEmployeGrics } from "./employeExperienceEmployeGrics";
|
|
7
|
+
import type { EmployeExperienceExperiencesTotalesGrics } from "./employeExperienceExperiencesTotalesGrics";
|
|
8
|
+
|
|
9
|
+
export interface EmployeExperienceGrics {
|
|
10
|
+
employe: EmployeExperienceEmployeGrics;
|
|
11
|
+
experiencesTotales: EmployeExperienceExperiencesTotalesGrics[];
|
|
12
|
+
dateConsignee: string;
|
|
13
|
+
dateCalculPonctuel: string;
|
|
14
|
+
dateCalculAnnuel: string;
|
|
15
|
+
dateDebutCongeMaternite: string;
|
|
16
|
+
nombreSemainesAccordées: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { EmployeAdressesPersonnellesGrics } from "./employeAdressesPersonnellesGrics";
|
|
7
|
+
import type { EmployeTelephonesPersonnelsGrics } from "./employeTelephonesPersonnelsGrics";
|
|
8
|
+
import type { EmployeTelephonesProfessionnelsGrics } from "./employeTelephonesProfessionnelsGrics";
|
|
9
|
+
import type { EmployeCourrielsPersonnels } from "./employeCourrielsPersonnels";
|
|
10
|
+
import type { EmployeCourrielsProfessionnels } from "./employeCourrielsProfessionnels";
|
|
11
|
+
import type { EmployeEmploisGrics } from "./employeEmploisGrics";
|
|
12
|
+
|
|
13
|
+
export interface EmployeGrics {
|
|
14
|
+
id: string;
|
|
15
|
+
nom: string;
|
|
16
|
+
prenom: string;
|
|
17
|
+
adressesPersonnelles: EmployeAdressesPersonnellesGrics[];
|
|
18
|
+
telephonesPersonnels: EmployeTelephonesPersonnelsGrics[];
|
|
19
|
+
telephonesProfessionnels: EmployeTelephonesProfessionnelsGrics[];
|
|
20
|
+
courrielsPersonnels: EmployeCourrielsPersonnels[];
|
|
21
|
+
courrielsProfessionnels: EmployeCourrielsProfessionnels[];
|
|
22
|
+
sexe: string;
|
|
23
|
+
dateNaissance: string;
|
|
24
|
+
dateEntree: string;
|
|
25
|
+
dateEngagement: string;
|
|
26
|
+
dateFinPeriodeEssai: string;
|
|
27
|
+
dateCessationDefinitive: string;
|
|
28
|
+
dateDebutServiceContinu: string;
|
|
29
|
+
dateFinServiceContinu: string;
|
|
30
|
+
emploiPrincipal: EmployeEmploisGrics;
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { TypeTelephone } from "./typeTelephone";
|
|
7
|
+
|
|
8
|
+
export interface EmployeTelephoneGrics {
|
|
9
|
+
numero: string;
|
|
10
|
+
poste: string;
|
|
11
|
+
typeTelephone: TypeTelephone;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { EmployeTelephoneGrics } from "./employeTelephoneGrics";
|
|
7
|
+
|
|
8
|
+
export interface EmployeTelephonesPersonnelsGrics {
|
|
9
|
+
description: string;
|
|
10
|
+
telephone: EmployeTelephoneGrics;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { EmployeTelephoneGrics } from "./employeTelephoneGrics";
|
|
7
|
+
|
|
8
|
+
export interface EmployeTelephonesProfessionnelsGrics {
|
|
9
|
+
description: string;
|
|
10
|
+
telephone: EmployeTelephoneGrics;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { GroupeCEIntervalle } from "./groupeCEIntervalle";
|
|
7
|
+
|
|
8
|
+
export interface GroupeCE {
|
|
9
|
+
id: number;
|
|
10
|
+
commissionScolaireId: number;
|
|
11
|
+
nom: string;
|
|
12
|
+
groupeCEIntervalles: GroupeCEIntervalle[];
|
|
13
|
+
parentId: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface GroupeCEIntervalle {
|
|
7
|
+
id: number;
|
|
8
|
+
corpsEmploiMin: string;
|
|
9
|
+
corpsEmploiMax: string;
|
|
10
|
+
groupeCEId: number;
|
|
11
|
+
min: number;
|
|
12
|
+
max: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { HistoriquesAbsenceLieuTravailGrics } from "./historiquesAbsenceLieuTravailGrics";
|
|
7
|
+
import type { HistoriquesAbsenceBanqueGrics } from "./historiquesAbsenceBanqueGrics";
|
|
8
|
+
import type { HistoriquesAbsenceSousBanqueGrics } from "./historiquesAbsenceSousBanqueGrics";
|
|
9
|
+
|
|
10
|
+
export interface HistoriquesAbsenceGrics {
|
|
11
|
+
id: number;
|
|
12
|
+
idMotifAbsence: string;
|
|
13
|
+
date: string;
|
|
14
|
+
heureFin: string;
|
|
15
|
+
heureDebut: string;
|
|
16
|
+
duree: number;
|
|
17
|
+
idEmploi: string;
|
|
18
|
+
lieuTravail: HistoriquesAbsenceLieuTravailGrics;
|
|
19
|
+
banque: HistoriquesAbsenceBanqueGrics;
|
|
20
|
+
sousBanque: HistoriquesAbsenceSousBanqueGrics;
|
|
21
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
class Intervention {
|
|
2
|
+
id: number
|
|
3
|
+
demandeId: number
|
|
4
|
+
uniteId: number
|
|
5
|
+
chaiseId?: number
|
|
6
|
+
niveauChaise?: number
|
|
7
|
+
typeIntervenant: number
|
|
8
|
+
utilisateurIdAyantIntervenu?: number
|
|
9
|
+
dateIntervention?: Date
|
|
10
|
+
etat: number
|
|
11
|
+
|
|
12
|
+
constructor(
|
|
13
|
+
id: number = 0,
|
|
14
|
+
demandeId: number = 0,
|
|
15
|
+
uniteId: number = 0,
|
|
16
|
+
typeIntervenant: number = 0,
|
|
17
|
+
etat: number = 0,
|
|
18
|
+
chaiseId?: number,
|
|
19
|
+
niveauChaise?: number,
|
|
20
|
+
utilisateurIdAyantIntervenu?: number,
|
|
21
|
+
dateIntervention?: Date,
|
|
22
|
+
) {
|
|
23
|
+
this.id = id
|
|
24
|
+
this.demandeId = demandeId
|
|
25
|
+
this.uniteId = uniteId
|
|
26
|
+
this.typeIntervenant = typeIntervenant
|
|
27
|
+
this.etat = etat
|
|
28
|
+
this.chaiseId = chaiseId
|
|
29
|
+
this.niveauChaise = niveauChaise
|
|
30
|
+
this.utilisateurIdAyantIntervenu = utilisateurIdAyantIntervenu
|
|
31
|
+
this.dateIntervention = dateIntervention
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default Intervention
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { MotifsAbsenceRegimeAbsence } from "./motifsAbsenceRegimeAbsence";
|
|
7
|
+
import type { MotifsAbsenceSousMotifs } from "./motifsAbsenceSousMotifs";
|
|
8
|
+
import type { MotifsAbsenceTraitementBanques } from "./motifsAbsenceTraitementBanques";
|
|
9
|
+
|
|
10
|
+
export interface MotifsAbsenceGrics {
|
|
11
|
+
id: string;
|
|
12
|
+
description: string;
|
|
13
|
+
actif: boolean;
|
|
14
|
+
regimeAbsence: MotifsAbsenceRegimeAbsence;
|
|
15
|
+
sousMotifs: MotifsAbsenceSousMotifs[];
|
|
16
|
+
traitementBanques: MotifsAbsenceTraitementBanques[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { MotifsAbsenceBanque } from "./motifsAbsenceBanque";
|
|
7
|
+
|
|
8
|
+
export interface MotifsAbsenceTraitementBanques {
|
|
9
|
+
ordreTraitement: string;
|
|
10
|
+
banque: MotifsAbsenceBanque;
|
|
11
|
+
}
|
package/modeles/role.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import RoleMin from './roleMin'
|
|
2
|
+
|
|
3
|
+
class Role extends RoleMin {
|
|
4
|
+
ordreAffichage: number
|
|
5
|
+
descriptionEn: string
|
|
6
|
+
descriptionFr: string
|
|
7
|
+
nomFr: string
|
|
8
|
+
nomEn: string
|
|
9
|
+
utilisateursId: string[]
|
|
10
|
+
constructor(
|
|
11
|
+
descriptionEn: string = '',
|
|
12
|
+
ordreAffichage: number = 0,
|
|
13
|
+
descriptionFr: string = '',
|
|
14
|
+
nomFr: string = '',
|
|
15
|
+
nomEn: string = '',
|
|
16
|
+
utilisateursId: string[] = [],
|
|
17
|
+
identifiant: string = '',
|
|
18
|
+
id: number = 0,
|
|
19
|
+
formulaireId: number = 0,
|
|
20
|
+
) {
|
|
21
|
+
super(identifiant, id, formulaireId) // Appel au constructeur de la classe parente
|
|
22
|
+
this.descriptionEn = descriptionEn
|
|
23
|
+
this.ordreAffichage = ordreAffichage
|
|
24
|
+
this.descriptionFr = descriptionFr
|
|
25
|
+
this.nomFr = nomFr
|
|
26
|
+
this.nomEn = nomEn
|
|
27
|
+
this.utilisateursId = utilisateursId
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default Role
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
class RoleMin {
|
|
2
|
+
identifiant: string
|
|
3
|
+
formulaireId?: number
|
|
4
|
+
id: number
|
|
5
|
+
constructor(identifiant: string = '', id: number = 0, formulaireId: number = 0) {
|
|
6
|
+
this.id = id
|
|
7
|
+
this.identifiant = identifiant
|
|
8
|
+
this.formulaireId = formulaireId
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default RoleMin
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { SyndicatGroupeCe } from "./syndicatGroupeCe";
|
|
7
|
+
import type { SyndicatResponsable } from "./syndicatResponsable";
|
|
8
|
+
import type { SyndicatUnite } from "./syndicatUnite";
|
|
9
|
+
|
|
10
|
+
export interface Syndicat {
|
|
11
|
+
id: number;
|
|
12
|
+
cSSId: number;
|
|
13
|
+
nom: string;
|
|
14
|
+
description: string;
|
|
15
|
+
estActif: boolean;
|
|
16
|
+
courriel: string;
|
|
17
|
+
adresse: string;
|
|
18
|
+
local: string;
|
|
19
|
+
telephone: string;
|
|
20
|
+
lienSiteWeb: string;
|
|
21
|
+
lienConventionCollective: string;
|
|
22
|
+
lienPlanClassification: string;
|
|
23
|
+
syndicatGroupeCEs: SyndicatGroupeCe[];
|
|
24
|
+
responsables: SyndicatResponsable[];
|
|
25
|
+
unites: SyndicatUnite[];
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface SyndicatResponsable {
|
|
7
|
+
id: number;
|
|
8
|
+
nom: string;
|
|
9
|
+
prenom: string;
|
|
10
|
+
courriel: string;
|
|
11
|
+
responsablePrincipal: boolean;
|
|
12
|
+
syndicatId: number;
|
|
13
|
+
utilisateurId: number;
|
|
14
|
+
poste: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export enum TypeEnseignement {
|
|
7
|
+
Prescolaire4ans = 0,
|
|
8
|
+
Prescolaire5ans = 1,
|
|
9
|
+
Primaire = 2,
|
|
10
|
+
Secondaire = 3,
|
|
11
|
+
FP = 4,
|
|
12
|
+
FGA = 5,
|
|
13
|
+
ServiceAdmin = 6,
|
|
14
|
+
}
|
package/modeles/unite.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { UniteTypeEnseignement } from "./uniteTypeEnseignement";
|
|
7
|
+
|
|
8
|
+
export interface Unite {
|
|
9
|
+
id: number;
|
|
10
|
+
numero: string;
|
|
11
|
+
nom: string;
|
|
12
|
+
numeroEcoleJeune: string;
|
|
13
|
+
numeroCentreAdulte: string;
|
|
14
|
+
estActif: boolean;
|
|
15
|
+
typesEnseignementUnite: UniteTypeEnseignement[];
|
|
16
|
+
commissionScolaireId: number;
|
|
17
|
+
numeroNom: string;
|
|
18
|
+
nomNumero: string;
|
|
19
|
+
numeroEcoleJeuneStr: string;
|
|
20
|
+
numeroCentreAdulteStr: string;
|
|
21
|
+
estJeune: boolean;
|
|
22
|
+
estAdulte: boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { TypeEnseignement } from "./typeEnseignement";
|
|
7
|
+
|
|
8
|
+
export interface UniteTypeEnseignement {
|
|
9
|
+
id: number;
|
|
10
|
+
typeEnseignement: TypeEnseignement;
|
|
11
|
+
uniteId: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a TypeGen auto-generated file.
|
|
3
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface Utilisateur {
|
|
7
|
+
id: number;
|
|
8
|
+
identifiant: string;
|
|
9
|
+
nom: string;
|
|
10
|
+
prenom: string;
|
|
11
|
+
courriel: string;
|
|
12
|
+
matricule: string;
|
|
13
|
+
commissionScolaireId: number;
|
|
14
|
+
langue: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import axios, { type AxiosInstance, type AxiosError, type AxiosResponse } from 'axios'
|
|
2
|
+
import { useAppStore } from '@/store/appStore'
|
|
3
|
+
import router from '@/router'
|
|
4
|
+
|
|
5
|
+
type ApiReponse<T = unknown> =
|
|
6
|
+
// Succès
|
|
7
|
+
| {
|
|
8
|
+
succes: true
|
|
9
|
+
resultat: T
|
|
10
|
+
status?: number
|
|
11
|
+
message?: string
|
|
12
|
+
location?: string
|
|
13
|
+
parametres?: unknown
|
|
14
|
+
[k: string]: unknown
|
|
15
|
+
}
|
|
16
|
+
// Échec (le backend peut quand même renvoyer resultat null/absent)
|
|
17
|
+
| {
|
|
18
|
+
succes: false
|
|
19
|
+
resultat?: unknown
|
|
20
|
+
status?: number
|
|
21
|
+
message?: string
|
|
22
|
+
location?: string
|
|
23
|
+
parametres?: unknown
|
|
24
|
+
[k: string]: unknown
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let client: AxiosInstance | null = null
|
|
28
|
+
let cachedBaseUrl = '' // pour éviter de régénérer une instance axios si rien n’a changé
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
clearCache: false,
|
|
32
|
+
|
|
33
|
+
getAxios(): AxiosInstance {
|
|
34
|
+
// Singleton + clearCache
|
|
35
|
+
if (client && !this.clearCache) return client
|
|
36
|
+
|
|
37
|
+
const appStore = useAppStore()
|
|
38
|
+
|
|
39
|
+
const rawUrl = appStore.modeleCharger
|
|
40
|
+
? appStore.appModele!.urlBase
|
|
41
|
+
: window.location.origin + import.meta.env.BASE_URL
|
|
42
|
+
|
|
43
|
+
const urlBase = rawUrl.endsWith('/') ? rawUrl.slice(0, -1) : rawUrl
|
|
44
|
+
|
|
45
|
+
// Si la base URL n'a pas changé et qu'on a déjà un client, on le renvoie
|
|
46
|
+
if (client && cachedBaseUrl === urlBase && !this.clearCache) return client
|
|
47
|
+
cachedBaseUrl = urlBase
|
|
48
|
+
|
|
49
|
+
client = axios.create({
|
|
50
|
+
baseURL: `${urlBase}/api`,
|
|
51
|
+
withCredentials: true,
|
|
52
|
+
timeout: 30_000,
|
|
53
|
+
headers: {
|
|
54
|
+
Accept: 'application/json',
|
|
55
|
+
'Content-Type': 'application/json',
|
|
56
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
57
|
+
},
|
|
58
|
+
// validateStatus: (s) => s >= 200 && s < 300, // défaut axios
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
client.interceptors.response.use(
|
|
62
|
+
(response: AxiosResponse<any>) => {
|
|
63
|
+
const data = response.data
|
|
64
|
+
|
|
65
|
+
// Détection de la réponse { succes, resultat }
|
|
66
|
+
if (data && typeof data === 'object' && 'succes' in data) {
|
|
67
|
+
const env = data as ApiReponse
|
|
68
|
+
return env.succes === true ? env.resultat : Promise.reject(env)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Sinon, renvoyer data si présent, sinon la réponse complète
|
|
72
|
+
return data ?? response
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
(error: AxiosError<any>) => {
|
|
76
|
+
const status = error.response?.status
|
|
77
|
+
const payload = error.response?.data?.resultat ?? { message: error.message }
|
|
78
|
+
|
|
79
|
+
// 403 / 404
|
|
80
|
+
if (status === 403 || status === 404) {
|
|
81
|
+
try {
|
|
82
|
+
appStore.lancerErreur(payload)
|
|
83
|
+
if (router.currentRoute.value.name !== '403') {
|
|
84
|
+
router.push({ name: '403' })
|
|
85
|
+
}
|
|
86
|
+
} catch {
|
|
87
|
+
// no-op
|
|
88
|
+
}
|
|
89
|
+
return Promise.reject(payload)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// gérer les autres 4XX ici
|
|
93
|
+
|
|
94
|
+
// Log minimal
|
|
95
|
+
console.error('HTTP error', {
|
|
96
|
+
status,
|
|
97
|
+
url: error.config?.url,
|
|
98
|
+
payload,
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
// Remonter l’erreur normalisée dans appstore
|
|
102
|
+
try {
|
|
103
|
+
if (payload?.resultat) appStore.lancerErreur(payload)
|
|
104
|
+
else if (payload) appStore.lancerErreur(payload)
|
|
105
|
+
} catch {
|
|
106
|
+
// no-op
|
|
107
|
+
}
|
|
108
|
+
return Promise.reject(payload)
|
|
109
|
+
},
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
// reset le flag si on l’avait utilisé pour forcer la recréation de l'instance
|
|
113
|
+
this.clearCache = false
|
|
114
|
+
return client
|
|
115
|
+
},
|
|
116
|
+
}
|