fix(环境组): 创建时清除项目选项后不能再次选择的问题
--bug=1009490 --user=lyh [github #8735]系统设置、环境管理、创建环境组选择项目后,然后X掉就不能再次选择了 https://www.tapd.cn/55049933/s/1090196 Closes #8735
This commit is contained in:
parent
4fff48a941
commit
09a4129dd6
|
@ -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 优化
|
||||
// 环境改变时初始化判断状态
|
||||
|
|
Loading…
Reference in New Issue