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: { complete: {
defaultList: cloneDeep(defaultComplete), defaultList: cloneDeep(defaultComplete),
color: ['#00C261', '#3370FF', '#D4D4D8'], color: ['#00C261', '#3370FF', '#D4D4D8', '#FF9964'],
defaultName: 'workbench.homePage.completeRate', defaultName: 'workbench.homePage.completeRate',
}, },
}, },

View File

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

View File

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