diff --git a/frontend/src/api/modules/test-plan/testPlan.ts b/frontend/src/api/modules/test-plan/testPlan.ts index bea5e7a1d9..c482633717 100644 --- a/frontend/src/api/modules/test-plan/testPlan.ts +++ b/frontend/src/api/modules/test-plan/testPlan.ts @@ -114,7 +114,6 @@ import type { PlanMinderNode, RunFeatureCaseParams, SortApiCaseParams, - SortFeatureCaseParams, TestPlanBaseParams, TestPlanDetail, TestPlanItem, @@ -248,7 +247,7 @@ export function disassociateCase(data: DisassociateCaseParams) { return MSR.post({ url: DisassociateCaseUrl, data }); } // 计划详情-功能用例列表-拖拽排序 -export const sortFeatureCase = (data: SortFeatureCaseParams) => { +export const sortFeatureCase = (data: SortApiCaseParams) => { return MSR.post({ url: SortFeatureCaseUrl, data }); }; // 计划详情-功能用例列表-批量取消关联用例 diff --git a/frontend/src/models/testPlan/testPlan.ts b/frontend/src/models/testPlan/testPlan.ts index c4f6763162..11d90d8682 100644 --- a/frontend/src/models/testPlan/testPlan.ts +++ b/frontend/src/models/testPlan/testPlan.ts @@ -210,9 +210,6 @@ export interface BatchUpdateCaseExecutorParams extends BatchFeatureCaseParams { userId: string; } -export interface SortFeatureCaseParams extends DragSortParams { - testPlanId: string; -} export type RunModeType = 'SERIAL' | 'PARALLEL'; export interface PassRateCountDetail { id: string; diff --git a/frontend/src/views/test-plan/testPlan/components/batchApiMoveModal.vue b/frontend/src/views/test-plan/testPlan/components/batchApiMoveModal.vue index b84e317f6f..f413ec328e 100644 --- a/frontend/src/views/test-plan/testPlan/components/batchApiMoveModal.vue +++ b/frontend/src/views/test-plan/testPlan/components/batchApiMoveModal.vue @@ -83,6 +83,11 @@ }) ); + function handleCancel() { + visible.value = false; + form.value = { targetCollectionId: '' }; + } + async function handleMove() { formRef.value?.validate(async (errors) => { if (!errors) { @@ -92,6 +97,7 @@ ...props.params, ...form.value, }); + handleCancel(); Message.success(t('common.moveSuccess')); emit('loadList'); } catch (error) { @@ -103,9 +109,4 @@ } }); } - - function handleCancel() { - visible.value = false; - form.value = { targetCollectionId: '' }; - } 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 ec4795fa16..ff9a275b6a 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 @@ -36,13 +36,11 @@ @@ -432,6 +430,7 @@ const reportVisible = ref(false); const reportId = ref(''); function showReport(record: PlanDetailApiCaseItem) { + if (!record.lastExecReportId || record.lastExecResult === LastExecuteResults.PENDING) return; reportVisible.value = true; reportId.value = record.lastExecReportId; } 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 15edd1cc3b..01a5f6da68 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 @@ -36,13 +36,11 @@ @@ -423,6 +421,7 @@ const reportVisible = ref(false); const reportId = ref(''); function showReport(record: PlanDetailApiScenarioItem) { + if (!record.lastExecReportId || record.lastExecResult === LastExecuteResults.PENDING) return; reportVisible.value = true; reportId.value = record.lastExecReportId; } 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 index 435643b885..9ee2c32c4e 100644 --- a/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue +++ b/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue @@ -468,7 +468,7 @@ // 拖拽排序 async function handleDragChange(params: DragSortParams) { try { - await sortFeatureCase({ ...params, testPlanId: props.planId }); + await sortFeatureCase({ ...params, testCollectionId: collectionId.value }); Message.success(t('caseManagement.featureCase.sortSuccess')); loadCaseList(); } catch (error) {