fix(工作台): 修复工作台首页成员接口&测试计划执行率包含进行中bug

This commit is contained in:
xinxin.wu 2024-11-20 14:21:16 +08:00 committed by Craftsman
parent 06d3408aad
commit 4f50e3a751
5 changed files with 43 additions and 28 deletions

View File

@ -44,6 +44,7 @@ import {
WorkMemberViewDetailUrl,
WorkMyCreatedDetailUrl,
WorkPlanLegacyBugUrl,
WorkProjectMemberListUrl,
WorkProOverviewDetailUrl,
WorkReviewListUrl,
WorkScenarioCaseCountDetailUrl,
@ -139,6 +140,11 @@ export function workBugHandlerDetail(data: WorkHomePageDetail) {
return MSR.post<OverViewOfProject>({ url: WorkBugHandlerDetailUrl, data }, { ignoreCancelToken: true });
}
// 工作台-首页-项目成员下拉
export function workProjectMemberOptions(projectId: string, keyword?: string) {
return MSR.get({ url: `${WorkProjectMemberListUrl}/${projectId}`, params: { keyword } });
}
// 工作台-首页-接口变更
export function workApiChangeList(data: WorkHomePageDetail) {
return MSR.post<CommonList<ApiDefinitionDetail>>(

View File

@ -31,3 +31,4 @@ export const WorkBugHandleByMeUrl = '/dashboard/handle_bug_by_me'; // 工作台-
export const WorkPlanLegacyBugUrl = '/dashboard/plan_legacy_bug'; // 工作台-首页-测试计划遗留缺陷
export const WorkApiCountCoverRateUrl = '/api/definition/rage'; // 工作台-首页-覆盖率
export const WorkTestPlanRageUrl = '/test-plan/rage'; // 工作台-首页-测试计划数
export const WorkProjectMemberListUrl = '/dashboard/member/get-project-member/option'; // 工作台-首页-项目成员下拉

View File

@ -51,8 +51,7 @@
import MsChart from '@/components/pure/chart/index.vue';
import MsSelect from '@/components/business/ms-select';
import { getProjectMemberOptions } from '@/api/modules/project-management/projectMember';
import { workMemberViewDetail } from '@/api/modules/workbench';
import { workMemberViewDetail, workProjectMemberOptions } from '@/api/modules/workbench';
import { contentTabList } from '@/config/workbench';
import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app';
@ -173,7 +172,7 @@
async function getMemberOptions() {
const [newProjectId] = innerProjectIds.value;
const res = await getProjectMemberOptions(newProjectId);
const res = await workProjectMemberOptions(newProjectId);
memberOptions.value = res.map((e: any) => ({
label: e.name,
value: e.id,
@ -238,8 +237,10 @@
);
onMounted(() => {
getMemberOptions();
initOverViewMemberDetail();
if (props.item.projectIds.length) {
getMemberOptions();
}
});
</script>

View File

@ -140,26 +140,6 @@
const { unExecute, executed, passed, notPassed, finished, running, prepared, archived, errorCode } = detail;
hasPermission.value = errorCode !== 109001;
const executeRate =
executed + unExecute > 0 ? parseFloat(((executed / (executed + unExecute)) * 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,
},
];
const passRate = passed + notPassed > 0 ? parseFloat(((passed / (passed + notPassed)) * 100).toFixed(2)) : 0;
const passData = [
@ -212,6 +192,25 @@
},
];
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,
},
];
testPlanCountOptions.value = handlePieData(props.item.key, hasPermission.value, listStatusPercentList);
//

View File

@ -1,5 +1,5 @@
<template>
<div class="work-bench-content">
<div :class="`work-bench-content ${defaultWorkList.length ? 'min-w-[1000px]' : ''}`">
<div class="header-setting pb-[4px]">
<div
class="setting sticky top-0 z-[999] mb-[-16px] flex items-center justify-between bg-[var(--color-bg-3)] pb-[16px]"
@ -139,8 +139,8 @@
</div>
<NoData
v-if="showNoData || !defaultWorkList.length"
:no-res-permission="!defaultWorkList.length"
:all-screen="!!defaultWorkList.length"
:no-res-permission="!appStore.projectList.length"
:all-screen="!defaultWorkList.length"
height="h-[calc(100vh-110px)]"
@config="cardSetting"
/>
@ -339,12 +339,20 @@
{ deep: true }
);
watch(
() => appStore.currentOrgId,
(val) => {
if (val) {
initDefaultList();
}
}
);
provide('timeForm', time);
</script>
<style scoped lang="less">
.work-bench-content {
min-width: 1200px;
@apply overflow-x-auto;
.ms-scroll-bar();
.header-setting {