From b8c8d036bf61f8157c281edcf63d1914af9df7e8 Mon Sep 17 00:00:00 2001 From: Ambitiousliga <73278880+Ambitiousliga@users.noreply.github.com> Date: Thu, 11 Mar 2021 20:41:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=AA=E8=AF=BB=E7=94=A8=E6=88=B7=E6=9D=83?= =?UTF-8?q?=E9=99=90=E8=BF=87=E9=AB=98=E8=83=BD=E5=AF=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=93=8D=E4=BD=9C=20(#1614)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 黎龙鑫 Co-authored-by: jianxing <41557596+AgAngle@users.noreply.github.com> --- .../components/api/automation/ApiAutomation.vue | 6 +++++- .../api/automation/scenario/ApiScenarioList.vue | 12 +++++++++--- .../components/api/definition/ApiDefinition.vue | 7 ++++++- .../components/list/ApiCaseSimpleList.vue | 7 +++++-- .../api/definition/components/list/ApiList.vue | 15 ++++++++++----- .../api/homepage/components/RunningTaskList.vue | 17 ++++++++++++++--- 6 files changed, 49 insertions(+), 15 deletions(-) diff --git a/frontend/src/business/components/api/automation/ApiAutomation.vue b/frontend/src/business/components/api/automation/ApiAutomation.vue index 2979c5140c..921ab5f536 100644 --- a/frontend/src/business/components/api/automation/ApiAutomation.vue +++ b/frontend/src/business/components/api/automation/ApiAutomation.vue @@ -25,6 +25,7 @@ :trash-enable="trashEnable" :checkRedirectID="checkRedirectID" :isRedirectEdit="isRedirectEdit" + :is-read-only="isReadOnly" @openScenario="editScenario" @edit="editScenario" @changeSelectDataRangeAll="changeSelectDataRangeAll" @@ -66,7 +67,7 @@ import MsAsideContainer from "@/business/components/common/components/MsAsideContainer"; import MsMainContainer from "@/business/components/common/components/MsMainContainer"; import MsApiScenarioList from "@/business/components/api/automation/scenario/ApiScenarioList"; - import {getUUID, downloadFile} from "@/common/js/utils"; + import {getUUID, downloadFile, checkoutTestManagerOrTestUser} from "@/common/js/utils"; import MsApiScenarioModule from "@/business/components/api/automation/scenario/ApiScenarioModule"; import MsEditApiScenario from "./scenario/EditApiScenario"; import {getCurrentProjectID} from "../../../../common/js/utils"; @@ -92,6 +93,9 @@ let redirectParam = this.$route.params.dataSelectRange; this.checkRedirectEditPage(redirectParam); return redirectParam; + }, + isReadOnly(){ + return !checkoutTestManagerOrTestUser(); } }, data() { diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index 629d56bafa..345a94dfb5 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -24,7 +24,7 @@ - + @@ -232,6 +233,11 @@ default() { return [] }, + }, + //用于判断是否是只读用户 + isReadOnly: { + type: Boolean, + default: false, } }, data() { diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index 426b2c1087..a23ddf060e 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -46,6 +46,7 @@ :trash-enable="trashEnable" :queryDataType="queryDataType" :selectDataRange="selectDataRange" + :is-read-only="isReadOnly" @changeSelectDataRangeAll="changeSelectDataRangeAll" @editApi="editApi" @handleCase="handleCase" @@ -60,6 +61,7 @@ :select-node-ids="selectNodeIds" :trash-enable="trashEnable" :queryDataType="queryDataType" + :is-read-only="isReadOnly" @changeSelectDataRangeAll="changeSelectDataRangeAll" @handleCase="handleCase" @showExecResult="showExecResult" @@ -138,7 +140,7 @@ import MsRunTestHttpPage from "./components/runtest/RunTestHTTPPage"; import MsRunTestTcpPage from "./components/runtest/RunTestTCPPage"; import MsRunTestSqlPage from "./components/runtest/RunTestSQLPage"; import MsRunTestDubboPage from "./components/runtest/RunTestDubboPage"; -import {getCurrentProjectID, getCurrentUser, getUUID} from "@/common/js/utils"; +import {checkoutTestManagerOrTestUser, getCurrentProjectID, getCurrentUser, getUUID} from "@/common/js/utils"; import MsApiModule from "./components/module/ApiModule"; import ApiCaseSimpleList from "./components/list/ApiCaseSimpleList"; @@ -155,6 +157,9 @@ import MsTabButton from "@/business/components/common/components/MsTabButton"; this.changeRedirectParam(redirectIDParam); return routeParam; }, + isReadOnly(){ + return !checkoutTestManagerOrTestUser(); + } }, components: { MsTabButton, diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue index d5f40be7e4..10bf52c654 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue @@ -26,14 +26,17 @@