fix(测试计划): 功能用例列表-修改执行结果调用接口

This commit is contained in:
teukkk 2024-05-27 19:13:15 +08:00 committed by Craftsman
parent 5f4cbe3b36
commit 01aa4fe633
5 changed files with 5 additions and 15 deletions

View File

@ -16,7 +16,6 @@ import {
deletePlanUrl, deletePlanUrl,
DeleteTestPlanModuleUrl, DeleteTestPlanModuleUrl,
DisassociateCaseUrl, DisassociateCaseUrl,
EditCaseLastExecResultUrl,
ExecuteHistoryUrl, ExecuteHistoryUrl,
followPlanUrl, followPlanUrl,
GenerateReportUrl, GenerateReportUrl,
@ -54,7 +53,6 @@ import type {
BatchFeatureCaseParams, BatchFeatureCaseParams,
BatchUpdateCaseExecutorParams, BatchUpdateCaseExecutorParams,
DisassociateCaseParams, DisassociateCaseParams,
EditLastExecResultParams,
ExecuteHistoryItem, ExecuteHistoryItem,
ExecuteHistoryType, ExecuteHistoryType,
FollowPlanParams, FollowPlanParams,
@ -196,10 +194,6 @@ export function getFeatureCaseModule(planId: string) {
export function disassociateCase(data: DisassociateCaseParams) { export function disassociateCase(data: DisassociateCaseParams) {
return MSR.post({ url: DisassociateCaseUrl, data }); return MSR.post({ url: DisassociateCaseUrl, data });
} }
// 计划详情-功能用例列表-编辑执行结果
export function editLastExecResult(data: EditLastExecResultParams) {
return MSR.post({ url: EditCaseLastExecResultUrl, data });
}
// 计划详情-功能用例列表-拖拽排序 // 计划详情-功能用例列表-拖拽排序
export const sortFeatureCase = (data: SortFeatureCaseParams) => { export const sortFeatureCase = (data: SortFeatureCaseParams) => {
return MSR.post({ url: SortFeatureCaseUrl, data }); return MSR.post({ url: SortFeatureCaseUrl, data });

View File

@ -56,8 +56,6 @@ export const GetFeatureCaseModuleCountUrl = '/test-plan/functional/case/module/c
export const GetFeatureCaseModuleUrl = '/test-plan/functional/case/tree'; export const GetFeatureCaseModuleUrl = '/test-plan/functional/case/tree';
// 计划详情-功能用例列表-拖拽排序 // 计划详情-功能用例列表-拖拽排序
export const SortFeatureCaseUrl = '/test-plan/functional/case/sort'; export const SortFeatureCaseUrl = '/test-plan/functional/case/sort';
// 计划详情-功能用例列表-编辑执行结果
export const EditCaseLastExecResultUrl = '/test-plan/functional/case/edit';
// 计划详情-功能用例-取消关联用例 // 计划详情-功能用例-取消关联用例
export const DisassociateCaseUrl = '/test-plan/functional/case/disassociate'; export const DisassociateCaseUrl = '/test-plan/functional/case/disassociate';
// 计划详情-功能用例-批量取消关联用例 // 计划详情-功能用例-批量取消关联用例

View File

@ -238,7 +238,7 @@
if (titleMatches || filteredChildren.length > 0) { if (titleMatches || filteredChildren.length > 0) {
result.push({ result.push({
...item, ...item,
expanded: titleMatches || filteredChildren.length > 0, expanded: true,
[props.fieldNames.children]: filteredChildren, [props.fieldNames.children]: filteredChildren,
}); });
} }

View File

@ -160,10 +160,6 @@ export interface DisassociateCaseParams {
id: string; id: string;
} }
export interface EditLastExecResultParams extends DisassociateCaseParams {
lastExecResult: string;
}
export interface BatchFeatureCaseParams extends BatchActionQueryParams { export interface BatchFeatureCaseParams extends BatchActionQueryParams {
testPlanId: string; testPlanId: string;
moduleIds?: string[]; moduleIds?: string[];

View File

@ -186,9 +186,9 @@
batchExecuteCase, batchExecuteCase,
batchUpdateCaseExecutor, batchUpdateCaseExecutor,
disassociateCase, disassociateCase,
editLastExecResult,
getPlanDetailFeatureCaseList, getPlanDetailFeatureCaseList,
GetTestPlanUsers, GetTestPlanUsers,
runFeatureCase,
sortFeatureCase, sortFeatureCase,
} from '@/api/modules/test-plan/testPlan'; } from '@/api/modules/test-plan/testPlan';
import { defaultExecuteForm } from '@/config/testPlan'; import { defaultExecuteForm } from '@/config/testPlan';
@ -502,9 +502,11 @@
// //
async function handleEditLastExecResult(record: PlanDetailFeatureCaseItem) { async function handleEditLastExecResult(record: PlanDetailFeatureCaseItem) {
try { try {
await editLastExecResult({ await runFeatureCase({
id: record.id, id: record.id,
projectId: appStore.currentProjectId,
testPlanId: props.planId, testPlanId: props.planId,
caseId: record.caseId,
lastExecResult: record.lastExecResult, lastExecResult: record.lastExecResult,
}); });
Message.success(t('common.updateSuccess')); Message.success(t('common.updateSuccess'));