refactor(系统设置): 编辑用户删除最后所属用户组时进行提示

Closes #21655
This commit is contained in:
shiziyuan9527 2023-02-10 14:52:09 +08:00 committed by lyh
parent 00b131f982
commit ce1c9ffae4
4 changed files with 11 additions and 4 deletions

View File

@ -37,7 +37,7 @@
>
</el-option>
</el-select>
<el-button @click.prevent="removeGroup(group)" style="margin-left: 20px;" v-if="form.groups.length > 1">
<el-button @click.prevent="removeGroup(group)" style="margin-left: 20px;">
{{ $t('commons.delete') }}
</el-button>
</el-form-item>
@ -239,6 +239,10 @@ export default {
})
},
removeGroup(item) {
if (this.form.groups.length === 1) {
this.$info(this.$t('user.remove_group_tip'));
return;
}
let index = this.form.groups.indexOf(item);
let isRemove = this.checkRemove(item,index);
if (!isRemove) {

View File

@ -889,7 +889,8 @@ export default {
add_workspace_batch: "Batch Add User To Workspace",
add_project_batch_tip: 'Add a read-only user group for members by default (system)',
import_user_tip: 'User group only supports system default user group',
search_get_more_tip: 'Search for other options'
search_get_more_tip: 'Search for other options',
remove_group_tip: 'Have at least one user group permission'
},
group: {
add: 'Add User Group',

View File

@ -893,7 +893,8 @@ export default {
add_workspace_batch: "批量添加到工作空间",
add_project_batch_tip: '默认为成员添加只读用户组(系统)',
import_user_tip: '用户组只支持系统默认用户组',
search_get_more_tip: '搜索获取其他选项'
search_get_more_tip: '搜索获取其他选项',
remove_group_tip: '至少拥有一个用户组权限'
},
group: {
add: '添加用户组',

View File

@ -893,7 +893,8 @@ export default {
add_workspace_batch: "批量添加到工作空間",
add_project_batch_tip: '默認為成員添加只讀用戶組(系統)',
import_user_tip: '用戶組只支持系統默認用戶組',
search_get_more_tip: '搜索獲取其他選項'
search_get_more_tip: '搜索獲取其他選項',
remove_group_tip: '至少擁有一個用戶組權限'
},
group: {
add: '添加用戶組',