+
{{ $t('api_test.environment.environment_config') }}
@@ -38,6 +38,12 @@ export default {
props: {
envMap: Map,
projectIds: Set,
+ showConfigButtonWithOutPermission:{
+ type: Boolean,
+ default() {
+ return true;
+ }
+ },
projectList: Array
},
data() {
@@ -46,12 +52,33 @@ export default {
result: {},
projects: [],
environments: [],
+ permissionProjectIds:[],
dialogVisible: false,
isFullUrl: true,
};
},
methods: {
+ isShowConfirmButton(projectId){
+ if(this.showConfigButtonWithOutPermission === true){
+ return true;
+ }else{
+ if(this.permissionProjectIds){
+ if(this.permissionProjectIds.indexOf(projectId)<0){
+ return false;
+ }else {
+ return true;
+ }
+ }else{
+ return false;
+ }
+ }
+ },
init() {
+ //获取当前用户有权限的ID
+ if(this.permissionProjectIds.length === 0){
+ this.getUserPermissionProjectIds();
+ }
+
this.projectIds.forEach(id => {
const project = this.projectList.find(p => p.id === id);
if (project) {
@@ -138,7 +165,12 @@ export default {
},
environmentConfigClose() {
// todo 关闭处理
- }
+ },
+ getUserPermissionProjectIds(){
+ this.$get('/project/getOwnerProjectIds/', res => {
+ this.permissionProjectIds = res.data;
+ })
+ },
}
};
diff --git a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue
index 32f7bd3474..6e72b8b534 100644
--- a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue
+++ b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue
@@ -8,8 +8,8 @@
-
@@ -92,6 +92,7 @@
data() {
return {
result: {},
+ showConfigButtonWithOutPermission:false,
condition: {},
currentScenario: {},
schedule: {},