From bef431e582316af719e4980de07ba4e2e1d1da8c Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 17 Nov 2022 16:54:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=B7=B3=E8=BD=AC=E6=9D=83=E9=99=90=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018781 --user=李玉号 【系统设置】用户只开启接口、测试跟踪、性能的首页权限登陆查看缺少模块显示 https://www.tapd.cn/55049933/s/1297747 --- .../home/components/card/MainInfoCard.vue | 5 ++-- .../home/components/chart/CountChart.vue | 3 ++- .../components/dashboard/ApiCaseDashboard.vue | 13 ++++----- .../components/dashboard/ApiDashboard.vue | 12 +++++---- .../dashboard/ScenarioDashboard.vue | 16 ++++++----- .../dashboard/ScenarioScheduleDashboard.vue | 9 ++++--- .../home/components/table/UpdatedApiList.vue | 8 ++++-- .../frontend/src/directive/index.js | 2 ++ .../permission/permission-disable.js | 27 +++++++++++++++++++ .../home/components/CaseCountCard.vue | 12 ++++++--- .../home/components/FailureTestCaseList.vue | 2 +- .../home/components/RelevanceCaseCard.vue | 4 +-- .../business/home/components/ReviewList.vue | 4 +++ .../home/components/RunningTaskList.vue | 10 +++++++ .../home/components/TestCaseSideList.vue | 6 ++++- .../home/components/chart/CaseCountChart.vue | 3 ++- .../components/chart/RelevanceCountChart.vue | 3 ++- 17 files changed, 102 insertions(+), 37 deletions(-) create mode 100644 framework/sdk-parent/frontend/src/directive/permission/permission-disable.js diff --git a/api-test/frontend/src/business/home/components/card/MainInfoCard.vue b/api-test/frontend/src/business/home/components/card/MainInfoCard.vue index 7ad44124fb..2c7f735255 100644 --- a/api-test/frontend/src/business/home/components/card/MainInfoCard.vue +++ b/api-test/frontend/src/business/home/components/card/MainInfoCard.vue @@ -22,7 +22,7 @@ {{ $t("home.dashboard.public.this_week") }}
- + +{{ countData.createdInWeek }} @@ -31,7 +31,7 @@ {{ $t("home.dashboard.public.fake_error") }}
- + {{ countData.fakeErrorCount }} @@ -54,6 +54,7 @@ export default { countData: Object, redirectPageName: String, redirectDataType: String, + linkPermission: [] }, methods: { redirect(seletDataType) { diff --git a/api-test/frontend/src/business/home/components/chart/CountChart.vue b/api-test/frontend/src/business/home/components/chart/CountChart.vue index e5c7b264ec..5696eb7d9c 100644 --- a/api-test/frontend/src/business/home/components/chart/CountChart.vue +++ b/api-test/frontend/src/business/home/components/chart/CountChart.vue @@ -15,6 +15,7 @@ import MsChart from "metersphere-frontend/src/components/chart/MsChart"; import {formatNumber} from "@/api/home"; import {getUUID} from "metersphere-frontend/src/utils"; +import {hasPermission} from "metersphere-frontend/src/utils/permission"; export default { name: "CountChart", @@ -173,7 +174,7 @@ export default { }, } }, - sublink: "/#/api/definition/" + getUUID() + "/api/thisWeekCount", + sublink: hasPermission('PROJECT_API_DEFINITION:READ') ? "/#/api/definition/" + getUUID() + "/api/thisWeekCount" : "", subtextStyle: { color: "#1F2329", fontSize: 12, diff --git a/api-test/frontend/src/business/home/components/dashboard/ApiCaseDashboard.vue b/api-test/frontend/src/business/home/components/dashboard/ApiCaseDashboard.vue index f93b9403de..cdf7f3796f 100644 --- a/api-test/frontend/src/business/home/components/dashboard/ApiCaseDashboard.vue +++ b/api-test/frontend/src/business/home/components/dashboard/ApiCaseDashboard.vue @@ -19,6 +19,7 @@ :is-execute-info="false" redirect-page-name="api" redirect-data-type="apiTestCase" + :link-permission="['PROJECT_API_DEFINITION:READ']" @redirectPage="redirectPage"/>
- {{ formatAmount(apiCaseData.coveredCount) }} @@ -57,7 +58,7 @@ {{ $t("home.dashboard.public.not_covered") }}
- {{ formatAmount(apiCaseData.notCoveredCount) }} @@ -84,7 +85,7 @@ {{ $t("home.dashboard.public.executed") }}
- {{ formatAmount(apiCaseData.executedCount) }} @@ -95,7 +96,7 @@ {{ $t("home.dashboard.public.not_executed") }}
- {{ formatAmount(apiCaseData.notExecutedCount) }} @@ -122,7 +123,7 @@ {{ $t("home.dashboard.public.pass") }}
- {{ formatAmount(apiCaseData.passCount) }} @@ -133,7 +134,7 @@ {{ $t("home.dashboard.public.not_pass") }}
- {{ formatAmount(apiCaseData.unPassCount) }} diff --git a/api-test/frontend/src/business/home/components/dashboard/ApiDashboard.vue b/api-test/frontend/src/business/home/components/dashboard/ApiDashboard.vue index 8f05621063..282568a14a 100644 --- a/api-test/frontend/src/business/home/components/dashboard/ApiDashboard.vue +++ b/api-test/frontend/src/business/home/components/dashboard/ApiDashboard.vue @@ -32,7 +32,8 @@ {{ $t('home.dashboard.public.covered') }}
- + {{ formatAmount(apiData.coveredCount) }}
@@ -42,7 +43,8 @@ {{ $t('home.dashboard.public.not_covered') }}
- + {{ formatAmount(apiData.notCoveredCount) }}
@@ -68,7 +70,7 @@ {{ $t("home.dashboard.public.completed") }}
- + {{ formatAmount(apiData.finishedCount) }}
@@ -78,7 +80,7 @@ {{ $t("home.dashboard.public.underway") }}
- + {{ formatAmount(apiData.runningCount) }}
@@ -88,7 +90,7 @@ {{ $t("home.dashboard.public.prepared") }}
- + {{ formatAmount(apiData.notStartedCount) }}
diff --git a/api-test/frontend/src/business/home/components/dashboard/ScenarioDashboard.vue b/api-test/frontend/src/business/home/components/dashboard/ScenarioDashboard.vue index 2b3d6151bc..27798add09 100644 --- a/api-test/frontend/src/business/home/components/dashboard/ScenarioDashboard.vue +++ b/api-test/frontend/src/business/home/components/dashboard/ScenarioDashboard.vue @@ -18,11 +18,13 @@ - @@ -45,7 +47,7 @@ {{ $t("home.dashboard.public.covered") }}
- {{ formatAmount(scenarioData.coveredCount) }} @@ -56,7 +58,7 @@ {{ $t("home.dashboard.public.not_covered") }}
- {{ formatAmount(scenarioData.notCoveredCount) }} @@ -83,7 +85,7 @@ {{ $t("home.dashboard.public.executed") }}
- {{ formatAmount(scenarioData.executedCount) }} @@ -94,7 +96,7 @@ {{ $t("home.dashboard.public.not_executed") }}
- {{ formatAmount(scenarioData.notExecutedCount) }} @@ -121,7 +123,7 @@ {{ $t("home.dashboard.public.pass") }}
- {{ formatAmount(scenarioData.passCount) }} @@ -132,7 +134,7 @@ {{ $t("home.dashboard.public.not_pass") }}
- {{ formatAmount(scenarioData.unPassCount) }} diff --git a/api-test/frontend/src/business/home/components/dashboard/ScenarioScheduleDashboard.vue b/api-test/frontend/src/business/home/components/dashboard/ScenarioScheduleDashboard.vue index fc6cdc8252..49a9fb8350 100644 --- a/api-test/frontend/src/business/home/components/dashboard/ScenarioScheduleDashboard.vue +++ b/api-test/frontend/src/business/home/components/dashboard/ScenarioScheduleDashboard.vue @@ -18,6 +18,7 @@ @@ -46,7 +47,7 @@ {{ $t("home.dashboard.public.running") }}
- {{ formatAmount(scenarioScheduleData.runningCount) }} @@ -57,7 +58,7 @@ {{ $t("home.dashboard.public.not_run") }}
- {{ formatAmount(scenarioScheduleData.notRunCount) }} @@ -84,7 +85,7 @@ {{ $t("home.dashboard.public.pass") }}
- {{ formatAmount(scenarioScheduleData.passCount) }} @@ -95,7 +96,7 @@ {{ $t("home.dashboard.public.not_pass") }}
- {{ formatAmount(scenarioScheduleData.unPassCount) }} diff --git a/api-test/frontend/src/business/home/components/table/UpdatedApiList.vue b/api-test/frontend/src/business/home/components/table/UpdatedApiList.vue index 9a2093f381..7da61f050b 100644 --- a/api-test/frontend/src/business/home/components/table/UpdatedApiList.vue +++ b/api-test/frontend/src/business/home/components/table/UpdatedApiList.vue @@ -52,7 +52,7 @@