From 53293f50e676bf7c33556f3323c96c0fbd816a2d Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Tue, 9 Jul 2024 14:55:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=8B=E5=8A=A8=E7=94=9F=E6=88=90=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/plan/service/TestPlanReportService.java | 8 ++++---- .../test-plan/report/detail/component/viewReport.vue | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java index f3ae835ca9..cf26546889 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java @@ -256,6 +256,7 @@ public class TestPlanReportService { TestPlanReport record = new TestPlanReport(); record.setId(genReportId); record.setDefaultLayout(false); + record.setName(request.getReportName()); testPlanReportMapper.updateByPrimaryKeySelective(record); // 处理富文本文件 transferRichTextTmpFile(genReportId, request.getProjectId(), request.getRichTextTmpFileIds(), currentUser, TestPlanReportAttachmentSourceType.RICH_TEXT.name()); @@ -602,7 +603,7 @@ public class TestPlanReportService { public List getLayout(String reportId) { TestPlanReportComponentExample example = new TestPlanReportComponentExample(); example.createCriteria().andTestPlanReportIdEqualTo(reportId); - return componentMapper.selectByExample(example); + return componentMapper.selectByExampleWithBLOBs(example); } /** @@ -622,11 +623,10 @@ public class TestPlanReportService { testPlanReportSummaryMapper.updateByExampleSelective(reportSummary, example); } else { // 手动生成的布局, 只更新富文本组件的内容 - TestPlanReportComponentExample componentExample = new TestPlanReportComponentExample(); - componentExample.createCriteria().andIdEqualTo(request.getComponentId()); TestPlanReportComponent record = new TestPlanReportComponent(); + record.setId(request.getComponentId()); record.setValue(request.getComponentValue()); - componentMapper.updateByExample(record, componentExample); + componentMapper.updateByPrimaryKeySelective(record); } // 处理富文本文件 transferRichTextTmpFile(request.getId(), planReport.getProjectId(), request.getRichTextTmpFileIds(), currentUser, TestPlanReportAttachmentSourceType.RICH_TEXT.name()); diff --git a/frontend/src/views/test-plan/report/detail/component/viewReport.vue b/frontend/src/views/test-plan/report/detail/component/viewReport.vue index 3938216929..1b5f21f48b 100644 --- a/frontend/src/views/test-plan/report/detail/component/viewReport.vue +++ b/frontend/src/views/test-plan/report/detail/component/viewReport.vue @@ -575,7 +575,7 @@ try { const params: UpdateReportDetailParams = { id: detail.value.id, - componentId: currentItem.type, + componentId: currentItem.id, componentValue: currentItem.content, richTextTmpFileIds: currentItem.richTextTmpFileIds, };