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 @@