fix(解决系统设置增加用户删除报错): 个人信息
--user=郭雨琦 系统设置-系统-用户,新增用户添加到项目里,则默认添加到项目所属的工作空间成员里
This commit is contained in:
parent
a91018886f
commit
ef106454f1
|
@ -214,6 +214,18 @@ export default {
|
||||||
},
|
},
|
||||||
removeGroup(item) {
|
removeGroup(item) {
|
||||||
let index = this.form.groups.indexOf(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];
|
let type = item.type.split("+")[1];
|
||||||
if (type === this.ws) {
|
if (type === this.ws) {
|
||||||
let isHaveWorkspace = 0;
|
let isHaveWorkspace = 0;
|
||||||
|
@ -223,6 +235,9 @@ export default {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let group = this.form.groups[i];
|
let group = this.form.groups[i];
|
||||||
|
if (!group.type) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let _type = group.type.split("+")[1];
|
let _type = group.type.split("+")[1];
|
||||||
if (_type === this.ws) {
|
if (_type === this.ws) {
|
||||||
isHaveWorkspace += 1;
|
isHaveWorkspace += 1;
|
||||||
|
@ -232,16 +247,11 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isHaveWorkspace === 0 && isHaveProject >0 ) {
|
if (isHaveWorkspace === 0 && isHaveProject >0 ) {
|
||||||
this.$message.warning("不符合删除条件")
|
this.$message.warning(this.$t('commons.not_eligible_for_deletion'))
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index !== -1) {
|
return true;
|
||||||
this.form.groups.splice(index, 1)
|
|
||||||
}
|
|
||||||
if (this.form.groups.length < this.userGroup.length) {
|
|
||||||
this.btnAddRole = false;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
addGroup(validForm) {
|
addGroup(validForm) {
|
||||||
this.$refs[validForm].validate(valid => {
|
this.$refs[validForm].validate(valid => {
|
||||||
|
@ -312,6 +322,23 @@ export default {
|
||||||
if (data) {
|
if (data) {
|
||||||
this._setResource(data, index, type);
|
this._setResource(data, index, type);
|
||||||
if(isHaveWorkspace === false ){
|
if(isHaveWorkspace === false ){
|
||||||
|
this.addWorkspaceGroup(id,index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
_setResource(data, index, type) {
|
||||||
|
switch (type) {
|
||||||
|
case GROUP_WORKSPACE:
|
||||||
|
this.form.groups[index].workspaces = data.workspaces;
|
||||||
|
break;
|
||||||
|
case GROUP_PROJECT:
|
||||||
|
this.form.groups[index].projects = data.projects;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addWorkspaceGroup(id,index){
|
||||||
this.result = this.$get('/workspace/list/resource/' + id + "/WORKSPACE", res => {
|
this.result = this.$get('/workspace/list/resource/' + id + "/WORKSPACE", res => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
|
@ -328,20 +355,6 @@ export default {
|
||||||
this._setResource(data, index+1, 'WORKSPACE');
|
this._setResource(data, index+1, 'WORKSPACE');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
_setResource(data, index, type) {
|
|
||||||
switch (type) {
|
|
||||||
case GROUP_WORKSPACE:
|
|
||||||
this.form.groups[index].workspaces = data.workspaces;
|
|
||||||
break;
|
|
||||||
case GROUP_PROJECT:
|
|
||||||
this.form.groups[index].projects = data.projects;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
getLabel(index) {
|
getLabel(index) {
|
||||||
let a = index + 1;
|
let a = index + 1;
|
||||||
|
@ -352,14 +365,7 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<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 {
|
.form-input {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -447,6 +447,7 @@ export default {
|
||||||
delete_all_version: 'All versions',
|
delete_all_version: 'All versions',
|
||||||
change_password_tips: 'Your password is the initial system password, please change it as soon as possible',
|
change_password_tips: 'Your password is the initial system password, please change it as soon as possible',
|
||||||
ui: 'UI TEST',
|
ui: 'UI TEST',
|
||||||
|
not_eligible_for_deletion:'Not Eligible For Deletion'
|
||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
normal_Login: "Normal Login",
|
normal_Login: "Normal Login",
|
||||||
|
|
|
@ -449,6 +449,7 @@ export default {
|
||||||
delete_all_version: '全部版本',
|
delete_all_version: '全部版本',
|
||||||
change_password_tips: '您的密码是系统初始密码,请尽快修改密码',
|
change_password_tips: '您的密码是系统初始密码,请尽快修改密码',
|
||||||
ui: 'UI 测试',
|
ui: 'UI 测试',
|
||||||
|
not_eligible_for_deletion:'不符合删除条件'
|
||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
normal_Login: "普通登录",
|
normal_Login: "普通登录",
|
||||||
|
|
|
@ -449,6 +449,7 @@ export default {
|
||||||
delete_all_version: '全部版本',
|
delete_all_version: '全部版本',
|
||||||
change_password_tips: '您的密碼是系統初始密碼,請盡快修改密碼',
|
change_password_tips: '您的密碼是系統初始密碼,請盡快修改密碼',
|
||||||
ui: 'UI 測試',
|
ui: 'UI 測試',
|
||||||
|
not_eligible_for_deletion:'不符合删除條件'
|
||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
normal_Login: "普通登錄",
|
normal_Login: "普通登錄",
|
||||||
|
|
Loading…
Reference in New Issue