From ec358a705a84b2d23592131d2338d06b94669555 Mon Sep 17 00:00:00 2001 From: teukkk Date: Fri, 19 Jul 2024 15:22:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B&?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20=E8=84=91=E5=9B=BE?= =?UTF-8?q?=E8=AF=84=E5=AE=A1=E7=9A=84=E8=AF=84=E5=AE=A1=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC&=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E7=94=A8=E4=BE=8B=E8=AF=A6=E6=83=85=E7=9A=84=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E6=89=A7=E8=A1=8C=E5=AF=8C=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1044182 --user=吕梦园 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001044182 --- .../caseReview/components/reviewSubmit.vue | 16 ++++++++++++++-- .../detail/featureCase/detail/executeSubmit.vue | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/case-management/caseReview/components/reviewSubmit.vue b/frontend/src/views/case-management/caseReview/components/reviewSubmit.vue index 3cd7344658..c6517982ab 100644 --- a/frontend/src/views/case-management/caseReview/components/reviewSubmit.vue +++ b/frontend/src/views/case-management/caseReview/components/reviewSubmit.vue @@ -24,8 +24,9 @@ :ok-text="t('caseManagement.caseReview.commitResult')" :ok-button-props="{ disabled: submitDisabled }" @before-ok="submit" + @cancel="cancel" > - + @@ -33,6 +34,7 @@ import { nextTick, onMounted, ref, watch } from 'vue'; import { useEventListener } from '@vueuse/core'; import { Message } from '@arco-design/web-vue'; + import { cloneDeep } from 'lodash-es'; import type { MinderJsonNode } from '@/components/pure/ms-minder-editor/props'; import { getMinderOperationParams } from '@/components/business/ms-minders/caseReviewMinder/utils'; @@ -67,6 +69,7 @@ }; const form = ref({ ...defaultForm }); + const dialogForm = ref({ ...defaultForm }); const modalVisible = ref(false); const submitLoading = ref(false); @@ -82,6 +85,7 @@ const editorContent = document.querySelector('.execute-form')?.querySelector('.editor-content'); useEventListener(editorContent, 'dblclick', () => { modalVisible.value = true; + dialogForm.value = cloneDeep(form.value); }); }); }); @@ -93,6 +97,14 @@ } ); + function cancel(e: Event) { + // 点击取消/关闭,弹窗关闭,富文本内容都清空;点击空白处,弹窗关闭,将弹窗内容填入下面富文本内容里 + if (!(e.target as any)?.classList.contains('arco-modal-wrapper')) { + dialogForm.value = { ...defaultForm }; + } + form.value = cloneDeep(dialogForm.value); + } + // 提交执行 async function submit() { try { @@ -102,7 +114,7 @@ userId: props.userId, reviewId: props.reviewId, reviewPassRule: props.reviewPassRule, - ...form.value, + ...(modalVisible.value ? dialogForm.value : form.value), notifier: form.value.notifiers?.join(';') ?? '', ...getMinderOperationParams(props.selectNode), }; diff --git a/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/executeSubmit.vue b/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/executeSubmit.vue index d46a5838ff..8524f10ebc 100644 --- a/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/executeSubmit.vue +++ b/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/executeSubmit.vue @@ -14,8 +14,9 @@ :ok-loading="submitLoading" :ok-text="t('caseManagement.caseReview.commitResult')" @before-ok="submit" + @cancel="cancel" > - + @@ -23,6 +24,7 @@ import { ref } from 'vue'; import { useEventListener } from '@vueuse/core'; import { Message } from '@arco-design/web-vue'; + import { cloneDeep } from 'lodash-es'; import ExecuteForm from '@/views/test-plan/testPlan/detail/featureCase/components/executeForm.vue'; @@ -50,6 +52,7 @@ const appStore = useAppStore(); const form = ref({ ...defaultExecuteForm }); + const dialogForm = ref({ ...defaultExecuteForm }); const modalVisible = ref(false); const submitLoading = ref(false); @@ -60,6 +63,7 @@ const editorContent = document.querySelector('.execute-form')?.querySelector('.editor-content'); useEventListener(editorContent, 'dblclick', () => { modalVisible.value = true; + dialogForm.value = cloneDeep(form.value); }); }); }); @@ -86,6 +90,14 @@ } ); + function cancel(e: Event) { + // 点击取消/关闭,弹窗关闭,富文本内容都清空;点击空白处,弹窗关闭,将弹窗内容填入下面富文本内容里 + if (!(e.target as any)?.classList.contains('arco-modal-wrapper')) { + dialogForm.value = { ...defaultExecuteForm }; + } + form.value = cloneDeep(dialogForm.value); + } + // 提交执行 async function submit() { try { @@ -95,7 +107,7 @@ caseId: props.caseId, testPlanId: props.testPlanId, id: props.id, - ...form.value, + ...(modalVisible.value ? dialogForm.value : form.value), stepsExecResult: JSON.stringify(props.stepExecutionResult) ?? '', notifier: form.value?.commentIds?.join(';'), };