From 60f93a16e05d336bce70512c3d7b543453c4da99 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 20 Nov 2024 15:33:45 +0700 Subject: [PATCH] fix: package properties flow not current when change --- src/components/dialog/DialogProperties.vue | 21 ++++++++++++--------- src/pages/04_product-service/MainPage.vue | 3 ++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/components/dialog/DialogProperties.vue b/src/components/dialog/DialogProperties.vue index 241b75fe..ec988271 100644 --- a/src/components/dialog/DialogProperties.vue +++ b/src/components/dialog/DialogProperties.vue @@ -22,6 +22,7 @@ const optionStore = useOptionStore(); const props = defineProps<{ stepIndex?: number; + onEdit?: boolean; selectFlow?: boolean; }>(); @@ -267,18 +268,11 @@ function assignTemp() { tempWorkflowId.value = workflowId.value; } -watch( - () => model.value, - () => { - if (model.value) { - assignTemp(); - } - }, -); - watch( () => tempWorkflowId.value, async (a, b) => { + if (props.onEdit && workflowId.value === a) return; + if (props.selectFlow && a !== b && a) { const ret = await getWorkflowTemplate(a); if (ret) { @@ -294,6 +288,15 @@ watch( } }, ); + +watch( + () => model.value, + () => { + if (model.value) { + assignTemp(); + } + }, +);