Skip to content

Commit

Permalink
Merge pull request #169 from abes-esr/ITEM-356-front-ajouter-la-colon…
Browse files Browse the repository at this point in the history
…ne-pour-afficher-nb-exemplaire

- Adaptation des tableaux
  • Loading branch information
EryneKL authored Nov 13, 2024
2 parents 2164573 + 435bfe7 commit cd169f2
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 12 deletions.
12 changes: 5 additions & 7 deletions src/service/ItemService.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class ItemService {

login(login, password) {
const url = import.meta.env.VITE_API_URL + `signin`;
console.info('appel:' + url);
//console.info('appel:' + url);

return this.client.post(`signin`, {username: login, password: password})
.then((response) => {
Expand Down Expand Up @@ -56,27 +56,26 @@ export class ItemService {
}

fetchDemandes(type, archive, extensionIln) {
console.info('appel: ' + import.meta.env.VITE_API_URL + `demandes/${type}?archive=${archive}&extension=${extensionIln}`)
//console.info('appel: ' + import.meta.env.VITE_API_URL + `demandes/${type}?archive=${archive}&extension=${extensionIln}`)
return this.client.get(`demandes/${type}?archive=${archive}&extension=${extensionIln}`)
}
archiverDemande(type, numDemande) {
const url = `archiverDemande/${type}/${numDemande}`;
console.info('appel: ' + import.meta.env.VITE_API_URL + url);
//console.info('appel: ' + import.meta.env.VITE_API_URL + url);
return this.client.get(url);
}

checkToken(){
const url = `checkToken`;
console.info('appel: ' + import.meta.env.VITE_API_URL + url);
//console.info('appel: ' + import.meta.env.VITE_API_URL + url);
return this.client.get(url)
}

//TODO MAJ STORE
modifierEmail(id, email){
const config = { headers: {'Content-Type': 'text/plain'} };
return this.client.patch(`utilisateurs/${id}`, email, config);
}
//TODO MAJ STORE

creerEmail(id, email){
const config = { headers: {'Content-Type': 'text/plain'} };
return this.client.post(`utilisateurs/${id}`, email, config);
Expand Down Expand Up @@ -165,7 +164,6 @@ export class ItemService {

async getHealthOfServices(){
return this.client.get('applicationStatutServices').then(response => {
console.log(response.data)
return response.data
})
}
Expand Down
17 changes: 15 additions & 2 deletions src/views/Exemplarisation/ExempTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<v-text-field v-model="numDemandeSearchField" hide-details @input="filterItems"
variant="underlined" append-inner-icon="mdi-magnify"></v-text-field>
</td>
<td>
<v-text-field v-model="nbExemplairesSearchField" hide-details @input="filterItems"
variant="underlined" append-inner-icon="mdi-magnify"></v-text-field>
</td>
<td>
<v-text-field v-model="dateCreationSearchField" hide-details @input="filterItems"
variant="underlined" append-inner-icon="mdi-magnify"></v-text-field>
Expand Down Expand Up @@ -83,6 +87,7 @@
</v-btn>
</td>
<td @click="onRowClick(item)" class="text-center">{{ item.id }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.nbExemplaires }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.dateCreation }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.dateModification }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.iln }}</td>
Expand Down Expand Up @@ -155,6 +160,12 @@ const headingsDemandes = [
align: 'center',
display: true,
},
{
title: 'Nb d\'exemplaires',
key: 'nbExemplaires',
align: 'center',
display: true,
},
{
title: 'Crée le',
key: 'dateCreation',
Expand Down Expand Up @@ -264,6 +275,7 @@ const sortBy = ref([{
const isDataLoaded = ref(false);
//Search fields columns
const numDemandeSearchField = ref('');
const nbExemplairesSearchField = ref('');
const dateCreationSearchField = ref('');
const dateModificationSearchField = ref('');
const ilnSearchField = ref('');
Expand Down Expand Up @@ -318,7 +330,6 @@ async function loadItems(type, archive) {
...item,
expanded: false
}));
isDataLoaded.value = true;
emit('backendSuccess');
} catch (error) {
Expand All @@ -331,6 +342,8 @@ function filterItems() {
contentsDemandesFrontFiltered.value = contentsDemandesFromServer.value.filter(demande => {
const matchesNumDemande = numDemandeSearchField.value === '' || demande.id.toString()
.includes(numDemandeSearchField.value);
const matchesNbExemplaires = nbExemplairesSearchField.value === '' || demande.nbExemplaires.toString()
.includes(nbExemplairesSearchField.value);
const matchesDateCreation = dateCreationSearchField.value === '' || demande.dateCreation.toString()
.includes(dateCreationSearchField.value);
const matchesDateModification = dateModificationSearchField.value === '' || demande.dateModification.toString()
Expand All @@ -343,7 +356,7 @@ function filterItems() {
const matchesIndexSearch = indexRechercheSearchField.value === '' || demande.indexRecherche && demande.indexRecherche.includes(indexRechercheSearchField.value);
const matchesEtatDemande = statutSearchField.value === undefined || statutSearchField.value === null || statutSearchField.value === '' || demande.etatDemande.toString()
.includes(statutSearchField.value) || ((statutSearchField.value === 'En saisie') && (demande.etatDemande === 'En simulation' || demande.etatDemande === 'En préparation' || demande.etatDemande === 'A compléter'));
return matchesNumDemande && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesTypeExemp && matchesIndexSearch && matchesEtatDemande;
return matchesNumDemande && matchesNbExemplaires && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesTypeExemp && matchesIndexSearch && matchesEtatDemande;
});
}
Expand Down
16 changes: 15 additions & 1 deletion src/views/Modification/ModifTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<v-text-field v-model="numDemandeSearchField" hide-details @input="filterItems"
variant="underlined" append-inner-icon="mdi-magnify"></v-text-field>
</td>
<td>
<v-text-field v-model="nbExemplairesSearchField" hide-details @input="filterItems"
variant="underlined" append-inner-icon="mdi-magnify"></v-text-field>
</td>
<td>
<v-text-field v-model="dateCreationSearchField" hide-details @input="filterItems"
variant="underlined" append-inner-icon="mdi-magnify"></v-text-field>
Expand Down Expand Up @@ -83,6 +87,7 @@
</v-btn>
</td>
<td @click="onRowClick(item)" class="text-center">{{ item.id }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.nbExemplaires }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.dateCreation }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.dateModification }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.iln }}</td>
Expand Down Expand Up @@ -153,6 +158,12 @@ const headingsDemandes = [
align: 'center',
display: true,
},
{
title: 'Nb d\'exemplaires',
key: 'nbExemplaires',
align: 'center',
display: true,
},
{
title: 'Crée le',
key: 'dateCreation',
Expand Down Expand Up @@ -262,6 +273,7 @@ const isDataLoaded = ref(false);
//Search fields columns
const numDemandeSearchField = ref('');
const nbExemplairesSearchField = ref('');
const dateCreationSearchField = ref('');
const dateModificationSearchField = ref('');
const ilnSearchField = ref('');
Expand Down Expand Up @@ -330,6 +342,8 @@ function filterItems() {
contentsDemandesFrontFiltered.value = contentsDemandesFromServer.value.filter(demande => {
const matchesNumDemande = numDemandeSearchField.value === '' || demande.id.toString()
.includes(numDemandeSearchField.value);
const matchesNbExemplaires = nbExemplairesSearchField.value === '' || demande.nbExemplaires.toString()
.includes(nbExemplairesSearchField.value);
const matchesDateCreation = dateCreationSearchField.value === '' || demande.dateCreation.toString()
.includes(dateCreationSearchField.value);
const matchesDateModification = dateModificationSearchField.value === '' || demande.dateModification.toString()
Expand All @@ -342,7 +356,7 @@ function filterItems() {
const matchesTraitement = traitementSearchField.value === undefined || traitementSearchField.value === null || traitementSearchField.value === '' || (demande.traitement && demande.traitement.includes(traitementSearchField.value)) || (!demande.traitement && traitementSearchField.value === 'Non défini');
const matchesEtatDemande = statutSearchField.value === undefined || statutSearchField.value === null || statutSearchField.value === '' || demande.etatDemande.toString()
.includes(statutSearchField.value) || ((statutSearchField.value === 'En saisie') && (demande.etatDemande === 'En simulation' || demande.etatDemande === 'En préparation' || demande.etatDemande === 'Préparée' || demande.etatDemande === 'A compléter'));
return matchesNumDemande && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesZone && matchesTraitement && matchesEtatDemande;
return matchesNumDemande && matchesNbExemplaires && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesZone && matchesTraitement && matchesEtatDemande;
});
}
Expand Down
18 changes: 16 additions & 2 deletions src/views/Suppression/SuppTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<v-text-field v-model="numDemandeSearchField" hide-details @input="filterItems"
variant="underlined" append-inner-icon="mdi-magnify"></v-text-field>
</td>
<td>
<v-text-field v-model="nbExemplairesSearchField" hide-details @input="filterItems"
variant="underlined" append-inner-icon="mdi-magnify"></v-text-field>
</td>
<td>
<v-text-field v-model="dateCreationSearchField" hide-details @input="filterItems"
variant="underlined" append-inner-icon="mdi-magnify"></v-text-field>
Expand Down Expand Up @@ -70,6 +74,7 @@
</v-btn>
</td>
<td @click="onRowClick(item)" class="text-center">{{ item.id }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.nbExemplaires }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.dateCreation }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.dateModification }}</td>
<td @click="onRowClick(item)" class="text-center">{{ item.iln }}</td>
Expand Down Expand Up @@ -140,6 +145,12 @@ const headingsDemandes = [
align: 'center',
display: true,
},
{
title: 'Nb d\'exemplaires',
key: 'nbExemplaires',
align: 'center',
display: true,
},
{
title: 'Crée le',
key: 'dateCreation',
Expand Down Expand Up @@ -237,6 +248,7 @@ const isDataLoaded = ref(false);
//Search fields columns
const numDemandeSearchField = ref('');
const nbExemplairesSearchField = ref('');
const dateCreationSearchField = ref('');
const dateModificationSearchField = ref('');
const ilnSearchField = ref('');
Expand Down Expand Up @@ -290,7 +302,6 @@ async function loadItems(type, archive) {
contentsDemandesFrontFiltered.value = response.data.map((item) => ({
...item,
expanded: false,
}));
isDataLoaded.value = true;
Expand All @@ -305,6 +316,8 @@ function filterItems() {
contentsDemandesFrontFiltered.value = contentsDemandesFromServer.value.filter(demande => {
const matchesNumDemande = numDemandeSearchField.value === '' || demande.id.toString()
.includes(numDemandeSearchField.value);
const matchesNbExemplaires = nbExemplairesSearchField.value === '' || demande.nbExemplaires.toString()
.includes(nbExemplairesSearchField.value);
const matchesDateCreation = dateCreationSearchField.value === '' || demande.dateCreation.toString()
.includes(dateCreationSearchField.value);
const matchesDateModification = dateModificationSearchField.value === '' || demande.dateModification.toString()
Expand All @@ -317,7 +330,7 @@ function filterItems() {
const matchesTraitement = traitementSearchField.value === undefined || traitementSearchField.value === null || traitementSearchField.value === '' || (demande.traitement && demande.traitement.includes(traitementSearchField.value)) || (!demande.traitement && traitementSearchField.value === 'Non défini');
const matchesEtatDemande = statutSearchField.value === undefined || statutSearchField.value === null || statutSearchField.value === '' || demande.etatDemande.toString()
.includes(statutSearchField.value) || ((statutSearchField.value === 'En saisie') && (demande.etatDemande === 'En simulation' || demande.etatDemande === 'En préparation' || demande.etatDemande === 'Préparée' || demande.etatDemande === 'A compléter'));
return matchesNumDemande && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesZone && matchesTraitement && matchesEtatDemande;
return matchesNumDemande && matchesNbExemplaires && matchesDateCreation && matchesDateModification && matchesRCR && matchesILN && matchesZone && matchesTraitement && matchesEtatDemande;
});
}
Expand Down Expand Up @@ -389,6 +402,7 @@ function colorProgressBar(item) {
</script>

<style scoped>
.highlighted-row {
background-color: #f5f5f5;
}
Expand Down

0 comments on commit cd169f2

Please sign in to comment.