From 8a32ef4bbc6f83e2c55b3316e411c8a2c9ff3e1e Mon Sep 17 00:00:00 2001 From: Matthieu Date: Wed, 17 Sep 2025 16:21:42 +0200 Subject: [PATCH] fix: stabilize constructeur selector ui --- app/components/ComponentItem.vue | 19 +++---- app/components/ConstructeurSelect.vue | 72 ++++++++++++++++++++------- app/components/PieceItem.vue | 19 +++---- app/pages/machine/[id].vue | 37 ++++++++------ 4 files changed, 92 insertions(+), 55 deletions(-) diff --git a/app/components/ComponentItem.vue b/app/components/ComponentItem.vue index af2f54b..a4bf63a 100644 --- a/app/components/ComponentItem.vue +++ b/app/components/ComponentItem.vue @@ -81,7 +81,9 @@
@@ -288,6 +290,11 @@ const documentsLoaded = ref(!!(props.component.documents && props.component.docu const componentDocuments = computed(() => props.component.documents || []) const documentIcon = (doc) => getFileIcon({ name: doc.filename || doc.name, mime: doc.mimeType }) +const handleConstructeurChange = async (value) => { + props.component.constructeurId = value + await updateComponent() +} + const { uploadDocuments, deleteDocument, loadDocumentsByComponent } = useDocuments() watch( @@ -301,16 +308,6 @@ watch( { immediate: true } ) -watch( - () => props.component.constructeurId, - (newVal, oldVal) => { - if (!props.isEditMode) return - if (oldVal === undefined) return - if (newVal !== oldVal) { - updateComponent() - } - } -) watch( () => props.component.documents, diff --git a/app/components/ConstructeurSelect.vue b/app/components/ConstructeurSelect.vue index 749a592..699fe8b 100644 --- a/app/components/ConstructeurSelect.vue +++ b/app/components/ConstructeurSelect.vue @@ -20,17 +20,21 @@ - + +