diff --git a/frontend/src/api/modules/workbench.ts b/frontend/src/api/modules/workbench.ts index 89440042ae..02a2b5ac99 100644 --- a/frontend/src/api/modules/workbench.ts +++ b/frontend/src/api/modules/workbench.ts @@ -44,6 +44,7 @@ import { WorkMemberViewDetailUrl, WorkMyCreatedDetailUrl, WorkPlanLegacyBugUrl, + WorkProjectMemberListUrl, WorkProOverviewDetailUrl, WorkReviewListUrl, WorkScenarioCaseCountDetailUrl, @@ -139,6 +140,11 @@ export function workBugHandlerDetail(data: WorkHomePageDetail) { return MSR.post({ 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>( diff --git a/frontend/src/api/requrls/workbench.ts b/frontend/src/api/requrls/workbench.ts index f1cfc39997..1d61ce15f2 100644 --- a/frontend/src/api/requrls/workbench.ts +++ b/frontend/src/api/requrls/workbench.ts @@ -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'; // 工作台-首页-项目成员下拉 diff --git a/frontend/src/views/workbench/homePage/components/overviewMember.vue b/frontend/src/views/workbench/homePage/components/overviewMember.vue index cd0f08f714..1051c11616 100644 --- a/frontend/src/views/workbench/homePage/components/overviewMember.vue +++ b/frontend/src/views/workbench/homePage/components/overviewMember.vue @@ -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(); + } }); diff --git a/frontend/src/views/workbench/homePage/components/testPlanCount.vue b/frontend/src/views/workbench/homePage/components/testPlanCount.vue index b6dd416978..624e0927e7 100644 --- a/frontend/src/views/workbench/homePage/components/testPlanCount.vue +++ b/frontend/src/views/workbench/homePage/components/testPlanCount.vue @@ -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); // 执行率 diff --git a/frontend/src/views/workbench/homePage/index.vue b/frontend/src/views/workbench/homePage/index.vue index 96f08c82b3..3a0dc84999 100644 --- a/frontend/src/views/workbench/homePage/index.vue +++ b/frontend/src/views/workbench/homePage/index.vue @@ -1,5 +1,5 @@