diff --git a/backend/framework/provider/src/main/java/io/metersphere/request/AssociateBugPageRequest.java b/backend/framework/provider/src/main/java/io/metersphere/request/AssociateBugPageRequest.java
index 90453f8b47..54d3b7075d 100644
--- a/backend/framework/provider/src/main/java/io/metersphere/request/AssociateBugPageRequest.java
+++ b/backend/framework/provider/src/main/java/io/metersphere/request/AssociateBugPageRequest.java
@@ -21,9 +21,11 @@ import java.util.Map;
public class AssociateBugPageRequest extends BaseProviderCondition {
@Schema(description = "用例id", requiredMode = Schema.RequiredMode.REQUIRED)
- @NotBlank(message = "{functional_case.id.not_blank}")
private String caseId;
+ @Schema(description = "关联测试计划用例ID", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String testPlanCaseId;
+
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{functional_case.project_id.not_blank}")
private String projectId;
diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml
index 685c366133..4b6ee25a4c 100644
--- a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml
+++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml
@@ -136,6 +136,9 @@
and brc.case_id = #{request.caseId}
+
+ and brc.test_plan_case_id = #{request.testPlanCaseId}
+
and b.title like concat('%', #{request.keyword},'%')
diff --git a/frontend/src/models/bug-management.ts b/frontend/src/models/bug-management.ts
index 42fb880970..8c6d8d84c2 100644
--- a/frontend/src/models/bug-management.ts
+++ b/frontend/src/models/bug-management.ts
@@ -17,6 +17,7 @@ export interface BugListItem {
createTime: string; // 创建时间
updateTime: string; // 更新时间
deleted: boolean; // 删除标志
+ testPlanId: string; // 测试计划ID
}
export interface BugOptionItem {
diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue
index d853e2c92a..639b2894aa 100644
--- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue
+++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue
@@ -36,14 +36,14 @@
t('caseManagement.featureCase.testPlanLinkList')
}}
-
+
+
+ {{ record.testPlanName }}
+
- {{ t('caseManagement.caseReview.tableNoData') }}
-
- {{ t('caseManagement.featureCase.createDefect') }}
-
+ {{ t('caseManagement.caseReview.tableNoDataNoPermission') }}
@@ -219,6 +219,7 @@
* @description 用例管理-详情抽屉-tab-缺陷
*/
import { ref } from 'vue';
+ import { useRoute, useRouter } from 'vue-router';
import { Message } from '@arco-design/web-vue';
import MsButton from '@/components/pure/ms-button/index.vue';
@@ -240,8 +241,9 @@
import useFeatureCaseStore from '@/store/modules/case/featureCase';
import { hasAnyPermission } from '@/utils/permission';
- import { BugOptionItem } from '@/models/bug-management';
+ import { BugListItem, BugOptionItem } from '@/models/bug-management';
import type { TableQueryParams } from '@/models/common';
+ import { TestPlanRouteEnum } from '@/enums/routeEnum';
const featureCaseStore = useFeatureCaseStore();
@@ -266,6 +268,9 @@
const severityFilterValue = ref([]);
const severityColumnId = ref('');
+ const router = useRouter();
+ const route = useRoute();
+
const columns: MsTableColumn = [
{
title: 'caseManagement.featureCase.tableColumnID',
@@ -341,7 +346,7 @@
const testPlanColumns: MsTableColumn = [
{
title: 'caseManagement.featureCase.tableColumnID',
- dataIndex: 'id',
+ dataIndex: 'num',
width: 200,
showInTable: true,
showTooltip: true,
@@ -360,8 +365,8 @@
},
{
title: 'caseManagement.featureCase.planName',
- slotName: 'testPlan',
- dataIndex: 'testPlan',
+ slotName: 'testPlanName',
+ dataIndex: 'testPlanName',
showInTable: true,
showTooltip: true,
width: 300,
@@ -378,6 +383,16 @@
ellipsis: true,
showDrag: false,
},
+ {
+ title: 'caseManagement.featureCase.updateUser',
+ slotName: 'handleUserName',
+ dataIndex: 'handleUserName',
+ titleSlotName: 'handleUserFilter',
+ showInTable: true,
+ showTooltip: true,
+ width: 300,
+ ellipsis: true,
+ },
];
const {
@@ -438,7 +453,11 @@
const { msPagination } = linkPropsRes.value;
featureCaseStore.setListCount(featureCaseStore.activeTab, msPagination?.total || 0);
} else {
- setTestPlanListParams({ keyword: keyword.value, projectId: appStore.currentProjectId, caseId: props.caseId });
+ setTestPlanListParams({
+ keyword: keyword.value,
+ projectId: appStore.currentProjectId,
+ testPlanCaseId: props.caseId,
+ });
await testPlanLinkList();
featureCaseStore.getCaseCounts(props.caseId);
}
@@ -534,12 +553,25 @@
}
function changeHandler() {
- console.log(keyword.value);
if (keyword.value.trim().length === 0) {
getFetch();
}
}
+ // 去测试计划页面
+ function goToPlan(record: BugListItem) {
+ router.push({
+ name: TestPlanRouteEnum.TEST_PLAN_INDEX,
+ query: {
+ ...route.query,
+ id: record.testPlanId,
+ },
+ state: {
+ params: JSON.stringify(setTestPlanListParams()),
+ },
+ });
+ }
+
watch(
() => props.caseId,
(val) => {