refactor(系统设置): 创建环境时全局前后置脚本不展示变更历史
This commit is contained in:
parent
861ebc2e37
commit
b9983880ea
|
@ -7,7 +7,7 @@
|
|||
:env-add-permission="['PROJECT_ENVIRONMENT:READ+CREATE']"
|
||||
:data="environments" :item-operators="environmentOperators" :add-fuc="addEnvironment"
|
||||
:delete-fuc="deleteEnvironment" @itemSelected="environmentSelected" ref="environmentItems"/>
|
||||
<environment-edit :environment="currentEnvironment" ref="environmentEdit" @close="close" :is-read-only="isReadOnly"/>
|
||||
<environment-edit :if-create="ifCreate" :environment="currentEnvironment" ref="environmentEdit" @close="close" :is-read-only="isReadOnly"/>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -50,7 +50,8 @@
|
|||
permissions: ['PROJECT_ENVIRONMENT:READ+DELETE']
|
||||
}
|
||||
],
|
||||
selectEnvironmentId: ''
|
||||
selectEnvironmentId: '',
|
||||
ifCreate: false, //是否是创建环境
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -67,6 +68,7 @@
|
|||
listenGoBack(this.close);
|
||||
},
|
||||
deleteEnvironment(environment, index) {
|
||||
this.ifCreate = false;
|
||||
if (environment.id) {
|
||||
this.result = this.$get('/api/environment/delete/' + environment.id, () => {
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
|
@ -78,6 +80,7 @@
|
|||
}
|
||||
},
|
||||
copyEnvironment(environment) {
|
||||
this.ifCreate = false;
|
||||
this.currentEnvironment = environment;
|
||||
if (!environment.id) {
|
||||
this.$warning(this.$t('commons.please_save'));
|
||||
|
@ -110,6 +113,7 @@
|
|||
return name;
|
||||
},
|
||||
addEnvironment() {
|
||||
this.ifCreate = true;
|
||||
let newEnvironment = new Environment({
|
||||
projectId: this.projectId
|
||||
});
|
||||
|
@ -147,6 +151,9 @@
|
|||
getEnvironment(environment) {
|
||||
parseEnvironment(environment);
|
||||
this.currentEnvironment = environment;
|
||||
if(this.currentEnvironment.name){
|
||||
this.ifCreate = false;
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit('close');
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
:data="environments" :item-operators="environmentOperators" :add-fuc="addEnvironment"
|
||||
:env-add-permission="ENV_CREATE"
|
||||
:delete-fuc="deleteEnvironment" @itemSelected="environmentSelected" ref="environmentItems"/>
|
||||
<environment-edit :project-id="projectId" :environment="currentEnvironment" ref="environmentEdit" :is-read-only="isReadOnly"
|
||||
<environment-edit :if-create="ifCreate" :project-id="projectId" :environment="currentEnvironment" ref="environmentEdit" :is-read-only="isReadOnly"
|
||||
@close="close"/>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
|
@ -53,7 +53,8 @@
|
|||
['PROJECT_ENVIRONMENT:READ+DELETE'] : ['WORKSPACE_PROJECT_ENVIRONMENT:READ+DELETE']
|
||||
}
|
||||
],
|
||||
selectEnvironmentId: ''
|
||||
selectEnvironmentId: '',
|
||||
ifCreate: false, //是否是创建环境
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
@ -88,6 +89,7 @@
|
|||
listenGoBack(this.close);
|
||||
},
|
||||
deleteEnvironment(environment, index) {
|
||||
this.ifCreate = false;
|
||||
if (environment.id) {
|
||||
this.result = this.$get('/api/environment/delete/' + environment.id, () => {
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
|
@ -99,6 +101,7 @@
|
|||
}
|
||||
},
|
||||
copyEnvironment(environment) {
|
||||
this.ifCreate = false;
|
||||
//点击复制的时候先选择改行,否则会出现解析错误
|
||||
this.environmentSelected(environment);
|
||||
this.currentEnvironment = environment;
|
||||
|
@ -133,6 +136,7 @@
|
|||
return name;
|
||||
},
|
||||
addEnvironment() {
|
||||
this.ifCreate = true;
|
||||
let newEnvironment = new Environment({
|
||||
projectId: this.projectId
|
||||
});
|
||||
|
@ -170,6 +174,9 @@
|
|||
getEnvironment(environment) {
|
||||
parseEnvironment(environment);
|
||||
this.currentEnvironment = environment;
|
||||
if(this.currentEnvironment.name){
|
||||
this.ifCreate = false;
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit('close');
|
||||
|
|
Loading…
Reference in New Issue