fix(测试用例&测试计划): 用例详情-修复自动下一条顺序不对的缺陷
--bug=1045034 --user=吕梦园 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001045034
This commit is contained in:
parent
48897e83ac
commit
d82745cd98
|
@ -86,6 +86,8 @@
|
|||
</a-spin>
|
||||
</div>
|
||||
<a-spin :loading="caseDetailLoading" class="relative flex flex-1 flex-col overflow-hidden">
|
||||
<MsEmpty v-if="!caseList.length" />
|
||||
<template v-else>
|
||||
<div class="content-center">
|
||||
<div class="rounded-[var(--border-radius-small)] bg-[var(--color-text-n9)] p-[16px]">
|
||||
<div class="mb-[12px] flex items-center">
|
||||
|
@ -272,6 +274,7 @@
|
|||
@done="reviewDone"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</a-spin>
|
||||
</div>
|
||||
</MsCard>
|
||||
|
@ -524,6 +527,7 @@
|
|||
watch(
|
||||
() => activeCaseId.value,
|
||||
() => {
|
||||
console.log('🤔️ =>', activeCaseId.value);
|
||||
loadCaseDetail();
|
||||
initReviewerAndStatus();
|
||||
initReviewHistoryList();
|
||||
|
@ -546,10 +550,28 @@
|
|||
);
|
||||
}
|
||||
|
||||
async function reviewDone() {
|
||||
async function reviewDone(status: string) {
|
||||
if (autoNext.value) {
|
||||
// 自动下一个,更改激活的 id会刷新详情
|
||||
const index = caseList.value.findIndex((e) => e.caseId === activeCaseId.value);
|
||||
|
||||
// 如果过滤的状态和评审状态不一样,则这条将从当前列表排除
|
||||
const oneMissingCase = type.value !== '' && status !== type.value;
|
||||
if (oneMissingCase) {
|
||||
if ((pageNation.value.current - 1) * pageNation.value.pageSize + index + 1 < pageNation.value.total) {
|
||||
// 不是最后一个
|
||||
await loadCaseList();
|
||||
activeCaseId.value = caseList.value[index].caseId;
|
||||
} else {
|
||||
// 是最后一个,如果列表还有其他数据,则选中第一条;如果没有其他数据,则显示暂无数据
|
||||
await loadCaseList();
|
||||
if (caseList.value.length > 1) {
|
||||
activeCaseId.value = caseList.value[0].caseId;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (index < caseList.value.length - 1) {
|
||||
await loadCaseList();
|
||||
activeCaseId.value = caseList.value[index + 1].caseId;
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
if (typeof done === 'function') {
|
||||
done(true);
|
||||
}
|
||||
emit('done');
|
||||
emit('done', params.status);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
|
|
|
@ -59,10 +59,14 @@
|
|||
</div>
|
||||
<!-- 右侧 -->
|
||||
<a-spin :loading="caseDetailLoading" class="relative flex h-full flex-1 flex-col overflow-hidden">
|
||||
<MsEmpty v-if="!caseList.length" />
|
||||
<template v-else>
|
||||
<div class="flex px-[16px] pt-[16px]">
|
||||
<div class="mr-[24px] flex flex-1 items-center overflow-hidden">
|
||||
<MsStatusTag :status="caseDetail.lastExecuteResult || 'PREPARED'" />
|
||||
<div class="ml-[8px] mr-[2px] cursor-pointer font-medium text-[rgb(var(--primary-5))]" @click="goCaseDetail"
|
||||
<div
|
||||
class="ml-[8px] mr-[2px] cursor-pointer font-medium text-[rgb(var(--primary-5))]"
|
||||
@click="goCaseDetail"
|
||||
>[{{ caseDetail.num }}]</div
|
||||
>
|
||||
<div class="flex-1 overflow-hidden">
|
||||
|
@ -204,6 +208,7 @@
|
|||
show-step-detail-trigger
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</a-spin>
|
||||
</div>
|
||||
</MsCard>
|
||||
|
@ -451,10 +456,30 @@
|
|||
});
|
||||
});
|
||||
const autoNext = ref(true);
|
||||
async function executeDone() {
|
||||
async function executeDone(status: LastExecuteResults) {
|
||||
if (autoNext.value) {
|
||||
// 自动下一个,更改激活的 id会刷新详情
|
||||
const index = caseList.value.findIndex((e) => e.id === activeId.value);
|
||||
|
||||
// 如果过滤的状态和执行状态不一样,则这条将从当前列表排除
|
||||
const oneMissingCase = lastExecResult.value !== '' && status !== lastExecResult.value;
|
||||
if (oneMissingCase) {
|
||||
if ((pageNation.value.current - 1) * pageNation.value.pageSize + index + 1 < pageNation.value.total) {
|
||||
// 不是最后一个
|
||||
await loadCaseList();
|
||||
activeCaseId.value = caseList.value[index].caseId;
|
||||
activeId.value = caseList.value[index].id;
|
||||
} else {
|
||||
// 是最后一个,如果列表还有其他数据,则选中第一条;如果没有其他数据,则显示暂无数据
|
||||
await loadCaseList();
|
||||
if (caseList.value.length > 1) {
|
||||
activeCaseId.value = caseList.value[0].caseId;
|
||||
activeId.value = caseList.value[0].id;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (index < caseList.value.length - 1) {
|
||||
await loadCaseList();
|
||||
activeCaseId.value = caseList.value[index + 1].caseId;
|
||||
|
|
Loading…
Reference in New Issue