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

This commit is contained in:
shiziyuan9527 2023-02-10 14:45:35 +08:00 committed by lyh
parent ced2fc21a1
commit 8a9f126473
4 changed files with 11 additions and 4 deletions

View File

@ -39,7 +39,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>
@ -234,6 +234,10 @@ export default {
})
},
removeGroup(item) {
if (this.form.groups.length === 1) {
this.$info(this.$t('system_user.remove_group_tip'));
return;
}
let index = this.form.groups.indexOf(item);
let isRemove = this.checkRemove(item, index);
if (!isRemove) {

View File

@ -4,7 +4,8 @@ import mf from "metersphere-frontend/src/i18n/lang/en-US"
const message = {
user: {
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'
},
system: {
environment_import_repeat_tip: "(Environment configuration with the same name filtered {0})",

View File

@ -4,7 +4,8 @@ import mf from "metersphere-frontend/src/i18n/lang/zh-CN"
const message = {
system_user: {
search_get_more_tip: '搜索获取其他选项'
search_get_more_tip: '搜索获取其他选项',
remove_group_tip: '至少拥有一个用户组权限'
},
system: {
environment_import_repeat_tip: "(已过滤同名称的环境配置 {0})",

View File

@ -4,7 +4,8 @@ import mf from "metersphere-frontend/src/i18n/lang/zh-TW"
const message = {
user: {
search_get_more_tip: '搜索獲取其他選項'
search_get_more_tip: '搜索獲取其他選項',
remove_group_tip: '至少擁有一個用戶組權限'
},
system: {
environment_import_repeat_tip: "(已過濾同名稱的環境配置 {0})",