diff --git a/frontend/src/api/modules/test-plan/testPlan.ts b/frontend/src/api/modules/test-plan/testPlan.ts index def42b68c9..8522c78720 100644 --- a/frontend/src/api/modules/test-plan/testPlan.ts +++ b/frontend/src/api/modules/test-plan/testPlan.ts @@ -8,6 +8,9 @@ import { batchMovePlanUrl, deletePlanUrl, DeleteTestPlanModuleUrl, + GetFeatureCaseModuleCountUrl, + GetFeatureCaseModuleUrl, + GetPlanDetailFeatureCaseListUrl, getStatisticalCountUrl, GetTestPlanDetailUrl, GetTestPlanListUrl, @@ -25,6 +28,8 @@ import { ModuleTreeNode } from '@/models/common'; import type { AddTestPlanParams, PlanDetailBugItem, + PlanDetailFeatureCaseItem, + PlanDetailFeatureCaseListQueryParams, TestPlanDetail, TestPlanItem, UseCountType, @@ -107,3 +112,15 @@ export function batchMovePlan(data: TableQueryParams) { export function planDetailBugPage(data: TableQueryParams) { return MSR.post>({ url: planDetailBugPageUrl, data }); } +// 计划详情-功能用例列表 +export function getPlanDetailFeatureCaseList(data: PlanDetailFeatureCaseListQueryParams) { + return MSR.post>({ url: GetPlanDetailFeatureCaseListUrl, data }); +} +// 计划详情-功能用例-获取模块数量 +export function getFeatureCaseModuleCount(data: PlanDetailFeatureCaseListQueryParams) { + return MSR.post({ url: GetFeatureCaseModuleCountUrl, data }); +} +// 计划详情-功能用例模块树 +export function getFeatureCaseModule(planId: string) { + return MSR.get({ url: `${GetFeatureCaseModuleUrl}/${planId}` }); +} diff --git a/frontend/src/api/requrls/test-plan/testPlan.ts b/frontend/src/api/requrls/test-plan/testPlan.ts index 40389809b3..a5354769b7 100644 --- a/frontend/src/api/requrls/test-plan/testPlan.ts +++ b/frontend/src/api/requrls/test-plan/testPlan.ts @@ -32,3 +32,9 @@ export const batchCopyPlanUrl = '/test-plan/batch/copy'; export const batchMovePlanUrl = '/test-plan/batch/move'; // 计划详情缺陷管理列表 export const planDetailBugPageUrl = '/test-plan/bug/page'; +// 计划详情-功能用例列表 +export const GetPlanDetailFeatureCaseListUrl = '/test-plan/functional/case/page'; +// 计划详情-功能用例-获取模块数量 +export const GetFeatureCaseModuleCountUrl = '/test-plan/functional/case/module/count'; +// 计划详情-功能用例模块树 +export const GetFeatureCaseModuleUrl = '/test-plan/functional/case/tree'; diff --git a/frontend/src/components/business/ms-case-associate/executeResult.vue b/frontend/src/components/business/ms-case-associate/executeResult.vue index d57c0fa025..747471f17f 100644 --- a/frontend/src/components/business/ms-case-associate/executeResult.vue +++ b/frontend/src/components/business/ms-case-associate/executeResult.vue @@ -33,7 +33,7 @@ PASSED: { label: 'PASSED', icon: StatusType.PASSED, - statusText: 'caseManagement.featureCase.passed', + statusText: 'common.success', color: '', }, SKIPPED: { diff --git a/frontend/src/components/pure/ms-table/base-table.vue b/frontend/src/components/pure/ms-table/base-table.vue index a9e45d6563..86edd105db 100644 --- a/frontend/src/components/pure/ms-table/base-table.vue +++ b/frontend/src/components/pure/ms-table/base-table.vue @@ -840,7 +840,7 @@ &::before { content: ''; position: absolute; - z-index: 10; + z-index: 1; width: 14px; height: 8px; } diff --git a/frontend/src/enums/tableEnum.ts b/frontend/src/enums/tableEnum.ts index 13b609b587..078863c656 100644 --- a/frontend/src/enums/tableEnum.ts +++ b/frontend/src/enums/tableEnum.ts @@ -64,6 +64,7 @@ export enum TableKeyEnum { PROJECT_MANAGEMENT_ENV_ALL_PARAM_VARIABLE = 'projectManagementEnvAllParamVariable', TEST_PLAN_ALL_TABLE = 'testPlanAllTable', TEST_PLAN_DETAIL_BUG_TABLE = 'testPlanDetailBug', + TEST_PLAN_DETAIL_FEATURE_CASE_TABLE = 'testPlanDetailFeatureCaseTable', TEST_PLAN_DETAIL_BUG_TABLE_CASE_COUNT = 'testPlanDetailBugCaseCount', TASK_API_CASE_SYSTEM = 'taskCenterApiCaseSystem', TASK_API_CASE_ORGANIZATION = 'taskCenterApiCaseOrganization', diff --git a/frontend/src/locale/zh-CN/common.ts b/frontend/src/locale/zh-CN/common.ts index 32dbf3add5..1c50880908 100644 --- a/frontend/src/locale/zh-CN/common.ts +++ b/frontend/src/locale/zh-CN/common.ts @@ -40,6 +40,7 @@ export default { 'common.saveSuccess': '保存成功', 'common.saveFailed': '保存失败', 'common.linkSuccess': '关联成功', + 'common.cancelLink': '取消关联', 'common.unLinkSuccess': '取消关联成功', 'common.confirmEnable': '确认启用', 'common.confirmDisable': '确认禁用', @@ -169,4 +170,5 @@ export default { 'common.unPass': '不通过', 'common.belongModule': '所属模块', 'common.moreSetting': '更多设置', + 'common.executionResult': '执行结果', }; diff --git a/frontend/src/models/testPlan/testPlan.ts b/frontend/src/models/testPlan/testPlan.ts index 72c8a4711b..0163f2980e 100644 --- a/frontend/src/models/testPlan/testPlan.ts +++ b/frontend/src/models/testPlan/testPlan.ts @@ -1,3 +1,6 @@ +import type { customFieldsItem } from '@/models/caseManagement/featureCase'; +import type { TableQueryParams } from '@/models/common'; + import { BatchApiParams } from '../common'; export type planStatusType = 'PREPARED' | 'UNDERWAY' | 'COMPLETED' | 'ARCHIVED'; @@ -122,4 +125,27 @@ export interface FollowPlanParams { testPlanId: string; } +export interface PlanDetailFeatureCaseItem { + id: string; + num: string; + name: string; + moduleId: string; + versionName: string; + createUser: string; + createUserName: string; + lastExecResult: string; + lastExecTime: number; + executeUser: string; + executeUserName: string; + bugCount: number; + customFields: customFieldsItem[]; // 自定义字段集合 + caseId: string; + testPlanId: string; +} + +export interface PlanDetailFeatureCaseListQueryParams extends TableQueryParams { + testPlanId: string; + projectId: string; +} + export default {}; diff --git a/frontend/src/views/case-management/caseManagementFeature/components/utils.ts b/frontend/src/views/case-management/caseManagementFeature/components/utils.ts index 3e9b634bba..fcd96f1df1 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/utils.ts +++ b/frontend/src/views/case-management/caseManagementFeature/components/utils.ts @@ -5,9 +5,11 @@ import type { MsFileItem } from '@/components/pure/ms-upload/types'; import type { CaseLevel } from '@/components/business/ms-case-associate/types'; import { useI18n } from '@/hooks/useI18n'; +import { findNodePathByKey } from '@/utils'; import { hasAnyPermission } from '@/utils/permission'; import type { AssociatedList, CustomAttributes } from '@/models/caseManagement/featureCase'; +import { ModuleTreeNode } from '@/models/common'; import { StatusType } from '@/enums/caseEnum'; const { t } = useI18n(); @@ -62,7 +64,7 @@ export const executionResultMap: Record = { PASSED: { key: 'PASSED', icon: StatusType.PASSED, - statusText: t('caseManagement.featureCase.passed'), + statusText: t('common.success'), color: '', }, /* SKIPPED: { @@ -130,6 +132,18 @@ export function getCaseLevels(customFields: CustomAttributes[]): CaseLevel { ); } +// 获取对应模块name +export function getModules(moduleIds: string, treeData: ModuleTreeNode[]) { + const modules = findNodePathByKey(treeData, moduleIds, undefined, 'id'); + if (modules) { + const moduleName = (modules || [])?.treePath.map((item: any) => item.name); + if (moduleName.length === 1) { + return moduleName[0]; + } + return `/${moduleName.join('/')}`; + } +} + // 处理自定义字段 export function getTableFields(customFields: CustomAttributes[], itemDataIndex: MsTableColumnData, userId: string) { const multipleExcludes = ['MULTIPLE_SELECT', 'CHECKBOX', 'MULTIPLE_MEMBER']; diff --git a/frontend/src/views/test-plan/testPlan/components/associateDrawer.vue b/frontend/src/views/test-plan/testPlan/components/associateDrawer.vue index 890ae34946..d180c14f45 100644 --- a/frontend/src/views/test-plan/testPlan/components/associateDrawer.vue +++ b/frontend/src/views/test-plan/testPlan/components/associateDrawer.vue @@ -46,7 +46,7 @@ function saveHandler(params: AssociateCaseRequest) { try { confirmLoading.value = true; - emit('success', { ...params }); + emit('success', { ...params, functionalSelectIds: params.selectIds }); innerVisible.value = false; } catch (error) { // eslint-disable-next-line no-console 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 new file mode 100644 index 0000000000..ccdfa1ade8 --- /dev/null +++ b/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue @@ -0,0 +1,332 @@ + + + + + diff --git a/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTree.vue b/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTree.vue new file mode 100644 index 0000000000..7f85e86fc9 --- /dev/null +++ b/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTree.vue @@ -0,0 +1,203 @@ + + + + + diff --git a/frontend/src/views/test-plan/testPlan/detail/featureCase/index.vue b/frontend/src/views/test-plan/testPlan/detail/featureCase/index.vue new file mode 100644 index 0000000000..20beb66a01 --- /dev/null +++ b/frontend/src/views/test-plan/testPlan/detail/featureCase/index.vue @@ -0,0 +1,69 @@ + + + diff --git a/frontend/src/views/test-plan/testPlan/detail/index.vue b/frontend/src/views/test-plan/testPlan/detail/index.vue index 4953ea79fd..47fac66548 100644 --- a/frontend/src/views/test-plan/testPlan/detail/index.vue +++ b/frontend/src/views/test-plan/testPlan/detail/index.vue @@ -73,6 +73,7 @@ + @@ -88,6 +89,7 @@ import { ActionsItem } from '@/components/pure/ms-table-more-action/types'; import MsStatusTag from '@/components/business/ms-status-tag/index.vue'; import BugManagement from './bugManagement/index.vue'; + import FeatureCase from './featureCase/index.vue'; import passRateLine from '@/views/case-management/caseReview/components/passRateLine.vue'; import { getTestPlanDetail } from '@/api/modules/test-plan/testPlan'; diff --git a/frontend/src/views/test-plan/testPlan/locale/en-US.ts b/frontend/src/views/test-plan/testPlan/locale/en-US.ts index 4ae953d917..3695272b81 100644 --- a/frontend/src/views/test-plan/testPlan/locale/en-US.ts +++ b/frontend/src/views/test-plan/testPlan/locale/en-US.ts @@ -85,4 +85,8 @@ export default { 'testPlan.bugManagement.bugName': 'name', 'testPlan.bugManagement.defectState': 'Defect state', 'testPlan.bugManagement.caseClassification': 'Classification', + 'testPlan.featureCase.bugCount': 'Bug count', + 'testPlan.featureCase.executor': 'Executor', + 'testPlan.featureCase.changeExecutor': 'Change executor', + 'testPlan.featureCase.sort': 'sort', }; diff --git a/frontend/src/views/test-plan/testPlan/locale/zh-CN.ts b/frontend/src/views/test-plan/testPlan/locale/zh-CN.ts index ec90cbee18..bc6762995d 100644 --- a/frontend/src/views/test-plan/testPlan/locale/zh-CN.ts +++ b/frontend/src/views/test-plan/testPlan/locale/zh-CN.ts @@ -83,4 +83,8 @@ export default { 'testPlan.bugManagement.bugName': '名称', 'testPlan.bugManagement.defectState': '缺陷状态', 'testPlan.bugManagement.caseClassification': '用例分类', + 'testPlan.featureCase.bugCount': '缺陷数', + 'testPlan.featureCase.executor': '执行人', + 'testPlan.featureCase.changeExecutor': '修改执行人', + 'testPlan.featureCase.sort': '排序', };