From 3fc583ecfea773b2e86453d2fc376a8abd83f323 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Thu, 21 Nov 2024 16:01:30 +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=E6=8E=A5=E5=8F=A3=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E5=8D=A1=E7=89=87=E5=88=87=E6=8D=A2=E6=97=A0=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homePage/components/apiAndScenarioCase.vue | 8 +++++--- .../views/workbench/homePage/components/apiCount.vue | 10 +++++++--- frontend/src/views/workbench/homePage/index.vue | 7 +------ frontend/src/views/workbench/homePage/utils.ts | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/frontend/src/views/workbench/homePage/components/apiAndScenarioCase.vue b/frontend/src/views/workbench/homePage/components/apiAndScenarioCase.vue index 2300221dae..0b1735f18d 100644 --- a/frontend/src/views/workbench/homePage/components/apiAndScenarioCase.vue +++ b/frontend/src/views/workbench/homePage/components/apiAndScenarioCase.vue @@ -296,10 +296,12 @@ } function changeProject() { - nextTick(() => { - initApiOrScenarioCount(); + nextTick(async () => { + await initApiOrScenarioCount(); emit('change'); - initApiCountRate(); + if (hasPermission.value) { + initApiCountRate(); + } }); } diff --git a/frontend/src/views/workbench/homePage/components/apiCount.vue b/frontend/src/views/workbench/homePage/components/apiCount.vue index abaeff0c9a..9ac1edc2bb 100644 --- a/frontend/src/views/workbench/homePage/components/apiCount.vue +++ b/frontend/src/views/workbench/homePage/components/apiCount.vue @@ -146,6 +146,8 @@ coverOptions.value = { ...covOptions }; } async function initApiCountRate() { + console.log(hasPermission.value); + try { loading.value = true; const detail = await workApiCountCoverRage(projectId.value); @@ -191,10 +193,12 @@ } function changeProject() { - nextTick(() => { - initApiCount(); + nextTick(async () => { + await initApiCount(); emit('change'); - initApiCountRate(); + if (hasPermission.value) { + initApiCountRate(); + } }); } diff --git a/frontend/src/views/workbench/homePage/index.vue b/frontend/src/views/workbench/homePage/index.vue index f638d93b88..9c5fb8a2c3 100644 --- a/frontend/src/views/workbench/homePage/index.vue +++ b/frontend/src/views/workbench/homePage/index.vue @@ -150,7 +150,7 @@ ([]); - const showNoData = ref(false); - // 用来存储每个请求的结果,key 是项目ID const requestResults = ref>({}); // 用来存储已请求过的项目 @@ -301,9 +299,6 @@ // eslint-disable-next-line no-console console.log(error); } finally { - if (!defaultWorkList.value.length) { - showNoData.value = true; - } appStore.hideLoading(); } } diff --git a/frontend/src/views/workbench/homePage/utils.ts b/frontend/src/views/workbench/homePage/utils.ts index 630531a27d..a8ce89ed23 100644 --- a/frontend/src/views/workbench/homePage/utils.ts +++ b/frontend/src/views/workbench/homePage/utils.ts @@ -66,7 +66,7 @@ export const colorMapConfig: Record = { [WorkCardEnum.ASSOCIATE_CASE_COUNT]: ['#00C261', '#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.PLAN_LEGACY_BUG]: ['#9441B1', '#3370FF', '#00C261', '#D4D4D8', ...getColorScheme(12)], [WorkCardEnum.BUG_COUNT]: ['#FFA200', '#3370FF', '#D4D4D8', '#00C261', ...getColorScheme(13)], [WorkCardEnum.HANDLE_BUG_BY_ME]: ['#9441B1', '#3370FF', '#00C261', '#D4D4D8'], [WorkCardEnum.CREATE_BY_ME]: ['#9441B1', '#3370FF', '#00C261', '#D4D4D8'],