fix(工作台): 测试计划表格&执行历史
This commit is contained in:
parent
ee155ac24f
commit
6c9a4fd6d7
|
@ -27,7 +27,7 @@
|
|||
>
|
||||
<div class="one-line-text max-w-[120px]">
|
||||
<slot name="item" :filter-item="item" :index="index">
|
||||
<div class="one-line-text max-w-[120px]">{{ item[props.labelKey || 'label'] }}</div>
|
||||
{{ item[props.valueKey || 'value'] }}
|
||||
</slot>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
|
@ -74,7 +74,7 @@
|
|||
:disabled="!item[props.labelKey || 'label']"
|
||||
>
|
||||
<div class="one-line-text max-w-[120px]" @click.stop="checkItem(item.value)">
|
||||
<div class="one-line-text max-w-[120px]">{{ item.label }}</div>
|
||||
{{ item.label }}
|
||||
</div>
|
||||
</a-tooltip>
|
||||
</a-checkbox>
|
||||
|
|
|
@ -475,7 +475,10 @@ export interface PlanExecuteResultExecuteCaseCount {
|
|||
export interface PlanExecuteResult extends TaskReportDetail {
|
||||
taskName: string;
|
||||
reportId: string;
|
||||
childPlans: { id: string; name: string }[]; // 子计划
|
||||
childPlans: { id: string; name: string; apiCaseTotal: number; apiScenarioTotal: number }[]; // 子计划
|
||||
createUser: string;
|
||||
executeRate: string;
|
||||
executeCaseCount: PlanExecuteResultExecuteCaseCount;
|
||||
apiCaseTotal: number;
|
||||
apiScenarioTotal: number;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
v-model:model-value="activePlan"
|
||||
:options="testPlanGroups"
|
||||
size="small"
|
||||
@change="searchList"
|
||||
@change="handlePlanChange"
|
||||
></a-select>
|
||||
<executeRatePopper
|
||||
v-else-if="item.key === 'rate'"
|
||||
|
@ -49,7 +49,7 @@
|
|||
<div class="flex items-center justify-between">
|
||||
<MsTab
|
||||
v-model:active-key="activeTable"
|
||||
:content-tab-list="contentTabList"
|
||||
:content-tab-list="showContentTabList"
|
||||
:show-badge="false"
|
||||
class="testPlan-execute-tab no-content"
|
||||
@change="searchList"
|
||||
|
@ -161,6 +161,8 @@
|
|||
const testPlanGroups = ref<SelectOptionData[]>([]);
|
||||
const executeRateVisible = ref(false);
|
||||
const activePlan = ref('');
|
||||
const activePlanCaseTotal = ref(0);
|
||||
const activePlanScenarioTotal = ref(0);
|
||||
|
||||
const columns: MsTableColumn = [
|
||||
{
|
||||
|
@ -216,6 +218,14 @@
|
|||
{ value: 'case', label: t('report.detail.apiCaseDetails') },
|
||||
{ value: 'scenario', label: t('report.detail.scenarioCaseDetails') },
|
||||
];
|
||||
const showContentTabList = computed(() =>
|
||||
contentTabList.filter((item) => {
|
||||
if (item.value === 'case') {
|
||||
return activePlanCaseTotal.value > 0;
|
||||
}
|
||||
return activePlanScenarioTotal.value > 0;
|
||||
})
|
||||
);
|
||||
const keyword = ref('');
|
||||
|
||||
const useApiTable = useTable(getApiPage, {
|
||||
|
@ -265,6 +275,20 @@
|
|||
currentCaseTable.value.loadList();
|
||||
}
|
||||
|
||||
function handlePlanChange(
|
||||
value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]
|
||||
) {
|
||||
const plan = testPlanGroups.value.find((item) => item.value === value);
|
||||
if (plan) {
|
||||
activePlanCaseTotal.value = plan.caseTotal;
|
||||
activePlanScenarioTotal.value = plan.scenarioTotal;
|
||||
activeTable.value = activePlanCaseTotal.value > 0 ? 'case' : 'scenario';
|
||||
nextTick(() => {
|
||||
searchList();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 去用例详情页面
|
||||
function toDetail(record: ApiOrScenarioCaseItem) {
|
||||
if (activeTable.value === 'scenario') {
|
||||
|
@ -315,6 +339,8 @@
|
|||
] as Description[],
|
||||
...res,
|
||||
};
|
||||
activePlanCaseTotal.value = res.apiCaseTotal;
|
||||
activePlanScenarioTotal.value = res.apiScenarioTotal;
|
||||
if (res.childPlans.length) {
|
||||
detail.value.description.push({
|
||||
label: t('testPlan.testPlanIndex.testPlan'),
|
||||
|
@ -326,7 +352,13 @@
|
|||
label: item.name,
|
||||
}));
|
||||
activePlan.value = res.childPlans[0]?.id;
|
||||
} else {
|
||||
testPlanGroups.value = [];
|
||||
activePlanCaseTotal.value = res.childPlans[0]?.apiCaseTotal;
|
||||
activePlanScenarioTotal.value = res.childPlans[0]?.apiScenarioTotal;
|
||||
activeTable.value = activePlanCaseTotal.value > 0 ? 'case' : 'scenario';
|
||||
}
|
||||
activeTable.value = activePlanCaseTotal.value > 0 ? 'case' : 'scenario';
|
||||
searchList();
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
|
|
|
@ -171,12 +171,7 @@
|
|||
dataIndex: 'status',
|
||||
slotName: 'status',
|
||||
filterConfig: {
|
||||
options: planStatusOptions.filter((e) => {
|
||||
if (props.type === 'my_todo') {
|
||||
return e.value !== 'COMPLETED';
|
||||
}
|
||||
return true;
|
||||
}),
|
||||
options: planStatusOptions,
|
||||
filterSlotName: FilterSlotNameEnum.TEST_PLAN_STATUS_FILTER,
|
||||
},
|
||||
showInTable: true,
|
||||
|
|
Loading…
Reference in New Issue