From 552682bd4475a2d1a4cfe627007fa6b7db78c919 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Mon, 18 Nov 2024 13:51:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=B7=A5=E4=BD=9C=E5=8F=B0=E9=A6=96=E9=A1=B5=E6=9F=B1?= =?UTF-8?q?=E7=8A=B6=E5=9B=BE=E6=95=B0=E6=8D=AE=E5=B1=95=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/config/workbench.ts | 2 +- .../homePage/components/overview.vue | 24 +++++++--- .../homePage/components/ratioPie.vue | 1 - .../views/workbench/homePage/locale/en-US.ts | 2 +- .../views/workbench/homePage/locale/zh-CN.ts | 2 +- .../src/views/workbench/homePage/utils.ts | 47 +++++++++++++++---- 6 files changed, 59 insertions(+), 19 deletions(-) diff --git a/frontend/src/config/workbench.ts b/frontend/src/config/workbench.ts index 70f3a9109b..a80707874e 100644 --- a/frontend/src/config/workbench.ts +++ b/frontend/src/config/workbench.ts @@ -42,7 +42,7 @@ export const contentTabList: ModuleCardItem[] = [ count: 0, }, { - label: 'workbench.homePage.apiPlan', + label: 'workbench.homePage.testPlan', value: WorkOverviewEnum.TEST_PLAN, icon: WorkOverviewIconEnum.TEST_PLAN, color: 'rgb(var(--link-6))', diff --git a/frontend/src/views/workbench/homePage/components/overview.vue b/frontend/src/views/workbench/homePage/components/overview.vue index 7e4f05c46d..e333557c78 100644 --- a/frontend/src/views/workbench/homePage/components/overview.vue +++ b/frontend/src/views/workbench/homePage/components/overview.vue @@ -27,7 +27,7 @@
- +
@@ -90,7 +90,7 @@ } ); - const hasRoom = computed(() => innerProjectIds.value.length >= 7); + const hasRoom = computed(() => innerProjectIds.value.length >= 7 || props.item.projectIds.length === 0); const options = ref>({}); @@ -119,10 +119,10 @@ // 处理data数据 options.value.series = detail.projectCountList.map((item) => { - const countData: Record = item.count.map((e) => { + const countData: Record[] = item.count.map((e) => { return { name: item.name, - value: e !== 0 ? e : undefined, + value: e, tooltip: { show: true, trigger: 'item', @@ -159,12 +159,22 @@ borderRadius: [2, 2, 0, 0], // 上边圆角 }, data: countData, + barMinHeight: ((optionData: Record[]) => { + optionData.forEach((itemValue: any, index: number) => { + if (itemValue.value === 0) optionData[index].value = null; + }); + let hasZero = false; + for (let i = 0; i < optionData.length; i++) { + if (optionData[i].value === 0) { + hasZero = true; + break; + } + } + return hasZero ? 0 : 5; + })(countData), }; }); options.value.yAxis[0].max = maxAxis < 100 ? 50 : maxAxis + 50; - - options.value.series[0].barGap = 4; - options.value.series[0].barCategoryGap = 24; } async function initOverViewDetail() { diff --git a/frontend/src/views/workbench/homePage/components/ratioPie.vue b/frontend/src/views/workbench/homePage/components/ratioPie.vue index cb07cb7af7..d85c288a50 100644 --- a/frontend/src/views/workbench/homePage/components/ratioPie.vue +++ b/frontend/src/views/workbench/homePage/components/ratioPie.vue @@ -100,7 +100,6 @@ series: { name: '', type: 'pie', - padAngle: 1, radius: ['50%', '58%'], center: ['50%', '32%'], color: [], diff --git a/frontend/src/views/workbench/homePage/locale/en-US.ts b/frontend/src/views/workbench/homePage/locale/en-US.ts index f736c89008..bc16c4f31f 100644 --- a/frontend/src/views/workbench/homePage/locale/en-US.ts +++ b/frontend/src/views/workbench/homePage/locale/en-US.ts @@ -8,7 +8,7 @@ export default { 'workbench.homePage.interfaceAPI': 'Interface API', 'workbench.homePage.interfaceCASE': 'Interface CASE', 'workbench.homePage.interfaceScenario': 'Interface Scene', - 'workbench.homePage.apiPlan': 'Interface plan', + 'workbench.homePage.apiPlan': 'Test plan', 'workbench.homePage.bugCount': 'Defect quantity', 'workbench.homePage.nearlyThreeDays': 'Nearly 3 days', 'workbench.homePage.nearlySevenDays': 'Nearly 3 days', diff --git a/frontend/src/views/workbench/homePage/locale/zh-CN.ts b/frontend/src/views/workbench/homePage/locale/zh-CN.ts index 977e7c592e..fa23fcf173 100644 --- a/frontend/src/views/workbench/homePage/locale/zh-CN.ts +++ b/frontend/src/views/workbench/homePage/locale/zh-CN.ts @@ -8,7 +8,7 @@ export default { 'workbench.homePage.interfaceAPI': '接口 API', 'workbench.homePage.interfaceCASE': '接口 CASE', 'workbench.homePage.interfaceScenario': '接口场景', - 'workbench.homePage.apiPlan': '接口计划', + 'workbench.homePage.testPlan': '测试计划', 'workbench.homePage.bugCount': '缺陷数', 'workbench.homePage.nearlyThreeDays': '近3天', 'workbench.homePage.nearlySevenDays': '近7天', diff --git a/frontend/src/views/workbench/homePage/utils.ts b/frontend/src/views/workbench/homePage/utils.ts index 0fba11042a..c45885e560 100644 --- a/frontend/src/views/workbench/homePage/utils.ts +++ b/frontend/src/views/workbench/homePage/utils.ts @@ -45,7 +45,7 @@ export const commonColorConfig = [ export const colorMapConfig: Record = { [WorkCardEnum.CASE_COUNT]: ['#ED0303', '#FFA200', '#3370FF', '#D4D4D8'], [WorkCardEnum.ASSOCIATE_CASE_COUNT]: ['#00C261', '#3370FF'], - [WorkCardEnum.REVIEW_CASE_COUNT]: ['#D4D4D8', '#3370FF', '#00C261', '#ED0303', '#9441B1', '#3370FF'], + [WorkCardEnum.REVIEW_CASE_COUNT]: ['#D4D4D8', '#3370FF', '#00C261', '#ED0303', '#FFA200'], [WorkCardEnum.TEST_PLAN_COUNT]: ['#9441B1', '#3370FF', '#00C261', '#D4D4D8'], [WorkCardEnum.PLAN_LEGACY_BUG]: ['#9441B1', '#3370FF', '#00C261', '#D4D4D8'], [WorkCardEnum.BUG_COUNT]: ['#FFA200', '#D4D4D8', '#00C261'], @@ -84,7 +84,7 @@ export function getCommonBarOptions(hasRoom: boolean, color: string[]): Record
${item.seriesName}
-
${addCommasToNumber(item.value)}
+
${addCommasToNumber(item.value || 0)}
` ) @@ -100,7 +100,7 @@ export function getCommonBarOptions(hasRoom: boolean, color: string[]): Record