refactor(系统设置): 编辑用户删除最后所属用户组时进行提示
This commit is contained in:
parent
ced2fc21a1
commit
8a9f126473
|
@ -39,7 +39,7 @@
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</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') }}
|
{{ $t('commons.delete') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -234,6 +234,10 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
removeGroup(item) {
|
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 index = this.form.groups.indexOf(item);
|
||||||
let isRemove = this.checkRemove(item, index);
|
let isRemove = this.checkRemove(item, index);
|
||||||
if (!isRemove) {
|
if (!isRemove) {
|
||||||
|
|
|
@ -4,7 +4,8 @@ import mf from "metersphere-frontend/src/i18n/lang/en-US"
|
||||||
|
|
||||||
const message = {
|
const message = {
|
||||||
user: {
|
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: {
|
system: {
|
||||||
environment_import_repeat_tip: "(Environment configuration with the same name filtered {0})",
|
environment_import_repeat_tip: "(Environment configuration with the same name filtered {0})",
|
||||||
|
|
|
@ -4,7 +4,8 @@ import mf from "metersphere-frontend/src/i18n/lang/zh-CN"
|
||||||
|
|
||||||
const message = {
|
const message = {
|
||||||
system_user: {
|
system_user: {
|
||||||
search_get_more_tip: '搜索获取其他选项'
|
search_get_more_tip: '搜索获取其他选项',
|
||||||
|
remove_group_tip: '至少拥有一个用户组权限'
|
||||||
},
|
},
|
||||||
system: {
|
system: {
|
||||||
environment_import_repeat_tip: "(已过滤同名称的环境配置 {0})",
|
environment_import_repeat_tip: "(已过滤同名称的环境配置 {0})",
|
||||||
|
|
|
@ -4,7 +4,8 @@ import mf from "metersphere-frontend/src/i18n/lang/zh-TW"
|
||||||
|
|
||||||
const message = {
|
const message = {
|
||||||
user: {
|
user: {
|
||||||
search_get_more_tip: '搜索獲取其他選項'
|
search_get_more_tip: '搜索獲取其他選項',
|
||||||
|
remove_group_tip: '至少擁有一個用戶組權限'
|
||||||
},
|
},
|
||||||
system: {
|
system: {
|
||||||
environment_import_repeat_tip: "(已過濾同名稱的環境配置 {0})",
|
environment_import_repeat_tip: "(已過濾同名稱的環境配置 {0})",
|
||||||
|
|
Loading…
Reference in New Issue