From 952596f7d7ce40f311719c3d4145b93a4ccde52a Mon Sep 17 00:00:00 2001 From: teukkk Date: Fri, 17 May 2024 11:40:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E8=AF=A6=E6=83=85-?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E5=88=97=E8=A1=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=89=A7=E8=A1=8C=E7=BB=93=E6=9E=9C&=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E7=94=A8=E4=BE=8B=E8=AF=A6=E6=83=85=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E7=BB=93=E6=9E=9C=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/modules/test-plan/testPlan.ts | 11 ++++++++++ .../src/api/requrls/test-plan/testPlan.ts | 4 ++++ frontend/src/config/testPlan.ts | 2 +- frontend/src/models/testPlan/testPlan.ts | 4 ++++ .../components/tabContent/tabDetail.vue | 3 ++- .../featureCase/components/caseTable.vue | 20 ++++++++++++++++++- .../detail/featureCase/detail/index.vue | 13 +++++++----- 7 files changed, 49 insertions(+), 8 deletions(-) diff --git a/frontend/src/api/modules/test-plan/testPlan.ts b/frontend/src/api/modules/test-plan/testPlan.ts index 4f6e20783d..4d39ee1a97 100644 --- a/frontend/src/api/modules/test-plan/testPlan.ts +++ b/frontend/src/api/modules/test-plan/testPlan.ts @@ -15,6 +15,7 @@ import { deletePlanUrl, DeleteTestPlanModuleUrl, DisassociateCaseUrl, + EditCaseLastExecResultUrl, followPlanUrl, GetAssociatedBugUrl, GetFeatureCaseModuleCountUrl, @@ -32,6 +33,7 @@ import { SortFeatureCaseUrl, TestPlanAssociateBugUrl, TestPlanCancelBugUrl, + TestPlanCaseDetailUrl, updateTestPlanModuleUrl, UpdateTestPlanUrl, } from '@/api/requrls/test-plan/testPlan'; @@ -46,6 +48,7 @@ import type { BatchFeatureCaseParams, BatchUpdateCaseExecutorParams, DisassociateCaseParams, + EditLastExecResultParams, FollowPlanParams, PassRateCountDetail, PlanDetailBugItem, @@ -171,6 +174,10 @@ export function getFeatureCaseModule(planId: string) { export function disassociateCase(data: DisassociateCaseParams) { return MSR.post({ url: DisassociateCaseUrl, data }); } +// 计划详情-功能用例列表-编辑执行结果 +export function editLastExecResult(data: EditLastExecResultParams) { + return MSR.post({ url: EditCaseLastExecResultUrl, data }); +} // 计划详情-功能用例列表-拖拽排序 export const sortFeatureCase = (data: SortFeatureCaseParams) => { return MSR.post({ url: SortFeatureCaseUrl, data }); @@ -191,6 +198,10 @@ export function batchUpdateCaseExecutor(data: BatchUpdateCaseExecutorParams) { export function runFeatureCase(data: RunFeatureCaseParams) { return MSR.post({ url: RunFeatureCaseUrl, data }); } +// 计划详情-功能用例-详情 +export function getCaseDetail(id: string) { + return MSR.get({ url: `${TestPlanCaseDetailUrl}/${id}` }); +} // 测试计划-用例详情-缺陷列表 export function associatedBugPage(data: TableQueryParams) { return MSR.post({ url: GetAssociatedBugUrl, data }); diff --git a/frontend/src/api/requrls/test-plan/testPlan.ts b/frontend/src/api/requrls/test-plan/testPlan.ts index f68b436698..32868d8f6f 100644 --- a/frontend/src/api/requrls/test-plan/testPlan.ts +++ b/frontend/src/api/requrls/test-plan/testPlan.ts @@ -50,6 +50,8 @@ export const GetFeatureCaseModuleCountUrl = '/test-plan/functional/case/module/c export const GetFeatureCaseModuleUrl = '/test-plan/functional/case/tree'; // 计划详情-功能用例列表-拖拽排序 export const SortFeatureCaseUrl = '/test-plan/functional/case/sort'; +// 计划详情-功能用例列表-编辑执行结果 +export const EditCaseLastExecResultUrl = '/test-plan/functional/case/edit'; // 计划详情-功能用例-取消关联用例 export const DisassociateCaseUrl = '/test-plan/functional/case/disassociate'; // 计划详情-功能用例-批量取消关联用例 @@ -58,6 +60,8 @@ export const BatchDisassociateCaseUrl = '/test-plan/functional/case/batch/disass export const RunFeatureCaseUrl = '/test-plan/functional/case/run'; // 测试计划-用例详情-缺陷列表 export const GetAssociatedBugUrl = '/test-plan/functional/case/has/associate/bug/page'; +// 测试计划-用例详情 +export const TestPlanCaseDetailUrl = '/test-plan/functional/case/detail'; // 测试计划-用例详情-关联缺陷 export const TestPlanAssociateBugUrl = '/test-plan/functional/case/associate/bug'; // 测试计划-用例详情-取消关联缺陷 diff --git a/frontend/src/config/testPlan.ts b/frontend/src/config/testPlan.ts index 145b76744c..337d606623 100644 --- a/frontend/src/config/testPlan.ts +++ b/frontend/src/config/testPlan.ts @@ -41,7 +41,7 @@ export const defaultDetailCount: PassRateCountDetail = { }; export const defaultExecuteForm = { - lastExecResult: 'PASSED' as LastExecuteResults, + lastExecResult: LastExecuteResults.SUCCESS, content: '', planCommentFileIds: [], notifier: [] as string[], diff --git a/frontend/src/models/testPlan/testPlan.ts b/frontend/src/models/testPlan/testPlan.ts index a664645e6e..cf84cd32bf 100644 --- a/frontend/src/models/testPlan/testPlan.ts +++ b/frontend/src/models/testPlan/testPlan.ts @@ -158,6 +158,10 @@ export interface DisassociateCaseParams { id: string; } +export interface EditLastExecResultParams extends DisassociateCaseParams { + lastExecResult: string; +} + export interface BatchFeatureCaseParams extends BatchActionQueryParams { testPlanId: string; moduleIds?: string[]; diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue index 4b6df31663..e17690f18b 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue @@ -587,9 +587,10 @@ if (steps) { stepData.value = JSON.parse(steps).map((item: any) => { return { + id: item.id, step: item.desc, expected: item.result, - actualResult: item.actualResult ?? '', + actualResult: item.actualResult, executeResult: item.executeResult, }; }); diff --git a/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue b/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue index 378453f80c..16e2ef5078 100644 --- a/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue +++ b/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue @@ -42,6 +42,7 @@ v-model:model-value="record.lastExecResult" :placeholder="t('common.pleaseSelect')" class="param-input w-full" + @change="() => handleEditLastExecResult(record)" >