diff --git a/frontend/src/models/testPlan/testPlan.ts b/frontend/src/models/testPlan/testPlan.ts index 5afc44a1cf..e4c8b08602 100644 --- a/frontend/src/models/testPlan/testPlan.ts +++ b/frontend/src/models/testPlan/testPlan.ts @@ -5,7 +5,7 @@ import type { saveParams } from '@/components/business/ms-associate-case/types'; import type { customFieldsItem } from '@/models/caseManagement/featureCase'; import type { TableQueryParams } from '@/models/common'; import { BatchApiParams, DragSortParams } from '@/models/common'; -import { LastExecuteResults } from '@/enums/caseEnum'; +import { CaseLinkEnum, LastExecuteResults } from '@/enums/caseEnum'; import { type PlanMinderAssociateType, type PlanMinderCollectionType, @@ -136,16 +136,20 @@ export interface UseCountType { testProgress: string; // 测试进度 } +export interface RelateCasesType { + id: string; + bugId: string; + name: string; + projectId: string; + type: CaseLinkEnum; +} + // 计划详情缺陷列表 export interface PlanDetailBugItem { id: string; num: string; title: string; - relateCases: { - id: string; - bugId: string; - name: string; - }[]; + relateCases: RelateCasesType[]; handleUser: string; status: string; createUser: string; diff --git a/frontend/src/views/test-plan/report/detail/component/system-card/bugTable.vue b/frontend/src/views/test-plan/report/detail/component/system-card/bugTable.vue index 22626b9c30..b5d572e7be 100644 --- a/frontend/src/views/test-plan/report/detail/component/system-card/bugTable.vue +++ b/frontend/src/views/test-plan/report/detail/component/system-card/bugTable.vue @@ -81,7 +81,7 @@ }, { title: 'bugManagement.status', - dataIndex: 'status', + dataIndex: 'statusName', width: 100, showTooltip: true, }, diff --git a/frontend/src/views/test-plan/report/detail/component/system-card/testTableIndex.vue b/frontend/src/views/test-plan/report/detail/component/system-card/testTableIndex.vue index c4acfaf4b0..39a350e532 100644 --- a/frontend/src/views/test-plan/report/detail/component/system-card/testTableIndex.vue +++ b/frontend/src/views/test-plan/report/detail/component/system-card/testTableIndex.vue @@ -6,7 +6,7 @@ {{ t('ms.case.associate.testSet') }} >('existedDefect', ref(0)); const tableRef = ref>(); watch( @@ -410,6 +411,18 @@ } ); + function getLinkAction() { + return existedDefect.value + ? [ + { + label: 'caseManagement.featureCase.linkDefect', + eventTag: 'linkDefect', + permission: ['PROJECT_TEST_PLAN:READ+EXECUTE', 'PROJECT_BUG:READ'], + }, + ] + : []; + } + const batchActions = computed(() => { return { baseAction: [ @@ -426,15 +439,11 @@ eventTag: 'disassociate', permission: ['PROJECT_TEST_PLAN:READ+ASSOCIATION'], }, - { - label: 'caseManagement.featureCase.linkDefect', - eventTag: 'linkDefect', - permission: ['PROJECT_BUG:READ'], - }, + ...getLinkAction(), { label: 'testPlan.featureCase.noBugDataNewBug', eventTag: 'newBug', - permission: ['PROJECT_BUG:READ+ADD'], + permission: ['PROJECT_TEST_PLAN:READ+EXECUTE', 'PROJECT_BUG:READ+ADD'], }, ], }; @@ -677,7 +686,6 @@ const associatedCaseId = ref(''); const testPlanCaseId = ref(''); const lastExecuteReportId = ref(''); - const existedDefect = inject>('existedDefect', ref(0)); const showCreateBugDrawer = ref(false); const isBatchAssociateOrCreate = ref(false); const caseTitle = ref(''); 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 81bc5926bc..3ab038d17c 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 @@ -392,6 +392,18 @@ tableRef.value?.initColumn(columns.value); } ); + const existedDefect = inject>('existedDefect', ref(0)); + function getLinkAction() { + return existedDefect.value + ? [ + { + label: 'caseManagement.featureCase.linkDefect', + eventTag: 'linkDefect', + permission: ['PROJECT_TEST_PLAN:READ+EXECUTE', 'PROJECT_BUG:READ'], + }, + ] + : []; + } const batchActions = computed(() => { return { @@ -409,15 +421,11 @@ eventTag: 'disassociate', permission: ['PROJECT_TEST_PLAN:READ+ASSOCIATION'], }, - { - label: 'caseManagement.featureCase.linkDefect', - eventTag: 'linkDefect', - permission: ['PROJECT_BUG:READ'], - }, + ...getLinkAction(), { label: 'testPlan.featureCase.noBugDataNewBug', eventTag: 'newBug', - permission: ['PROJECT_BUG:READ+ADD'], + permission: ['PROJECT_TEST_PLAN:READ+EXECUTE', 'PROJECT_BUG:READ+ADD'], }, ], }; @@ -662,7 +670,6 @@ const batchUpdateParams = ref(); const batchMoveModalVisible = ref(false); - const existedDefect = inject>('existedDefect', ref(0)); const isBatchAssociateOrCreate = ref(false); const showLinkBugDrawer = ref(false); const associatedCaseId = ref(''); diff --git a/frontend/src/views/test-plan/testPlan/detail/bugManagement/caseCountPopover.vue b/frontend/src/views/test-plan/testPlan/detail/bugManagement/caseCountPopover.vue index f0e0c50cd4..b2b6b94526 100644 --- a/frontend/src/views/test-plan/testPlan/detail/bugManagement/caseCountPopover.vue +++ b/frontend/src/views/test-plan/testPlan/detail/bugManagement/caseCountPopover.vue @@ -7,7 +7,7 @@