Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
junjie 2021-06-02 17:36:02 +08:00
commit 7198971263
2 changed files with 7 additions and 2 deletions

View File

@ -2,7 +2,7 @@
<layout-content :header="formType=='add' ? $t('user.create') : $t('user.modify')" back-name="system-user">
<el-form ref="createUserForm" :model="form" :rules="rule" size="small" label-width="auto" label-position="right">
<el-form-item label="ID" prop="username">
<el-input v-model="form.username" />
<el-input v-model="form.username" :disabled="formType !== 'add'" />
</el-form-item>
<el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="form.phone" />
@ -27,7 +27,7 @@
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('commons.status')">
<el-radio-group v-model="form.enabled" style="width: 140px">
<el-radio-group v-model="form.enabled" :disabled="formType !== 'add' && form.isAdmin" style="width: 140px">
<el-radio :label="1">{{ $t('commons.enable') }}</el-radio>
<el-radio :label="0">{{ $t('commons.disable') }}</el-radio>
</el-radio-group>
@ -47,6 +47,7 @@
<el-select
v-model="form.roleIds"
style="width: 100%"
:disabled="formType !== 'add' && form.isAdmin"
multiple
:placeholder="$t('commons.please_select')"
@remove-tag="deleteTag"

View File

@ -187,6 +187,7 @@ export default {
show: this.checkPermission(['user:edit'])
}, {
label: this.$t('commons.delete'), icon: 'el-icon-delete', type: 'danger', click: this.del,
disabled: this.btnDisabled,
show: this.checkPermission(['user:del'])
}, {
label: this.$t('member.edit_password'), icon: 'el-icon-s-tools', type: 'success', click: this.editPassword,
@ -489,6 +490,9 @@ export default {
allRoles().then(res => {
this.roles = res.data
})
},
btnDisabled(row) {
return row.userId === 1
}
}
}