From 4db832bc8c279f06512f6930a19edc6a1d45dcf4 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Mon, 23 Mar 2026 15:41:20 +0100 Subject: [PATCH] feat(documents) : add type column, filter, and edit to documents page Co-Authored-By: Claude Opus 4.6 (1M context) --- app/composables/useDocuments.ts | 8 +++- app/pages/documents.vue | 71 ++++++++++++++++++++++++++++++++- 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/app/composables/useDocuments.ts b/app/composables/useDocuments.ts index 842a68a..5078c5a 100644 --- a/app/composables/useDocuments.ts +++ b/app/composables/useDocuments.ts @@ -49,6 +49,7 @@ interface LoadDocumentsOptions { orderBy?: string orderDir?: 'asc' | 'desc' attachmentFilter?: string + type?: string force?: boolean } @@ -105,10 +106,11 @@ export function useDocuments() { orderBy = 'createdAt', orderDir = 'desc', attachmentFilter = 'all', + type = 'all', force = false, } = options - if (!force && loaded.value && !search && page === 1 && attachmentFilter === 'all') { + if (!force && loaded.value && !search && page === 1 && attachmentFilter === 'all' && type === 'all') { return { success: true, data: documents.value } } @@ -130,6 +132,10 @@ export function useDocuments() { params.set(`exists[${attachmentFilter}]`, 'true') } + if (type && type !== 'all') { + params.set('type', type) + } + params.set(`order[${orderBy}]`, orderDir) const result = await get(`/documents?${params.toString()}`) diff --git a/app/pages/documents.vue b/app/pages/documents.vue index 7bfd658..031a336 100644 --- a/app/pages/documents.vue +++ b/app/pages/documents.vue @@ -7,6 +7,13 @@ @close="closePreview" /> + +
Produits
+ +
+ + +
+ + @@ -98,6 +129,14 @@