Skip to content

Commit

Permalink
Merge pull request #163 from abes-esr/ITEM-289-TABLEAU-DE-BORD
Browse files Browse the repository at this point in the history
Item 289 tableau de bord
  • Loading branch information
EryneKL authored Nov 4, 2024
2 parents d44e92f + 81812a4 commit 9283271
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 56 deletions.
66 changes: 44 additions & 22 deletions src/views/Exemplarisation/ExempTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<v-chip :variant="isActiveDemandesDisplayed ? 'plain' : 'tonal'" style="margin-right: 10px"
@click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Créations d'exemplaires
</v-chip>
<v-chip :variant="!isActiveDemandesDisplayed ? 'plain' : 'tonal'" @click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Créations
<v-chip :variant="!isActiveDemandesDisplayed ? 'plain' : 'tonal'"
@click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Créations
d'exemplaires archivées
</v-chip>
<v-chip variant="text">
Expand Down Expand Up @@ -102,8 +103,9 @@
<v-chip color="error" variant="flat" v-else-if="item.etatDemande === 'En erreur'">En erreur</v-chip>
</td>
<td @click="onRowClick(item)" class="text-center">
<v-progress-linear v-model="item.pourcentageProgressionTraitement" :height="18" :striped="false"
color="grey-lighten-1" style="border: 1px solid grey; font-weight: bolder">
<v-progress-linear v-model="item.pourcentageProgressionTraitement" height="18"
:color="item.pourcentageProgressionTraitement === 100 ? 'success' : 'grey-lighten-1'"
style="border: 1px solid grey; font-weight: bolder">
{{ item.pourcentageProgressionTraitement }} %
</v-progress-linear>
</td>
Expand All @@ -128,10 +130,10 @@
import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
import router from '@/router';
import DialogSuppression from '@/components/Dialog/DialogSuppression.vue';
import DialogCommentaire from "@/components/Dialog/DialogCommentaire.vue";
import DialogCommentaire from '@/components/Dialog/DialogCommentaire.vue';
import itemService from '@/service/ItemService';
import MenuDownloadFile from "@/components/MenuDownloadFile.vue";
import moment from "moment";
import MenuDownloadFile from '@/components/MenuDownloadFile.vue';
import moment from 'moment';
//Emit
const emit = defineEmits(['backendError', 'backendSuccess']);
Expand All @@ -144,17 +146,19 @@ const headingsDemandes = [
align: 'center'
},
{
title: 'Demande',
title: 'N° de Demande',
key: 'id',
align: 'center'
},
{
title: 'Crée le',
key: 'dateCreation',
align: 'center',
sort:(d1,d2) => {
const date1 = moment(d1, "DD/MM/yyyy HH:mm").valueOf();
const date2 = moment(d2, "DD/MM/yyyy HH:mm").valueOf();
sort: (d1, d2) => {
const date1 = moment(d1, 'DD/MM/yyyy HH:mm')
.valueOf();
const date2 = moment(d2, 'DD/MM/yyyy HH:mm')
.valueOf();
if (date1 > date2) return 1;
if (date1 < date2) return -1;
return 0;
Expand All @@ -164,9 +168,11 @@ const headingsDemandes = [
title: 'Mise à jour',
key: 'dateModification',
align: 'center',
sort:(d1,d2) => {
const date1 = moment(d1, "DD/MM/yyyy HH:mm").valueOf();
const date2 = moment(d2, "DD/MM/yyyy HH:mm").valueOf();
sort: (d1, d2) => {
const date1 = moment(d1, 'DD/MM/yyyy HH:mm')
.valueOf();
const date2 = moment(d2, 'DD/MM/yyyy HH:mm')
.valueOf();
if (date1 > date2) return 1;
if (date1 < date2) return -1;
return 0;
Expand Down Expand Up @@ -229,7 +235,10 @@ const contentsDemandesFrontFiltered = ref([]);
const totalItemsFound = ref(0);
const suppDialog = ref(false);
const suppDemande = ref({});
const sortBy = ref([{ key: 'dateModification', order: 'desc' }]);
const sortBy = ref([{
key: 'dateModification',
order: 'desc'
}]);
//Progress bar displayed while fetching data
const isDataLoaded = ref(false);
Expand All @@ -245,7 +254,7 @@ const indexRechercheSearchField = ref('');
const statutSearchField = ref();
let polling;
const isDialogOpen = computed(() => {
return !!contentsDemandesFrontFiltered.value.find(item => item.expanded === true)
return !!contentsDemandesFrontFiltered.value.find(item => item.expanded === true);
});
//Actives or archives demands displayed
const isActiveDemandesDisplayed = ref(false);
Expand All @@ -263,7 +272,7 @@ onMounted(() => {
listTypeExemp.value.push('Non défini');
});
polling = setInterval(() => {
if(!isDialogOpen.value) {
if (!isDialogOpen.value) {
loadItems('EXEMP', isActiveDemandesDisplayed.value)
.then(() => {
filterItems();
Expand All @@ -274,7 +283,8 @@ onMounted(() => {
onBeforeUnmount(() => {
clearInterval(polling);
})
});
function switchArchiveActiveDisplay(value) {
isActiveDemandesDisplayed.value = value;
loadItems('EXEMP', isActiveDemandesDisplayed.value);
Expand Down Expand Up @@ -351,14 +361,26 @@ function onRowClick(item) {
}
}
function saveComment(){
loadItems('EXEMP',isActiveDemandesDisplayed.value).then(()=>{
filterItems();
})
function saveComment() {
loadItems('EXEMP', isActiveDemandesDisplayed.value)
.then(() => {
filterItems();
});
}
function throwError(error) {
emit('backendError',error);
emit('backendError', error);
}
function colorProgressBar(item) {
if (item.pourcentageProgressionTraitement === 100) {
if (item.etatDemande === 'Terminé') {
return 'success';
} else if (item.etatDemande === 'En erreur') {
return 'error';
}
}
return 'grey-lighten-1';
}
</script>

Expand Down
21 changes: 17 additions & 4 deletions src/views/Modification/ModifTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<v-chip :variant="isActiveDemandesDisplayed ? 'plain' : 'tonal'" style="margin-right: 10px"
@click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Modification d'exemplaires
</v-chip>
<v-chip :variant="!isActiveDemandesDisplayed ? 'plain' : 'tonal'" @click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Modification
<v-chip :variant="!isActiveDemandesDisplayed ? 'plain' : 'tonal'"
@click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Modification
d'exemplaires archivées
</v-chip>
<v-chip variant="text">
Expand Down Expand Up @@ -103,7 +104,8 @@
</td>
<td @click="onRowClick(item)" class="text-center">
<v-progress-linear v-model="item.pourcentageProgressionTraitement" height="18"
color="grey-lighten-1" style="border: 1px solid grey; font-weight: bolder">
:color="colorProgressBar(item)"
style="border: 1px solid grey; font-weight: bolder">
{{ item.pourcentageProgressionTraitement }} %
</v-progress-linear>
</td>
Expand Down Expand Up @@ -143,7 +145,7 @@ const headingsDemandes = ref([
align: 'center'
},
{
title: 'Demande',
title: 'N° de Demande',
key: 'id',
align: 'center'
},
Expand Down Expand Up @@ -377,7 +379,18 @@ function saveComment() {
}
function throwError(error) {
emit('backendError',error);
emit('backendError', error);
}
function colorProgressBar(item) {
if (item.pourcentageProgressionTraitement === 100) {
if (item.etatDemande === 'Terminé') {
return 'success';
} else if (item.etatDemande === 'En erreur') {
return 'error';
}
}
return 'grey-lighten-1';
}
</script>

Expand Down
64 changes: 42 additions & 22 deletions src/views/Recouvrement/RecouvTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<v-chip :variant="isActiveDemandesDisplayed ? 'plain' : 'tonal'" style="margin-right: 10px"
@click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Calculs de taux de recouvrement
</v-chip>
<v-chip :variant="!isActiveDemandesDisplayed ? 'plain' : 'tonal'" @click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Calculs de taux
<v-chip :variant="!isActiveDemandesDisplayed ? 'plain' : 'tonal'"
@click="switchArchiveActiveDisplay(!isActiveDemandesDisplayed)">Calculs de taux
de recouvrement archivés
</v-chip>
<v-chip variant="text">
Expand Down Expand Up @@ -66,7 +67,7 @@
<!-- Colonne de progression-->
<template v-slot:item.pourcentageProgressionTraitement="{ item }">
<v-progress-linear v-model="item.pourcentageProgressionTraitement" :height="18" :striped="false"
color="grey-lighten-1" style="border: 1px solid grey; font-weight: bolder">
:color="colorProgressBar(item)" style="border: 1px solid grey; font-weight: bolder">
{{ item.pourcentageProgressionTraitement }} %
</v-progress-linear>
</template>
Expand Down Expand Up @@ -97,7 +98,7 @@
</td>
<td @click="onRowClick(item)" class="text-center">
<v-progress-linear v-model="item.pourcentageProgressionTraitement" :height="18" :striped="false"
color="grey-lighten-1" style="border: 1px solid grey; font-weight: bolder">
:color="colorProgressBar(item)" style="border: 1px solid grey; font-weight: bolder">
{{ item.pourcentageProgressionTraitement }} %
</v-progress-linear>
</td>
Expand All @@ -121,9 +122,9 @@ import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
import itemService from '@/service/ItemService';
import router from '@/router';
import DialogSuppression from '@/components/Dialog/DialogSuppression.vue';
import DialogCommentaire from "@/components/Dialog/DialogCommentaire.vue";
import MenuDownloadFile from "@/components/MenuDownloadFile.vue";
import moment from "moment/moment";
import DialogCommentaire from '@/components/Dialog/DialogCommentaire.vue';
import MenuDownloadFile from '@/components/MenuDownloadFile.vue';
import moment from 'moment/moment';
//Emit
const emit = defineEmits(['backendError', 'backendSuccess']);
Expand All @@ -137,17 +138,19 @@ const headingsDemandes = ref([
align: 'center'
},
{
title: 'Demande',
title: 'N° de Demande',
key: 'id',
align: 'center'
},
{
title: 'Crée le',
key: 'dateCreation',
align: 'center',
sort:(d1,d2) => {
const date1 = moment(d1, "DD/MM/yyyy HH:mm").valueOf();
const date2 = moment(d2, "DD/MM/yyyy HH:mm").valueOf();
sort: (d1, d2) => {
const date1 = moment(d1, 'DD/MM/yyyy HH:mm')
.valueOf();
const date2 = moment(d2, 'DD/MM/yyyy HH:mm')
.valueOf();
if (date1 > date2) return 1;
if (date1 < date2) return -1;
return 0;
Expand All @@ -157,9 +160,11 @@ const headingsDemandes = ref([
title: 'Mise à jour',
key: 'dateModification',
align: 'center',
sort:(d1,d2) => {
const date1 = moment(d1, "DD/MM/yyyy HH:mm").valueOf();
const date2 = moment(d2, "DD/MM/yyyy HH:mm").valueOf();
sort: (d1, d2) => {
const date1 = moment(d1, 'DD/MM/yyyy HH:mm')
.valueOf();
const date2 = moment(d2, 'DD/MM/yyyy HH:mm')
.valueOf();
if (date1 > date2) return 1;
if (date1 < date2) return -1;
return 0;
Expand Down Expand Up @@ -216,7 +221,10 @@ const contentsDemandesFrontFiltered = ref([]);
const totalItemsFound = ref(0);
const suppDialog = ref(false);
const suppDemande = ref({});
const sortBy = ref([{ key: 'dateModification', order: 'desc' }]);
const sortBy = ref([{
key: 'dateModification',
order: 'desc'
}]);
//Progress bar displayed while fetching data
const isDataLoaded = ref(false);
Expand All @@ -232,7 +240,7 @@ const indexRechercheSearchField = ref('');
const statutSearchField = ref();
let polling;
const isDialogOpen = computed(() => {
return !!contentsDemandesFrontFiltered.value.find(item => item.expanded === true)
return !!contentsDemandesFrontFiltered.value.find(item => item.expanded === true);
});
//Actives or archives demands displayed
Expand All @@ -243,7 +251,7 @@ onMounted(() => {
loadItems('RECOUV', isActiveDemandesDisplayed.value);
contentsDemandesFromServer.value = [...contentsDemandesFromServer.value];
polling = setInterval(() => {
if(!isDialogOpen.value) {
if (!isDialogOpen.value) {
loadItems('RECOUV', isActiveDemandesDisplayed.value)
.then(() => {
filterItems();
Expand All @@ -254,7 +262,7 @@ onMounted(() => {
onBeforeUnmount(() => {
clearInterval(polling);
})
});
function switchArchiveActiveDisplay(value) {
isActiveDemandesDisplayed.value = value;
Expand Down Expand Up @@ -335,14 +343,26 @@ function onRowClick(item) {
function saveAction() {
}
function saveComment(){
loadItems('RECOUV',isActiveDemandesDisplayed.value).then(()=>{
filterItems();
})
function saveComment() {
loadItems('RECOUV', isActiveDemandesDisplayed.value)
.then(() => {
filterItems();
});
}
function throwError(error) {
emit('backendError',error);
emit('backendError', error);
}
function colorProgressBar(item) {
if (item.pourcentageProgressionTraitement === 100) {
if (item.etatDemande === 'Terminé') {
return 'success';
} else if (item.etatDemande === 'En erreur') {
return 'error';
}
}
return 'grey-lighten-1';
}
</script>

Expand Down
Loading

0 comments on commit 9283271

Please sign in to comment.