From 87bfd3818826baf9ae8f62b50b6583854ee618f3 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 29 Feb 2024 17:08:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=A1=86=E5=8F=96=E6=B6=88=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=97=B6=E6=96=87=E6=9C=AC=E6=A1=86=E5=86=85=E5=AE=B9=E5=8D=B4?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=A4=8D=E4=BD=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1036429 --user=宋天阳 【缺陷管理】查看缺陷详情-内容编辑-输入内容后-取消,页面仍回显变更内容 https://www.tapd.cn/55049933/s/1467158 --- .../src/views/bug-management/components/bugDetailTab.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/bug-management/components/bugDetailTab.vue b/frontend/src/views/bug-management/components/bugDetailTab.vue index 4e2b8d05ac..e7e686626e 100644 --- a/frontend/src/views/bug-management/components/bugDetailTab.vue +++ b/frontend/src/views/bug-management/components/bugDetailTab.vue @@ -220,6 +220,8 @@ const fileListRef = ref>(); // 富文本编辑器是否可编辑 const contentEditAble = ref(false); + // 富文本框默认值。用于取消编辑时的复位 + const defaultContentValue = ref(''); const currentProjectId = computed(() => appStore.currentProjectId); // 前端保存的fileList const fileList = ref([]); @@ -268,11 +270,14 @@ const { attachments, title, description } = detail; form.value.title = title; form.value.description = description; + defaultContentValue.value = description; handleFileFunc(attachments); }; + // 取消富文本框编辑时,要将数据复位 function handleCancel() { contentEditAble.value = false; + form.value.description = defaultContentValue.value; } // 删除本地文件 @@ -436,10 +441,11 @@ templateId: props.detailInfo.templateId, customFields, }; - // 执行保存操作 + // 执行保存操作。 保存成功后将富文本内容赋值给默认值 const res = await createOrUpdateBug({ request: tmpObj, fileList: fileList.value as unknown as File[] }); if (res) { Message.success(t('common.updateSuccess')); + defaultContentValue.value = form.value.description; handleCancel(); emit('updateSuccess'); }