NEZ-1052 feat: user 编辑页面 增加 language 属性

This commit is contained in:
@changcode
2021-10-12 16:27:37 +08:00
parent f004be00a9
commit a18d4fed1d
5 changed files with 41 additions and 10 deletions

View File

@@ -315,7 +315,7 @@
overflow: auto; overflow: auto;
} }
.el-table__fixed-body-wrapper { .el-table__fixed-body-wrapper {
top: 42px !important; top: 41px !important;
} }
.el-table__body-wrapper, .el-table__fixed-body-wrapper { .el-table__body-wrapper, .el-table__fixed-body-wrapper {
box-shadow: 1px 0 $--right-box-border-color; box-shadow: 1px 0 $--right-box-border-color;

View File

@@ -52,6 +52,21 @@
<el-form-item :label="$t('config.user.mobile')" prop="mobile"> <el-form-item :label="$t('config.user.mobile')" prop="mobile">
<el-input id="account-input-mobile" v-model="editUser.mobile" maxlength="64" show-word-limit placeholder="" size="small" type="text"></el-input> <el-input id="account-input-mobile" v-model="editUser.mobile" maxlength="64" show-word-limit placeholder="" size="small" type="text"></el-input>
</el-form-item> </el-form-item>
<!--language-->
<el-form-item :label="$t('config.user.language')" prop="lang">
<el-select id="account-input-language"
class="right-box__select"
v-model="editUser.lang"
clearable
collapse-tags
placeholder=""
popper-class="right-box-select-top right-public-box-dropdown-top prevent-clickoutside"
size="small">
<template v-for="item in languageList">
<el-option :key="item.value" :label="item.label" :value="item.value"></el-option>
</template>
</el-select>
</el-form-item>
<!--roles--> <!--roles-->
<el-form-item :label="$t('config.user.roles')" prop="roleIds"> <el-form-item :label="$t('config.user.roles')" prop="roleIds">
<el-select id="account-input-roleIds" <el-select id="account-input-roleIds"
@@ -171,6 +186,10 @@ export default {
{ value: 0, label: this.$t('config.user.disable') }, { value: 0, label: this.$t('config.user.disable') },
{ value: 1, label: this.$t('config.user.enableMfa') }, { value: 1, label: this.$t('config.user.enableMfa') },
{ value: 2, label: this.$t('config.user.forceEnable') } { value: 2, label: this.$t('config.user.forceEnable') }
],
languageList: [
{ value: 'en', label: 'English' },
{ value: 'cn', label: '简体中文' }
] ]
} }
}, },

View File

@@ -144,6 +144,11 @@ export default {
prop: 'source', prop: 'source',
show: true, show: true,
width: 150 width: 150
}, {
label: this.$t('config.user.language'),
prop: 'lang',
show: true,
width: 150
}, { }, {
label: this.$t('config.user.enable'), label: this.$t('config.user.enable'),
prop: 'status', prop: 'status',

View File

@@ -159,21 +159,23 @@ export default {
label: this.$t('profile.role'), label: this.$t('profile.role'),
prop: '', prop: '',
icon: 'nz-icon nz-icon-role profile-role' icon: 'nz-icon nz-icon-role profile-role'
}, }, {
{
id: 2, id: 2,
label: this.$t('profile.email'), label: this.$t('profile.email'),
prop: '', prop: '',
icon: 'nz-icon nz-icon-email profile-email' icon: 'nz-icon nz-icon-email profile-email'
}, }, {
{
id: 3, id: 3,
label: this.$t('profile.mobile'), label: this.$t('profile.mobile'),
prop: '', prop: '',
icon: 'nz-icon nz-icon-mobile profile-mobile' icon: 'nz-icon nz-icon-mobile profile-mobile'
}, }, {
{
id: 4, id: 4,
label: this.$t('config.user.language'),
prop: '',
icon: 'nz-icon nz-icon-language-change'
}, {
id: 5,
label: this.$t('profile.source'), label: this.$t('profile.source'),
prop: '', prop: '',
icon: 'nz-icon nz-icon-laiyuan profile-laiyuan' icon: 'nz-icon nz-icon-laiyuan profile-laiyuan'
@@ -210,7 +212,12 @@ export default {
this.tableProfile[0].prop = this.userList.roles[0].i18n this.tableProfile[0].prop = this.userList.roles[0].i18n
this.tableProfile[1].prop = this.userList.email this.tableProfile[1].prop = this.userList.email
this.tableProfile[2].prop = this.userList.mobile this.tableProfile[2].prop = this.userList.mobile
this.tableProfile[3].prop = this.userList.source if (this.userList.lang == 'cn') {
this.tableProfile[3].prop = '简体中文'
} else {
this.tableProfile[3].prop = 'English'
}
this.tableProfile[4].prop = this.userList.source
const name = this.userList.name.substr(0, 1) const name = this.userList.name.substr(0, 1)
this.profileName = name this.profileName = name
} }

View File

@@ -74,9 +74,9 @@ export default {
receiver: [], receiver: [],
roleIds: '', roleIds: '',
roles: [], roles: [],
lang: '',
notifications: [], notifications: [],
mfaLevel: 0 mfaLevel: 0,
lang: 'English'
}, },
tableId: 'userTable', tableId: 'userTable',
searchMsg: { // 给搜索框子组件传递的信息 searchMsg: { // 给搜索框子组件传递的信息