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'],