fix(工作台): 调整工作台测试计划数量去掉执行率增加已归档计算

This commit is contained in:
xinxin.wu 2024-11-25 14:31:36 +08:00 committed by 刘瑞斌
parent 66551a3b4f
commit 35fdf5875b
3 changed files with 7 additions and 43 deletions

View File

@ -186,7 +186,7 @@ export const defaultValueMap: Record<string, any> = {
},
complete: {
defaultList: cloneDeep(defaultComplete),
color: ['#00C261', '#3370FF', '#D4D4D8'],
color: ['#00C261', '#3370FF', '#D4D4D8', '#FF9964'],
defaultName: 'workbench.homePage.completeRate',
},
},

View File

@ -97,10 +97,7 @@
const hasPermission = ref<boolean>(false);
function handleData(detail: OverViewOfProject) {
options.value = getCommonBarOptions(detail.xaxis.length >= 7, [
...defectStatusColor,
...getColorScheme(detail.xaxis.length),
]);
options.value = getCommonBarOptions(detail.xaxis.length >= 7, [...defectStatusColor, ...getColorScheme(13)]);
const { invisible, text } = handleNoDataDisplay(detail.xaxis, hasPermission.value);
options.value.graphic.invisible = invisible;
options.value.graphic.style.text = text;

View File

@ -20,7 +20,7 @@
</div>
</div>
<div class="mt-[16px]">
<TabCard :content-tab-list="testPlanTabList" not-has-padding hidden-border min-width="270px">
<TabCard :content-tab-list="testPlanTabList" not-has-padding hidden-border min-width="290px">
<template #item="{ item: tabItem }">
<div class="w-full">
<PassRatePie
@ -90,12 +90,9 @@
})
);
const executionOptions = ref<Record<string, any>>({});
const passOptions = ref<Record<string, any>>({});
const completeOptions = ref<Record<string, any>>({});
//
const executionValueList = ref<{ value: number | string; label: string; name: string }[]>([]);
//
const passValueList = ref<{ value: number | string; label: string; name: string }[]>([]);
@ -104,12 +101,6 @@
const testPlanTabList = computed(() => {
return [
{
label: '',
value: 'execution',
valueList: executionValueList.value,
options: { ...executionOptions.value },
},
{
label: '',
value: 'pass',
@ -138,7 +129,7 @@
projectId: innerProjectIds.value[0],
};
const detail: WorkTestPlanRageDetail = await workTestPlanRage(params);
const { unExecute, executed, passed, notPassed, finished, running, prepared, archived, errorCode } = detail;
const { passed, notPassed, finished, running, prepared, archived, errorCode } = detail;
hasPermission.value = errorCode !== 109001;
const passRate = passed + notPassed > 0 ? parseFloat(((passed / (passed + notPassed)) * 100).toFixed(2)) : 0;
@ -172,7 +163,7 @@
percentValue: total > 0 ? `${((item.count / total) * 100).toFixed(2)}%` : '0%',
}));
const completeRate = total > 0 ? parseFloat(((finished / total) * 100).toFixed(2)) : 0;
const completeRate = total > 0 ? parseFloat((((finished + archived) / total) * 100).toFixed(2)) : 0;
const completeData = [
{
@ -191,36 +182,14 @@
name: t('common.notStarted'),
count: prepared,
},
];
const executeRate = finished + running > 0 ? parseFloat((((finished + running) / total) * 100).toFixed(2)) : 0;
const executeData: {
name: string;
count: number;
}[] = [
{
name: t('workbench.homePage.executeRate'),
count: executeRate,
},
{
name: t('common.unExecute'),
count: unExecute,
},
{
name: t('common.executed'),
count: executed,
name: t('common.archived'),
count: archived,
},
];
testPlanCountOptions.value = handlePieData(props.item.key, hasPermission.value, listStatusPercentList);
//
const { options: executedOptions, valueList: executedList } = handleUpdateTabPie(
executeData,
hasPermission.value,
`${props.item.key}-execute`
);
//
const { options: passedOptions, valueList: passList } = handleUpdateTabPie(
passData,
@ -235,11 +204,9 @@
`${props.item.key}-complete`
);
executionValueList.value = executedList;
passValueList.value = passList;
completeValueList.value = completeList;
executionOptions.value = executedOptions;
passOptions.value = passedOptions;
completeOptions.value = comOptions;
} catch (error) {