From 5df3f06f833458c90266a716e6fb88af77cb158c Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Wed, 22 Oct 2025 17:09:21 +0800 Subject: [PATCH] fix: persona information is not appearing in the PersonaForm when editing --- .../src/components/shared/PersonaForm.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/dashboard/src/components/shared/PersonaForm.vue b/dashboard/src/components/shared/PersonaForm.vue index d98fad929..48f1a0d0e 100644 --- a/dashboard/src/components/shared/PersonaForm.vue +++ b/dashboard/src/components/shared/PersonaForm.vue @@ -268,7 +268,12 @@ export default { watch: { modelValue(newValue) { if (newValue) { - this.initForm(); + // 只有在不是编辑状态时才初始化空表单 + if (this.editingPersona) { + this.initFormWithPersona(this.editingPersona); + } else { + this.initForm(); + } this.loadMcpServers(); this.loadTools(); } @@ -276,10 +281,13 @@ export default { editingPersona: { immediate: true, handler(newPersona) { - if (newPersona) { - this.initFormWithPersona(newPersona); - } else { - this.initForm(); + // 只有在对话框打开时才处理editingPersona的变化 + if (this.modelValue) { + if (newPersona) { + this.initFormWithPersona(newPersona); + } else { + this.initForm(); + } } } },