fix(环境组): 创建时清除项目选项后不能再次选择的问题

--bug=1009490 --user=lyh [github
#8735]系统设置、环境管理、创建环境组选择项目后,然后X掉就不能再次选择了
https://www.tapd.cn/55049933/s/1090196

Closes #8735
This commit is contained in:
shiziyuan9527 2022-01-10 19:02:17 +08:00 committed by 刘瑞斌
parent 4fff48a941
commit 09a4129dd6
1 changed files with 9 additions and 1 deletions

View File

@ -11,7 +11,7 @@
<el-row type="flex" justify="space-between" :gutter="10">
<el-col :span="6">
<el-select v-model="item.projectId" filterable clearable style="width: 100%" @change="projectChange(item)"
:size="itemSize"
:size="itemSize" @clear="clearProjectSelect"
:placeholder="$t('workspace.env_group.please_select_project')" :disabled="rowReadOnly">
<el-option v-for="(project, projectIndex) in projectList" :key="projectIndex" :label="project.name"
:disabled="project.disabled"
@ -169,6 +169,14 @@ export default {
this.$set(item, 'environmentId', "");
this.$set(item, 'domainName', '');
},
clearProjectSelect() {
let usedProjectId = this.envGroupProject.map(egp => egp.projectId);
if (usedProjectId) {
this.projectList.forEach(p => {
p.disabled = !!usedProjectId.find(id => id === p.id);
})
}
},
environmentChange(item) {
// todo
//