diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseTestPlanDTO.java b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseTestPlanDTO.java index 3dfa198edd..882d549c7f 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseTestPlanDTO.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseTestPlanDTO.java @@ -8,9 +8,12 @@ import lombok.Data; public class FunctionalCaseTestPlanDTO extends TestPlanFunctionalCase { @Schema(description = "测试计划ID") - private String testPlanNum; + private Long testPlanNum; - @Schema(description = "所属项目") + @Schema(description = "测试计划名称") + private String testPlanName; + + @Schema(description = "所属项目名称") private String projectName; @Schema(description = "计划状态") diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.xml b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.xml index d9c3d0892e..abd5d390c2 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.xml +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.xml @@ -58,7 +58,7 @@ @@ -133,5 +136,22 @@ - + + + + + + + AND tp.status in + + + + AND tpfc.last_exec_result in + + + + + + + \ No newline at end of file diff --git a/frontend/src/api/modules/case-management/featureCase.ts b/frontend/src/api/modules/case-management/featureCase.ts index b820874d56..b353b04c44 100644 --- a/frontend/src/api/modules/case-management/featureCase.ts +++ b/frontend/src/api/modules/case-management/featureCase.ts @@ -36,6 +36,7 @@ import { GetAssociatedDebuggerUrl, GetAssociatedDrawerCaseUrl, GetAssociatedFilePageUrl, + GetAssociatedTestPlanUrl, GetAssociationPublicCaseModuleCountUrl, GetAssociationPublicCasePageUrl, GetAssociationPublicModuleTreeUrl, @@ -96,6 +97,7 @@ import type { } from '@/models/caseManagement/featureCase'; import type { CommonList, ModuleTreeNode, MoveModules, TableQueryParams } from '@/models/common'; import { ProjectListItem } from '@/models/setting/project'; +import { AssociateFunctionalCaseItem, TestPlanItem } from '@/models/testPlan/testPlan'; // 获取模块树 export function getCaseModuleTree(params: TableQueryParams) { @@ -428,4 +430,9 @@ export function getAssociatedProjectOptions(orgId: string, module: string) { return MSR.get({ url: `${associatedProjectOptionsUrl}/${orgId}/${module}` }); } +// 获取已关联测试计划列表 +export function getLinkedCaseTestPlanList(data: TableQueryParams) { + return MSR.post>({ url: GetAssociatedTestPlanUrl, data }); +} + export default {}; diff --git a/frontend/src/api/requrls/case-management/featureCase.ts b/frontend/src/api/requrls/case-management/featureCase.ts index 856e93f6be..83721fd205 100644 --- a/frontend/src/api/requrls/case-management/featureCase.ts +++ b/frontend/src/api/requrls/case-management/featureCase.ts @@ -151,3 +151,6 @@ export const getChangeHistoryListUrl = '/functional/case/operation-history'; export const cancelDisassociate = '/functional/case/test/disassociate/case'; // 关联用例关联功能用例项目下拉 export const associatedProjectOptionsUrl = '/project/list/options'; + +// 获取详情已关联测试计划列表 +export const GetAssociatedTestPlanUrl = '/functional/case/test/has/associate/plan/page'; diff --git a/frontend/src/models/testPlan/testPlan.ts b/frontend/src/models/testPlan/testPlan.ts index 686143cea7..a1fd57135c 100644 --- a/frontend/src/models/testPlan/testPlan.ts +++ b/frontend/src/models/testPlan/testPlan.ts @@ -21,6 +21,14 @@ export interface TestPlanItem { groupId: string; } +export interface AssociateFunctionalCaseItem { + testPlanId: string; + testPlanNum: number; + testPlanName: string; + projectName: string; + planStatus: string; +} + export interface ResourcesItem { id: string; name: string; diff --git a/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue b/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue index 641bbfcbd6..b968cec7fd 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue @@ -141,7 +141,7 @@