fix:创建用户表单,性别、状态、组织支持重置

This commit is contained in:
junjie 2021-06-23 15:56:04 +08:00
parent 33a221dc30
commit 5cb0267304

View File

@ -20,19 +20,19 @@
<el-input v-model="form.confirmPassword" autocomplete="off" show-password /> <el-input v-model="form.confirmPassword" autocomplete="off" show-password />
</el-form-item> </el-form-item>
<el-form-item :label="$t('commons.gender')"> <el-form-item :label="$t('commons.gender')" prop="gender">
<el-radio-group v-model="form.gender" style="width: 178px"> <el-radio-group v-model="form.gender" style="width: 178px">
<el-radio :label="$t('commons.man')">{{ $t('commons.man') }}</el-radio> <el-radio :label="$t('commons.man')">{{ $t('commons.man') }}</el-radio>
<el-radio :label="$t('commons.woman')">{{ $t('commons.woman') }}</el-radio> <el-radio :label="$t('commons.woman')">{{ $t('commons.woman') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('commons.status')"> <el-form-item :label="$t('commons.status')" prop="enabled">
<el-radio-group v-model="form.enabled" :disabled="formType !== 'add' && form.isAdmin" 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="1">{{ $t('commons.enable') }}</el-radio>
<el-radio :label="0">{{ $t('commons.disable') }}</el-radio> <el-radio :label="0">{{ $t('commons.disable') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('commons.organization')" prop="dept"> <el-form-item :label="$t('commons.organization')" prop="deptId">
<treeselect <treeselect
ref="deptTreeSelect" ref="deptTreeSelect"
v-model="form.deptId" v-model="form.deptId"
@ -148,7 +148,10 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
roleIds: [{ required: true, message: this.$t('user.input_roles'), trigger: 'change' }] roleIds: [{ required: true, message: this.$t('user.input_roles'), trigger: 'change' }],
deptId: [],
gender: [],
enable: []
}, },
defaultForm: { id: null, username: null, nickName: null, gender: '男', email: null, enabled: 1, deptId: null, phone: null, roleIds: [2] }, defaultForm: { id: null, username: null, nickName: null, gender: '男', email: null, enabled: 1, deptId: null, phone: null, roleIds: [2] },