fix(解决系统设置增加用户删除报错): 个人信息

--user=郭雨琦
系统设置-系统-用户,新增用户添加到项目里,则默认添加到项目所属的工作空间成员里
This commit is contained in:
guoyuqi 2022-05-11 11:55:13 +08:00 committed by zhangdahai112
parent a91018886f
commit ef106454f1
4 changed files with 40 additions and 31 deletions

View File

@ -214,6 +214,18 @@ export default {
},
removeGroup(item) {
let index = this.form.groups.indexOf(item);
let isRemove = this.checkRemove(item,index);
if (!isRemove) {
return;
}
if (index !== -1) {
this.form.groups.splice(index, 1)
}
if (this.form.groups.length < this.userGroup.length) {
this.btnAddRole = false;
}
},
checkRemove(item,index){
let type = item.type.split("+")[1];
if (type === this.ws) {
let isHaveWorkspace = 0;
@ -223,6 +235,9 @@ export default {
continue;
}
let group = this.form.groups[i];
if (!group.type) {
continue;
}
let _type = group.type.split("+")[1];
if (_type === this.ws) {
isHaveWorkspace += 1;
@ -232,16 +247,11 @@ export default {
}
}
if (isHaveWorkspace === 0 && isHaveProject >0 ) {
this.$message.warning("不符合删除条件")
return;
this.$message.warning(this.$t('commons.not_eligible_for_deletion'))
return false;
}
}
if (index !== -1) {
this.form.groups.splice(index, 1)
}
if (this.form.groups.length < this.userGroup.length) {
this.btnAddRole = false;
}
return true;
},
addGroup(validForm) {
this.$refs[validForm].validate(valid => {
@ -312,22 +322,7 @@ export default {
if (data) {
this._setResource(data, index, type);
if(isHaveWorkspace === false ){
this.result = this.$get('/workspace/list/resource/' + id + "/WORKSPACE", res => {
let data = res.data;
if (data) {
let roleInfo = {};
roleInfo.selects = [];
let ids = this.form.groups.map(r => r.type);
ids.forEach(id => {
roleInfo.selects.push(id);
})
roleInfo.type = "ws_member+WORKSPACE";
roleInfo.ids = [];
let groups = this.form.groups;
groups.push(roleInfo);
this._setResource(data, index+1, 'WORKSPACE');
}
})
this.addWorkspaceGroup(id,index);
}
}
})
@ -343,6 +338,24 @@ export default {
default:
}
},
addWorkspaceGroup(id,index){
this.result = this.$get('/workspace/list/resource/' + id + "/WORKSPACE", res => {
let data = res.data;
if (data) {
let roleInfo = {};
roleInfo.selects = [];
let ids = this.form.groups.map(r => r.type);
ids.forEach(id => {
roleInfo.selects.push(id);
})
roleInfo.type = "ws_member+WORKSPACE";
roleInfo.ids = [];
let groups = this.form.groups;
groups.push(roleInfo);
this._setResource(data, index+1, 'WORKSPACE');
}
})
},
getLabel(index) {
let a = index + 1;
return this.$t('commons.group') + a;
@ -352,14 +365,7 @@ export default {
</script>
<style scoped>
/*.edit-user-dialog >>> .el-dialog__body {
padding-bottom: 0;
padding-left: 0;
}*/
/*.edit-user-dialog >>> .el-dialog__footer {
padding-top: 0;
}*/
.form-input {
width: 80%;
}

View File

@ -447,6 +447,7 @@ export default {
delete_all_version: 'All versions',
change_password_tips: 'Your password is the initial system password, please change it as soon as possible',
ui: 'UI TEST',
not_eligible_for_deletion:'Not Eligible For Deletion'
},
login: {
normal_Login: "Normal Login",

View File

@ -449,6 +449,7 @@ export default {
delete_all_version: '全部版本',
change_password_tips: '您的密码是系统初始密码,请尽快修改密码',
ui: 'UI 测试',
not_eligible_for_deletion:'不符合删除条件'
},
login: {
normal_Login: "普通登录",

View File

@ -449,6 +449,7 @@ export default {
delete_all_version: '全部版本',
change_password_tips: '您的密碼是系統初始密碼,請盡快修改密碼',
ui: 'UI 測試',
not_eligible_for_deletion:'不符合删除條件'
},
login: {
normal_Login: "普通登錄",