refactor(系统设置): 添加成员时用户组必填

This commit is contained in:
shiziyuan9527 2021-06-11 15:19:30 +08:00 committed by 刘瑞斌
parent f98e0ab9c1
commit 4ebcb31204
10 changed files with 49 additions and 46 deletions

View File

@ -78,7 +78,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('commons.group')" prop="groupIds"> <el-form-item :label="$t('commons.group')" prop="groupIds">
<el-select v-model="form.groupIds" multiple :placeholder="$t('role.please_choose_role')" class="select-width"> <el-select v-model="form.groupIds" multiple :placeholder="$t('group.please_select_group')" class="select-width">
<el-option <el-option
v-for="item in form.groups" v-for="item in form.groups"
:key="item.id" :key="item.id"
@ -111,9 +111,9 @@
<el-form-item :label="$t('commons.phone')" prop="phone"> <el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="form.phone" autocomplete="off" :disabled="true"/> <el-input v-model="form.phone" autocomplete="off" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="用户组" prop="groupIds" <el-form-item :label="$t('commons.group')" prop="groupIds"
:rules="{required: true, message: '请选择用户组', trigger: 'change'}"> :rules="{required: true, message: $t('group.please_select_group'), trigger: 'change'}">
<el-select v-model="form.groupIds" multiple placeholder="请选择用户组" class="select-width"> <el-select v-model="form.groupIds" multiple :placeholder="$t('group.please_select_group')" class="select-width">
<el-option <el-option
v-for="item in form.allgroups" v-for="item in form.allgroups"
:key="item.id" :key="item.id"
@ -174,8 +174,8 @@
userIds: [ userIds: [
{required: true, message: this.$t('member.please_choose_member'), trigger: ['blur']} {required: true, message: this.$t('member.please_choose_member'), trigger: ['blur']}
], ],
roleIds: [ groupIds: [
{required: true, message: this.$t('role.please_choose_role'), trigger: ['blur']} {required: true, message: this.$t('group.please_select_group'), trigger: ['blur']}
] ]
}, },
multipleSelection: [], multipleSelection: [],

View File

@ -79,7 +79,7 @@
<el-table-column prop="name" :label="$t('commons.username')"/> <el-table-column prop="name" :label="$t('commons.username')"/>
<el-table-column prop="email" :label="$t('commons.email')"/> <el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/> <el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column label="用户组" width="150"> <el-table-column :label="$t('commons.group')" width="150">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-roles-tag :roles="scope.row.groups" type="success"/> <ms-roles-tag :roles="scope.row.groups" type="success"/>
</template> </template>
@ -127,8 +127,8 @@
</template> </template>
</el-autocomplete> </el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label="用户组" prop="groupIds"> <el-form-item :label="$t('commons.group')" prop="groupIds">
<el-select v-model="memberForm.groupIds" multiple placeholder="请选择用户组" <el-select v-model="memberForm.groupIds" multiple :placeholder="$t('group.please_select_group')"
class="select-width"> class="select-width">
<el-option <el-option
v-for="item in memberForm.groups" v-for="item in memberForm.groups"
@ -164,9 +164,9 @@
<el-form-item :label="$t('commons.phone')" prop="phone"> <el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="memberForm.phone" autocomplete="off" :disabled="true"/> <el-input v-model="memberForm.phone" autocomplete="off" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="用户组" prop="groupIds" <el-form-item :label="$t('commons.group')" prop="groupIds"
:rules="{required: true, message: $t('role.please_choose_role'), trigger: 'change'}"> :rules="{required: true, message: $t('group.please_select_group'), trigger: 'change'}">
<el-select v-model="memberForm.groupIds" multiple placeholder="请选择用户组" <el-select v-model="memberForm.groupIds" multiple :placeholder="$t('group.please_select_group')"
class="select-width"> class="select-width">
<el-option <el-option
v-for="item in memberForm.allgroups" v-for="item in memberForm.allgroups"
@ -549,7 +549,7 @@ export default {
{required: true, message: this.$t('member.please_choose_member'), trigger: ['blur']} {required: true, message: this.$t('member.please_choose_member'), trigger: ['blur']}
], ],
groupIds: [ groupIds: [
{required: true, message: this.$t('role.please_choose_role'), trigger: ['blur']} {required: true, message: this.$t('group.please_select_group'), trigger: ['blur']}
] ]
}, },
currentWorkspaceRow: {}, currentWorkspaceRow: {},

View File

@ -13,7 +13,7 @@
<el-table-column prop="name" :label="$t('commons.username')"/> <el-table-column prop="name" :label="$t('commons.username')"/>
<el-table-column prop="email" :label="$t('commons.email')"/> <el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/> <el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column prop="groups" label="用户组" width="150"> <el-table-column prop="groups" :label="$t('commons.group')" width="150">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-roles-tag :roles="scope.row.groups" type="success"/> <ms-roles-tag :roles="scope.row.groups" type="success"/>
</template> </template>
@ -49,8 +49,8 @@
<el-form-item :label="$t('commons.phone')" prop="phone"> <el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="form.phone" autocomplete="off" :disabled="true"/> <el-input v-model="form.phone" autocomplete="off" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="用户组" prop="groupIds" :rules="{required: true, message: '请选择用户组', trigger: 'change'}"> <el-form-item :label="$t('commons.group')" prop="groupIds" :rules="{required: true, message: $t('group.please_select_group'), trigger: 'change'}">
<el-select v-model="form.groupIds" multiple placeholder="请选择用户组" class="select-width"> <el-select v-model="form.groupIds" multiple :placeholder="$t('group.please_select_group')" class="select-width">
<el-option <el-option
v-for="item in form.allgroups" v-for="item in form.allgroups"
:key="item.id" :key="item.id"

View File

@ -48,7 +48,7 @@
<el-table-column prop="name" :label="$t('commons.username')"/> <el-table-column prop="name" :label="$t('commons.username')"/>
<el-table-column prop="email" :label="$t('commons.email')"/> <el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/> <el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column label="用户组" width="140"> <el-table-column :label="$t('commons.group')" width="140">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-roles-tag :roles="scope.row.groups"/> <ms-roles-tag :roles="scope.row.groups"/>
</template> </template>
@ -112,7 +112,7 @@
<!-- add organization member form --> <!-- add organization member form -->
<el-dialog :close-on-click-modal="false" :title="$t('member.create')" :visible.sync="dialogOrgMemberAddVisible" <el-dialog :close-on-click-modal="false" :title="$t('member.create')" :visible.sync="dialogOrgMemberAddVisible"
width="30%" width="40%"
:destroy-on-close="true" :destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="orgMemberRule" label-position="right" label-width="100px" <el-form :model="memberForm" ref="form" :rules="orgMemberRule" label-position="right" label-width="100px"
@ -130,8 +130,8 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="用户组" prop="groupIds"> <el-form-item :label="$t('commons.group')" prop="groupIds">
<el-select filterable v-model="memberForm.groupIds" multiple placeholder="请选择用户组" <el-select filterable v-model="memberForm.groupIds" multiple :placeholder="$t('group.please_select_group')"
class="select-width"> class="select-width">
<el-option <el-option
v-for="item in memberForm.groups" v-for="item in memberForm.groups"
@ -168,8 +168,8 @@
<el-input v-model="memberForm.phone" autocomplete="off" :disabled="true"/> <el-input v-model="memberForm.phone" autocomplete="off" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('commons.group')" prop="groupIds" <el-form-item :label="$t('commons.group')" prop="groupIds"
:rules="{required: true, message: $t('role.please_choose_role'), trigger: 'change'}"> :rules="{required: true, message: $t('group.please_select_group'), trigger: 'change'}">
<el-select filterable v-model="memberForm.groupIds" multiple :placeholder="$t('role.please_choose_role')" <el-select filterable v-model="memberForm.groupIds" multiple :placeholder="$t('group.please_select_group')"
class="select-width"> class="select-width">
<el-option <el-option
v-for="item in memberForm.allgroups" v-for="item in memberForm.allgroups"
@ -270,8 +270,8 @@ export default {
userIds: [ userIds: [
{required: true, message: this.$t('member.please_choose_member'), trigger: ['blur']} {required: true, message: this.$t('member.please_choose_member'), trigger: ['blur']}
], ],
roleIds: [ groupIds: [
{required: true, message: this.$t('role.please_choose_role'), trigger: ['blur']} {required: true, message: this.$t('group.please_select_group'), trigger: ['blur']}
] ]
}, },
orgId: "" orgId: ""

View File

@ -106,7 +106,7 @@
<el-table-column prop="name" :label="$t('commons.username')"/> <el-table-column prop="name" :label="$t('commons.username')"/>
<el-table-column prop="email" :label="$t('commons.email')"/> <el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/> <el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column label="用户组" width="150"> <el-table-column :label="$t('commons.group')" width="150">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-roles-tag :roles="scope.row.groups" type="success"/> <ms-roles-tag :roles="scope.row.groups" type="success"/>
</template> </template>
@ -145,8 +145,8 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="用户组" prop="groupIds"> <el-form-item :label="$t('commons.group')" prop="groupIds">
<el-select filterable v-model="memberForm.groupIds" multiple placeholder="请选择用户组" <el-select filterable v-model="memberForm.groupIds" multiple :placeholder="$t('group.please_select_group')"
class="select-width"> class="select-width">
<el-option <el-option
v-for="item in memberForm.groups" v-for="item in memberForm.groups"
@ -182,9 +182,9 @@
<el-form-item :label="$t('commons.phone')" prop="phone"> <el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="memberForm.phone" autocomplete="off" :disabled="true"/> <el-input v-model="memberForm.phone" autocomplete="off" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="用户组" prop="groupIds" <el-form-item :label="$t('commons.group')" prop="groupIds"
:rules="{required: true, message: $t('role.please_choose_role'), trigger: 'change'}"> :rules="{required: true, message: $t('group.please_select_group'), trigger: 'change'}">
<el-select filterable v-model="memberForm.groupIds" multiple placeholder="请选择用户组" <el-select filterable v-model="memberForm.groupIds" multiple :placeholder="$t('group.please_select_group')"
class="select-width"> class="select-width">
<el-option <el-option
v-for="item in memberForm.allgroups" v-for="item in memberForm.allgroups"
@ -545,8 +545,8 @@ export default {
userIds: [ userIds: [
{required: true, message: this.$t('member.please_choose_member'), trigger: ['blur']} {required: true, message: this.$t('member.please_choose_member'), trigger: ['blur']}
], ],
roleIds: [ groupIds: [
{required: true, message: this.$t('role.please_choose_role'), trigger: ['blur']} {required: true, message: this.$t('group.please_select_group'), trigger: ['blur']}
] ]
}, },
currentWorkspaceRow: {}, currentWorkspaceRow: {},

View File

@ -145,7 +145,7 @@
<el-table-column prop="name" :label="$t('commons.username')"/> <el-table-column prop="name" :label="$t('commons.username')"/>
<el-table-column prop="email" :label="$t('commons.email')"/> <el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/> <el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column label="用户组" width="150"> <el-table-column :label="$t('commons.group')" width="150">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-roles-tag :roles="scope.row.groups" type="success"/> <ms-roles-tag :roles="scope.row.groups" type="success"/>
</template> </template>
@ -181,8 +181,8 @@
<el-form-item :label="$t('commons.phone')" prop="phone"> <el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="form.phone" autocomplete="off" :disabled="true"/> <el-input v-model="form.phone" autocomplete="off" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="用户组" prop="groupIds" :rules="{required: true, message: '请选择用户组', trigger: 'change'}"> <el-form-item :label="$t('commons.group')" prop="groupIds" :rules="{required: true, message: $t('group.please_select_group'), trigger: 'change'}">
<el-select v-model="form.groupIds" multiple placeholder="请选择用户组" class="select-width"> <el-select v-model="form.groupIds" multiple :placeholder="$t('group.please_select_group')" style="width: 100%">
<el-option <el-option
v-for="item in form.allgroups" v-for="item in form.allgroups"
:key="item.id" :key="item.id"
@ -223,8 +223,8 @@
</template> </template>
</el-autocomplete> </el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label="用户组" prop="groupIds" :rules="{required: true, message: '请选择用户组', trigger: 'blur'}"> <el-form-item :label="$t('commons.group')" prop="groupIds" :rules="{required: true, message: $t('group.please_select_group'), trigger: 'blur'}">
<el-select v-model="memberForm.groupIds" multiple placeholder="请选择用户组" style="width: 100%"> <el-select v-model="memberForm.groupIds" multiple :placeholder="$t('group.please_select_group')" style="width: 100%">
<el-option <el-option
v-for="item in memberForm.groups" v-for="item in memberForm.groups"
:key="item.id" :key="item.id"

View File

@ -29,7 +29,7 @@
<el-table-column prop="name" :label="$t('commons.username')"/> <el-table-column prop="name" :label="$t('commons.username')"/>
<el-table-column prop="email" :label="$t('commons.email')"/> <el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/> <el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column prop="groups" label="用户组" width="150"> <el-table-column prop="groups" :label="$t('commons.group')" width="150">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-roles-tag :roles="scope.row.groups" type="success"/> <ms-roles-tag :roles="scope.row.groups" type="success"/>
</template> </template>
@ -70,8 +70,8 @@
</template> </template>
</el-autocomplete> </el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label="用户组" prop="groupIds"> <el-form-item :label="$t('commons.group')" prop="groupIds">
<el-select v-model="form.groupIds" multiple placeholder="请选择用户组" class="select-width"> <el-select v-model="form.groupIds" multiple :placeholder="$t('group.please_select_group')" class="select-width">
<el-option <el-option
v-for="item in form.groups" v-for="item in form.groups"
:key="item.id" :key="item.id"
@ -103,8 +103,8 @@
<el-form-item :label="$t('commons.phone')" prop="phone"> <el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="form.phone" autocomplete="off" :disabled="true"/> <el-input v-model="form.phone" autocomplete="off" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="用户组" prop="groupIds" :rules="{required: true, message: '请选择用户组', trigger: 'change'}"> <el-form-item :label="$t('commons.group')" prop="groupIds" :rules="{required: true, message: $t('group.please_select_group'), trigger: 'change'}">
<el-select v-model="form.groupIds" multiple placeholder="请选择用户组" class="select-width"> <el-select v-model="form.groupIds" multiple :placeholder="$t('group.please_select_group')" class="select-width">
<el-option <el-option
v-for="item in form.allgroups" v-for="item in form.allgroups"
:key="item.id" :key="item.id"
@ -168,7 +168,7 @@
{required: true, message: this.$t('member.please_choose_member'), trigger: ['blur']} {required: true, message: this.$t('member.please_choose_member'), trigger: ['blur']}
], ],
groupIds: [ groupIds: [
{required: true, message: "请选择用户组", trigger: ['blur']} {required: true, message: this.$t('group.please_select_group'), trigger: ['blur']}
] ]
}, },
screenHeight: 'calc(100vh - 255px)', screenHeight: 'calc(100vh - 255px)',

View File

@ -499,7 +499,8 @@ export default {
functional_menu: 'Functional Menu', functional_menu: 'Functional Menu',
operation_object: 'Operation Object', operation_object: 'Operation Object',
check_all: 'ALL', check_all: 'ALL',
permission: 'Permission' permission: 'Permission',
please_select_group: 'Please Select Group'
}, },
role: { role: {
please_choose_role: 'Please Choose Role', please_choose_role: 'Please Choose Role',

View File

@ -497,7 +497,8 @@ export default {
functional_menu: '功能菜单', functional_menu: '功能菜单',
operation_object: '操作对象', operation_object: '操作对象',
check_all: '全选', check_all: '全选',
permission: '权限' permission: '权限',
please_select_group: '请选择用户组'
}, },
role: { role: {
please_choose_role: '请选择角色', please_choose_role: '请选择角色',

View File

@ -497,7 +497,8 @@ export default {
functional_menu: '功能菜單', functional_menu: '功能菜單',
operation_object: '操作對象', operation_object: '操作對象',
check_all: '全選', check_all: '全選',
permission: '權限' permission: '權限',
please_select_group: '請選擇用戶組'
}, },
role: { role: {
please_choose_role: '請選擇角色', please_choose_role: '請選擇角色',