feat(工作台): 工作台测试计划卡片新增查询归档状态通过/未通过跳转

This commit is contained in:
xinxin.wu 2024-12-19 14:39:21 +08:00 committed by Craftsman
parent 9837330cf6
commit 7211563978
6 changed files with 67 additions and 10 deletions

View File

@ -157,7 +157,7 @@ export const toolTipConfig: TooltipOption = {
appendTo: 'body',
formatter(params: any) {
const html = `
<div class="w-[144px] p-[16px] rounded flex items-center justify-between bg-[var(--color-bg-5)]">
<div class="p-[16px] w-[180px] rounded flex items-center justify-between bg-[var(--color-bg-5)]">
<div class=" flex items-center">
<div class="mb-[2px] mr-[8px] h-[6px] w-[6px] rounded-full bg-[${params.color}]" style="background:${
params.color

View File

@ -407,6 +407,12 @@ export const NAV_NAVIGATION: Record<WorkNavValueEnum, any> = {
[WorkNavValueEnum.TEST_PLAN_NOT_PASS]: {
passed: ['NOT_PASSED'], // 测试计划-未通过
},
[WorkNavValueEnum.TEST_PLAN_PASSED_ARCHIVED]: {
archivedPassed: [true], // 测试计划-已归档-已通过
},
[WorkNavValueEnum.TEST_PLAN_NOT_PASS_ARCHIVED]: {
archivedPassed: [false], // 测试计划-已归档-未通过
},
/**
*
*/

View File

@ -101,6 +101,8 @@ export enum WorkNavValueEnum {
TEST_PLAN_ARCHIVED = 'TEST_PLAN_ARCHIVED', // 测试计划-已归档
TEST_PLAN_PASSED = 'TEST_PLAN_PASSED', // 测试计划已通过
TEST_PLAN_NOT_PASS = 'TEST_PLAN_NOT_PASS', // 测试计划未通过通过
TEST_PLAN_NOT_PASS_ARCHIVED = 'TEST_PLAN_NOT_PASS_ARCHIVED', // 测试计划未通过已归档
TEST_PLAN_PASSED_ARCHIVED = 'TEST_PLAN_PASSED_ARCHIVED', // 测试计划已通过已归档
TEST_PLAN_BUG = 'TEST_PLAN_BUG', // 测试计划总缺陷
TEST_PLAN_LEGACY = 'TEST_PLAN_LEGACY', // 测试计划遗留缺陷

View File

@ -162,7 +162,6 @@
sortDirections: ['ascend', 'descend'],
sorter: true,
},
fixed: 'left',
width: 110,
columnSelectorDisabled: true,
},

View File

@ -12,12 +12,16 @@
<MsChart height="92px" width="92px" :options="props.options" />
</div>
<div class="pass-rate-title flex-1">
<div v-for="item of props.valueList" :key="item.label" class="flex-1">
<div v-for="(item, index) of props.valueList" :key="item.label" class="flex-1">
<slot :ele="item" :index="index">
<div class="one-line-text mb-[8px] text-[var(--color-text-4)]">{{ item.label }}</div>
<div class="pass-rate-count" @click="goNavigation(item)">
<div class="pass-rate-count text-[rgb(var(--primary-4))]">
<div @click="goNavigation(item)">
{{ hasPermission ? addCommasToNumber(item.value as number) : '-' }}
</div>
</div>
</slot>
</div>
</div>
</a-spin>
</template>
@ -44,6 +48,7 @@
value: number | string;
status?: string;
route?: string;
archivedPassed?: number;
}[];
}>();
@ -67,8 +72,8 @@
@apply flex items-center gap-2;
.pass-rate-count {
font-size: 20px;
color: rgb(var(--primary-4));
@apply cursor-pointer font-medium;
gap: 8px;
@apply flex cursor-pointer items-center justify-start font-medium;
}
}
}

View File

@ -29,7 +29,22 @@
:has-permission="hasPermission"
:options="tabItem.options"
:value-list="tabItem.valueList"
/>
>
<template v-if="tabItem.value === 'pass'" #default="{ ele: passItem, index }">
<div class="one-line-text mb-[8px] text-[var(--color-text-4)]">{{ passItem.label }}</div>
<div class="pass-rate-count-archived">
<div class="text-[rgb(var(--primary-4))]" @click="goNavigation(passItem, index)">
{{ hasPermission ? addCommasToNumber(passItem.value as number) : '-' }}
</div>
<div
class="mr-[8px] text-center text-[var(--color-text-brand)]"
@click="goNavigation(passItem, index, true)"
>
{{ hasPermission ? addCommasToNumber(passItem.archivedPassed || 0) : '-' }}
</div>
</div>
</template>
</PassRatePie>
</div>
</div>
<div class="mt-[16px] h-[148px]">
@ -59,7 +74,9 @@
import { workTestPlanRage } from '@/api/modules/workbench';
import getVisualThemeColor from '@/config/chartTheme';
import { useI18n } from '@/hooks/useI18n';
import useOpenNewPage from '@/hooks/useOpenNewPage';
import useAppStore from '@/store/modules/app';
import { addCommasToNumber } from '@/utils';
import type {
SelectedCardItem,
@ -67,9 +84,12 @@
WorkTestPlanDetail,
WorkTestPlanRageDetail,
} from '@/models/workbench/homePage';
import { WorkNavValueEnum } from '@/enums/workbenchEnum';
import { colorMapConfig, handlePieData, handleUpdateTabPie } from '../utils';
const { openNewPage } = useOpenNewPage();
const { t } = useI18n();
const appStore = useAppStore();
@ -155,10 +175,12 @@
{
name: t('workbench.homePage.havePassed'),
count: passed,
archivedPassed: 0,
},
{
name: t('workbench.homePage.notPass'),
count: notPassed,
archivedPassed: 0,
},
];
@ -249,6 +271,24 @@
});
}
function goNavigation(
item: { label: string; value: number | string; status?: string; route?: string },
index: number,
isArchived = false
) {
let status;
if (isArchived) {
status = index === 0 ? WorkNavValueEnum.TEST_PLAN_PASSED_ARCHIVED : WorkNavValueEnum.TEST_PLAN_NOT_PASS_ARCHIVED;
} else {
status = item.status;
}
openNewPage(item.route, {
pId: projectId.value,
home: status,
});
}
onMounted(() => {
initTestPlanCount();
});
@ -296,4 +336,9 @@
:deep(.arco-tabs-tab) {
padding: 0 !important;
}
.pass-rate-count-archived {
font-size: 20px;
gap: 8px;
@apply grid cursor-pointer grid-cols-2 font-medium;
}
</style>