fix(测试计划): 测试计划详情-修改功能用例拖拽排序传参&去掉执行结果icon

This commit is contained in:
teukkk 2024-06-13 17:56:37 +08:00 committed by 刘瑞斌
parent 4cb1df43c3
commit 5f0cea3148
6 changed files with 20 additions and 25 deletions

View File

@ -114,7 +114,6 @@ import type {
PlanMinderNode, PlanMinderNode,
RunFeatureCaseParams, RunFeatureCaseParams,
SortApiCaseParams, SortApiCaseParams,
SortFeatureCaseParams,
TestPlanBaseParams, TestPlanBaseParams,
TestPlanDetail, TestPlanDetail,
TestPlanItem, TestPlanItem,
@ -248,7 +247,7 @@ export function disassociateCase(data: DisassociateCaseParams) {
return MSR.post({ url: DisassociateCaseUrl, data }); return MSR.post({ url: DisassociateCaseUrl, data });
} }
// 计划详情-功能用例列表-拖拽排序 // 计划详情-功能用例列表-拖拽排序
export const sortFeatureCase = (data: SortFeatureCaseParams) => { export const sortFeatureCase = (data: SortApiCaseParams) => {
return MSR.post({ url: SortFeatureCaseUrl, data }); return MSR.post({ url: SortFeatureCaseUrl, data });
}; };
// 计划详情-功能用例列表-批量取消关联用例 // 计划详情-功能用例列表-批量取消关联用例

View File

@ -210,9 +210,6 @@ export interface BatchUpdateCaseExecutorParams extends BatchFeatureCaseParams {
userId: string; userId: string;
} }
export interface SortFeatureCaseParams extends DragSortParams {
testPlanId: string;
}
export type RunModeType = 'SERIAL' | 'PARALLEL'; export type RunModeType = 'SERIAL' | 'PARALLEL';
export interface PassRateCountDetail { export interface PassRateCountDetail {
id: string; id: string;

View File

@ -83,6 +83,11 @@
}) })
); );
function handleCancel() {
visible.value = false;
form.value = { targetCollectionId: '' };
}
async function handleMove() { async function handleMove() {
formRef.value?.validate(async (errors) => { formRef.value?.validate(async (errors) => {
if (!errors) { if (!errors) {
@ -92,6 +97,7 @@
...props.params, ...props.params,
...form.value, ...form.value,
}); });
handleCancel();
Message.success(t('common.moveSuccess')); Message.success(t('common.moveSuccess'));
emit('loadList'); emit('loadList');
} catch (error) { } catch (error) {
@ -103,9 +109,4 @@
} }
}); });
} }
function handleCancel() {
visible.value = false;
form.value = { targetCollectionId: '' };
}
</script> </script>

View File

@ -36,13 +36,11 @@
<ExecuteResult :execute-result="filterContent.key" /> <ExecuteResult :execute-result="filterContent.key" />
</template> </template>
<template #lastExecResult="{ record }"> <template #lastExecResult="{ record }">
<ExecuteResult :execute-result="record.lastExecResult" /> <ExecuteResult
<MsIcon :execute-result="record.lastExecResult"
v-show="record.lastExecResult !== LastExecuteResults.PENDING" :class="[
v-permission="['PROJECT_TEST_PLAN:READ']" !record.lastExecReportId || record.lastExecResult === LastExecuteResults.PENDING ? '' : 'cursor-pointer',
type="icon-icon_take-action_outlined" ]"
class="ml-[8px] cursor-pointer text-[rgb(var(--primary-5))]"
size="16"
@click="showReport(record)" @click="showReport(record)"
/> />
</template> </template>
@ -432,6 +430,7 @@
const reportVisible = ref(false); const reportVisible = ref(false);
const reportId = ref(''); const reportId = ref('');
function showReport(record: PlanDetailApiCaseItem) { function showReport(record: PlanDetailApiCaseItem) {
if (!record.lastExecReportId || record.lastExecResult === LastExecuteResults.PENDING) return;
reportVisible.value = true; reportVisible.value = true;
reportId.value = record.lastExecReportId; reportId.value = record.lastExecReportId;
} }

View File

@ -36,13 +36,11 @@
<ExecuteResult :execute-result="filterContent.key" /> <ExecuteResult :execute-result="filterContent.key" />
</template> </template>
<template #lastExecResult="{ record }"> <template #lastExecResult="{ record }">
<ExecuteResult :execute-result="record.lastExecResult" /> <ExecuteResult
<MsIcon :execute-result="record.lastExecResult"
v-show="record.lastExecResult !== LastExecuteResults.PENDING" :class="[
v-permission="['PROJECT_TEST_PLAN:READ']" !record.lastExecReportId || record.lastExecResult === LastExecuteResults.PENDING ? '' : 'cursor-pointer',
type="icon-icon_take-action_outlined" ]"
class="ml-[8px] cursor-pointer text-[rgb(var(--primary-5))]"
size="16"
@click="showReport(record)" @click="showReport(record)"
/> />
</template> </template>
@ -423,6 +421,7 @@
const reportVisible = ref(false); const reportVisible = ref(false);
const reportId = ref(''); const reportId = ref('');
function showReport(record: PlanDetailApiScenarioItem) { function showReport(record: PlanDetailApiScenarioItem) {
if (!record.lastExecReportId || record.lastExecResult === LastExecuteResults.PENDING) return;
reportVisible.value = true; reportVisible.value = true;
reportId.value = record.lastExecReportId; reportId.value = record.lastExecReportId;
} }

View File

@ -468,7 +468,7 @@
// //
async function handleDragChange(params: DragSortParams) { async function handleDragChange(params: DragSortParams) {
try { try {
await sortFeatureCase({ ...params, testPlanId: props.planId }); await sortFeatureCase({ ...params, testCollectionId: collectionId.value });
Message.success(t('caseManagement.featureCase.sortSuccess')); Message.success(t('caseManagement.featureCase.sortSuccess'));
loadCaseList(); loadCaseList();
} catch (error) { } catch (error) {