Skip to content

Commit

Permalink
- Adaptation du header
Browse files Browse the repository at this point in the history
  • Loading branch information
jvk88511334 committed Nov 4, 2024
1 parent 9f1f0c9 commit 3b24a5a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
1 change: 0 additions & 1 deletion src/store/authStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const useAuthStore = defineStore('auth', {
this.user = user;
},
isAdmin() {
console.log(JSON.stringify(this.user))
return this.user.role === 'ADMIN';
}
},
Expand Down
48 changes: 33 additions & 15 deletions src/views/Exemplarisation/ExempTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</v-tooltip>
</v-chip>
</v-container>
<v-data-table :headers="headingsDemandes" :items="contentsDemandesFrontFiltered" :items-length="totalItemsFound"
<v-data-table :headers="filteredHeadingsDemandes" :items="contentsDemandesFrontFiltered" :items-length="totalItemsFound"
:loading="!isDataLoaded" show-expand :sort-by="sortBy"
item-key="id"
>
Expand All @@ -47,6 +47,7 @@
variant="underlined" append-inner-icon="mdi-magnify"></v-text-field>
</td>
<td>
<!--TODO v-if dans les items-->
<v-text-field v-model="ilnSearchField" hide-details @input="filterItems" variant="underlined"
append-inner-icon="mdi-magnify"></v-text-field>
</td>
Expand Down Expand Up @@ -139,22 +140,27 @@ import {useAuthStore} from '@/store/authStore'
const emit = defineEmits(['backendError', 'backendSuccess']);
//Data
const isAdmin = useAuthStore().isAdmin();
const extendedAllILN = ref(false);
const headingsDemandes = [
{
title: '',
key: 'data-table-expand',
align: 'center'
align: 'center',
display: true,
},
{
title: 'N° de Demande',
key: 'id',
align: 'center'
align: 'center',
display: true,
},
{
title: 'Crée le',
key: 'dateCreation',
align: 'center',
display: true,
sort: (d1, d2) => {
const date1 = moment(d1, 'DD/MM/yyyy HH:mm')
.valueOf();
Expand All @@ -169,6 +175,7 @@ const headingsDemandes = [
title: 'Mise à jour',
key: 'dateModification',
align: 'center',
display: true,
sort: (d1, d2) => {
const date1 = moment(d1, 'DD/MM/yyyy HH:mm')
.valueOf();
Expand All @@ -182,47 +189,59 @@ const headingsDemandes = [
{
title: 'ILN',
key: 'iln',
align: 'center'
align: 'center',
display: isAdmin,
},
{
title: 'RCR',
key: 'rcr',
align: 'center'
align: 'center',
display: true,
},
{
title: 'Type',
key: 'typeExemp',
align: 'center'
align: 'center',
display: true,
},
{
title: 'Index',
key: 'indexRecherche',
align: 'center'
align: 'center',
display: true,
},
{
title: 'Statut',
key: 'etatDemande',
align: 'center'
align: 'center',
display: true,
},
{
title: 'Progression',
key: 'pourcentageProgressionTraitement',
value: 'pourcentageProgressionTraitement',
align: 'center'
align: 'center',
display: true,
},
{
title: 'Fichiers',
key: 'filesToDownload',
value: 'filesToDownload',
align: 'center'
align: 'center',
display: true,
},
{
title: 'Action',
key: 'archiveOrCancel',
value: 'archiveOrCancel',
align: 'center'
align: 'center',
display: true,
}
];
const filteredHeadingsDemandes = computed(() =>
headingsDemandes.filter(heading => heading.display !== false)
)
const listStatut = [
'En saisie',
'En attente',
Expand All @@ -236,14 +255,14 @@ const contentsDemandesFrontFiltered = ref([]);
const totalItemsFound = ref(0);
const suppDialog = ref(false);
const suppDemande = ref({});
const sortBy = ref([{
key: 'dateModification',
order: 'desc'
}]);
//Progress bar displayed while fetching data
const isDataLoaded = ref(false);
const isDataLoaded = ref(false);
//Search fields columns
const numDemandeSearchField = ref('');
const dateCreationSearchField = ref('');
Expand All @@ -258,9 +277,8 @@ const isDialogOpen = computed(() => {
return !!contentsDemandesFrontFiltered.value.find(item => item.expanded === true);
});
//Actives or archives demands displayed
const isActiveDemandesDisplayed = ref(false);
const isAdmin = useAuthStore().isAdmin();
const isActiveDemandesDisplayed = ref(false);
//Data initialisation
onMounted(() => {
Expand Down

0 comments on commit 3b24a5a

Please sign in to comment.