From 8f3dc0b489d1c5f234aa0eabf414ba2ab2956efd Mon Sep 17 00:00:00 2001 From: teukkk Date: Wed, 12 Jun 2024 11:05:41 +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?=E6=8E=A5=E5=8F=A3=E5=9C=BA=E6=99=AF=E9=83=A8=E5=88=86=E8=81=94?= =?UTF-8?q?=E8=B0=83&=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/modules/test-plan/testPlan.ts | 42 ++++++++++--- .../src/api/requrls/test-plan/testPlan.ts | 17 ++++++ frontend/src/models/testPlan/testPlan.ts | 27 +++++--- .../report/detail/component/apiCaseTable.vue | 2 +- .../detail/component/scenarioCaseTable.vue | 2 +- .../detail/apiCase/components/caseTable.vue | 1 + .../testPlan/detail/apiCase/index.vue | 2 - .../apiScenario/components/scenarioTable.vue | 61 ++++++++++--------- .../apiScenario/components/scenarioTree.vue | 19 ++++-- .../testPlan/detail/apiScenario/index.vue | 20 +++--- .../featureCase/components/caseTable.vue | 28 ++++++--- .../featureCase/components/caseTree.vue | 16 ++++- .../testPlan/detail/featureCase/index.vue | 11 ++-- .../views/test-plan/testPlan/detail/index.vue | 5 +- 14 files changed, 172 insertions(+), 81 deletions(-) diff --git a/frontend/src/api/modules/test-plan/testPlan.ts b/frontend/src/api/modules/test-plan/testPlan.ts index 4fb2461fbc..3d83e8df0a 100644 --- a/frontend/src/api/modules/test-plan/testPlan.ts +++ b/frontend/src/api/modules/test-plan/testPlan.ts @@ -8,11 +8,13 @@ import { batchCopyPlanUrl, batchDeletePlanUrl, BatchDisassociateApiCaseUrl, + BatchDisassociateApiScenarioUrl, BatchDisassociateCaseUrl, BatchEditTestPlanUrl, batchMovePlanUrl, BatchRunCaseUrl, BatchUpdateApiCaseExecutorUrl, + BatchUpdateApiScenarioExecutorUrl, BatchUpdateCaseExecutorUrl, ConfigScheduleUrl, copyTestPlanUrl, @@ -20,6 +22,7 @@ import { DeleteScheduleTaskUrl, DeleteTestPlanModuleUrl, DisassociateApiCaseUrl, + DisassociateApiScenarioUrl, DisassociateCaseUrl, dragPlanOnGroupUrl, ExecuteHistoryUrl, @@ -28,10 +31,13 @@ import { GenerateReportUrl, GetApiCaseModuleCountUrl, GetApiCaseModuleUrl, + GetApiScenarioModuleCountUrl, + GetApiScenarioModuleUrl, GetAssociatedBugUrl, GetFeatureCaseModuleCountUrl, GetFeatureCaseModuleUrl, GetPlanDetailApiCaseListUrl, + GetPlanDetailApiScenarioListUrl, GetPlanDetailFeatureCaseListUrl, GetPlanMinderUrl, getStatisticalCountUrl, @@ -47,6 +53,7 @@ import { planPassRateUrl, RunFeatureCaseUrl, SortApiCaseUrl, + SortApiScenarioUrl, SortFeatureCaseUrl, TestPlanAndGroupCopyUrl, TestPlanApiAssociatedPageUrl, @@ -83,6 +90,7 @@ import type { PlanDetailApiCaseQueryParams, PlanDetailApiCaseTreeParams, PlanDetailApiScenarioItem, + PlanDetailApiScenarioQueryParams, PlanDetailBugItem, PlanDetailExecuteHistoryItem, PlanDetailFeatureCaseItem, @@ -216,8 +224,8 @@ export function getFeatureCaseModuleCount(data: PlanDetailFeatureCaseListQueryPa return MSR.post({ url: GetFeatureCaseModuleCountUrl, data }); } // 计划详情-功能用例模块树 -export function getFeatureCaseModule(planId: string) { - return MSR.get({ url: `${GetFeatureCaseModuleUrl}/${planId}` }); +export function getFeatureCaseModule(data: PlanDetailApiCaseTreeParams) { + return MSR.post({ url: GetFeatureCaseModuleUrl, data }); } // 计划详情-功能用例列表-取消关联用例 export function disassociateCase(data: DisassociateCaseParams) { @@ -295,13 +303,33 @@ export function batchDisassociateApiCase(data: BatchApiCaseParams) { export function batchUpdateApiCaseExecutor(data: BatchUpdateApiCaseExecutorParams) { return MSR.post({ url: BatchUpdateApiCaseExecutorUrl, data }); } -// 计划详情-接口场景列表 TODO 联调 -export function getPlanDetailApiScenarioList(data: PlanDetailFeatureCaseListQueryParams) { - return MSR.post>({ url: GetPlanDetailFeatureCaseListUrl, data }); +// 计划详情-接口场景列表 +export function getPlanDetailApiScenarioList(data: PlanDetailApiScenarioQueryParams) { + return MSR.post>({ url: GetPlanDetailApiScenarioListUrl, data }); } -// 计划详情-接口场景列表-批量更新执行人 TODO 联调 +// 计划详情-接口场景模块树 +export function getApiScenarioModule(data: PlanDetailApiCaseTreeParams) { + return MSR.post({ url: GetApiScenarioModuleUrl, data }); +} +// 计划详情-接口场景-获取模块数量 +export function getApiScenarioModuleCount(data: PlanDetailApiScenarioQueryParams) { + return MSR.post({ url: GetApiScenarioModuleCountUrl, data }); +} +// 计划详情-接口场景列表-拖拽排序 +export const sortApiScenario = (data: SortApiCaseParams) => { + return MSR.post({ url: SortApiScenarioUrl, data }); +}; +// 计划详情-接口场景列表-取消关联用例 +export function disassociateApiScenario(data: DisassociateCaseParams) { + return MSR.post({ url: DisassociateApiScenarioUrl, data }); +} +// 计划详情-接口场景列表-批量取消关联用例 +export function batchDisassociateApiScenario(data: BatchApiCaseParams) { + return MSR.post({ url: BatchDisassociateApiScenarioUrl, data }); +} +// 计划详情-接口场景列表-批量更新执行人 export function batchUpdateApiScenarioExecutor(data: BatchUpdateApiCaseExecutorParams) { - return MSR.post({ url: BatchUpdateApiCaseExecutorUrl, data }); + return MSR.post({ url: BatchUpdateApiScenarioExecutorUrl, data }); } // 计划详情-执行历史 TODO 联调 export function getPlanDetailExecuteHistory(data: PlanDetailFeatureCaseListQueryParams) { diff --git a/frontend/src/api/requrls/test-plan/testPlan.ts b/frontend/src/api/requrls/test-plan/testPlan.ts index 1d0df30bd4..6aa4ee138e 100644 --- a/frontend/src/api/requrls/test-plan/testPlan.ts +++ b/frontend/src/api/requrls/test-plan/testPlan.ts @@ -96,6 +96,7 @@ export const ConfigScheduleUrl = '/test-plan/schedule-config'; export const ExecutePlanUrl = '/test-plan-execute/start'; // 测试计划-删除定时任务 export const DeleteScheduleTaskUrl = 'test-plan/schedule-config-delete'; + // 计划详情-接口用例列表 export const GetPlanDetailApiCaseListUrl = '/test-plan/api/case/page'; // 计划详情-接口用例模块树 @@ -110,5 +111,21 @@ export const DisassociateApiCaseUrl = '/test-plan/api/case/disassociate'; export const BatchDisassociateApiCaseUrl = '/test-plan/api/case/batch/disassociate'; // 计划详情-接口用例列表-批量更新执行人 export const BatchUpdateApiCaseExecutorUrl = '/test-plan/api/case/batch/update/executor'; + +// 计划详情-接口场景列表 +export const GetPlanDetailApiScenarioListUrl = '/test-plan/api/scenario/page'; +// 计划详情-接口场景模块树 +export const GetApiScenarioModuleUrl = '/test-plan/api/scenario/tree'; +// 计划详情-接口场景-获取模块数量 +export const GetApiScenarioModuleCountUrl = '/test-plan/api/scenario/module/count'; +// 计划详情-接口场景列表-拖拽排序 +export const SortApiScenarioUrl = '/test-plan/api/scenario/sort'; +// 计划详情-接口场景列表-取消关联用例 +export const DisassociateApiScenarioUrl = '/test-plan/api/scenario/disassociate'; +// 计划详情-接口场景列表-批量取消关联用例 +export const BatchDisassociateApiScenarioUrl = '/test-plan/api/scenario/batch/disassociate'; +// 计划详情-接口场景列表-批量更新执行人 +export const BatchUpdateApiScenarioExecutorUrl = '/test-plan/api/scenario/batch/update/executor'; + // 测试规划脑图 export const GetPlanMinderUrl = '/test-plan/mind/data'; diff --git a/frontend/src/models/testPlan/testPlan.ts b/frontend/src/models/testPlan/testPlan.ts index 62f70c85d3..4c5e95d9fd 100644 --- a/frontend/src/models/testPlan/testPlan.ts +++ b/frontend/src/models/testPlan/testPlan.ts @@ -266,6 +266,7 @@ export interface PlanDetailApiCaseQueryParams extends TableQueryParams, TestPlan versionId?: string; refId?: string; collectionId?: string; + treeType?: 'MODULE' | 'COLLECTION'; // 视图类型:模块是MODULE,测试集是COLLECTION } export interface PlanDetailApiCaseTreeParams { @@ -298,7 +299,7 @@ export interface BatchApiCaseParams extends BatchActionQueryParams { testPlanId: string; moduleIds?: string[]; collectionId?: string; // 测试集id - protocols: string[]; + protocols?: string[]; // 接口用例传protocols 接口场景不传 } export interface BatchUpdateApiCaseExecutorParams extends BatchApiCaseParams { @@ -309,24 +310,34 @@ export interface SortApiCaseParams extends DragSortParams { testCollectionId: string; // 测试集id } -// TODO: 联调 +// 计划详情-接口场景 +export interface PlanDetailApiScenarioQueryParams extends TableQueryParams, TestPlanBaseParams { + scenarioId?: string; + moduleIds?: string[]; + versionId?: string; + refId?: string; + collectionId?: string; + treeType?: 'MODULE' | 'COLLECTION'; // 视图类型:模块是MODULE,测试集是COLLECTION +} + export interface PlanDetailApiScenarioItem { id: string; num: string; name: string; + priority: string; + projectId: string; + projectName: string; + environmentId: string; + environmentName: string; moduleId: string; - versionName: string; createUser: string; createUserName: string; lastExecResult: LastExecuteResults; lastExecTime: number; executeUser: string; executeUserName: string; - bugCount: number; - customFields: customFieldsItem[]; // 自定义字段集合 - caseId: string; - testPlanId: string; - lastExecResultReportId: string; + lastExecReportId: string; // 报告id + testPlanCollectionId: string; // 测试集id } // 执行历史 TODO 联调 diff --git a/frontend/src/views/test-plan/report/detail/component/apiCaseTable.vue b/frontend/src/views/test-plan/report/detail/component/apiCaseTable.vue index 574e6f898a..e68d83e430 100644 --- a/frontend/src/views/test-plan/report/detail/component/apiCaseTable.vue +++ b/frontend/src/views/test-plan/report/detail/component/apiCaseTable.vue @@ -155,7 +155,7 @@ function showReport(record: PlanDetailApiScenarioItem) { reportVisible.value = true; - apiReportId.value = record.lastExecResultReportId; // TODO 联调 + apiReportId.value = record.lastExecReportId; } await tableStore.initColumn(TableKeyEnum.TEST_PLAN_REPORT_DETAIL_BUG, columns, 'drawer'); diff --git a/frontend/src/views/test-plan/report/detail/component/scenarioCaseTable.vue b/frontend/src/views/test-plan/report/detail/component/scenarioCaseTable.vue index fcee4ffef6..b4e4380f34 100644 --- a/frontend/src/views/test-plan/report/detail/component/scenarioCaseTable.vue +++ b/frontend/src/views/test-plan/report/detail/component/scenarioCaseTable.vue @@ -146,7 +146,7 @@ function showReport(record: PlanDetailApiScenarioItem) { reportVisible.value = true; - apiReportId.value = record.lastExecResultReportId; // TODO 联调 + apiReportId.value = record.lastExecReportId; } await tableStore.initColumn(TableKeyEnum.TEST_PLAN_REPORT_DETAIL_BUG, columns, 'drawer'); diff --git a/frontend/src/views/test-plan/testPlan/detail/apiCase/components/caseTable.vue b/frontend/src/views/test-plan/testPlan/detail/apiCase/components/caseTable.vue index f2ca869073..eec2076bc6 100644 --- a/frontend/src/views/test-plan/testPlan/detail/apiCase/components/caseTable.vue +++ b/frontend/src/views/test-plan/testPlan/detail/apiCase/components/caseTable.vue @@ -349,6 +349,7 @@ return { keyword: keyword.value, filter: propsRes.value.filter, + treeType: props.treeType, ...commonParams, }; } diff --git a/frontend/src/views/test-plan/testPlan/detail/apiCase/index.vue b/frontend/src/views/test-plan/testPlan/detail/apiCase/index.vue index 3c7cbaa9d4..4ce6fb8254 100644 --- a/frontend/src/views/test-plan/testPlan/detail/apiCase/index.vue +++ b/frontend/src/views/test-plan/testPlan/detail/apiCase/index.vue @@ -18,7 +18,6 @@ :tree-type="props.treeType" :modules-count="modulesCount" :module-name="moduleName" - :repeat-case="props.repeatCase" :active-module="activeFolderId" :offspring-ids="offspringIds" :module-tree="moduleTree" @@ -46,7 +45,6 @@ import type { PlanDetailApiCaseQueryParams } from '@/models/testPlan/testPlan'; const props = defineProps<{ - repeatCase: boolean; canEdit: boolean; treeType: 'MODULE' | 'COLLECTION'; }>(); diff --git a/frontend/src/views/test-plan/testPlan/detail/apiScenario/components/scenarioTable.vue b/frontend/src/views/test-plan/testPlan/detail/apiScenario/components/scenarioTable.vue index ae0b9d8266..addae409e0 100644 --- a/frontend/src/views/test-plan/testPlan/detail/apiScenario/components/scenarioTable.vue +++ b/frontend/src/views/test-plan/testPlan/detail/apiScenario/components/scenarioTable.vue @@ -30,7 +30,7 @@