编辑未初始化数据BUG

This commit is contained in:
wuyanwen 2019-12-29 08:17:29 +08:00
parent 998c8edf24
commit ef44acee7a
3 changed files with 9 additions and 3 deletions

View File

@ -82,7 +82,9 @@ export default {
this.id = record.id
this.getRolePermissions(this.id)
this.getPermissions(record.parent_id > 0 ? { role_id: record.parent_id } : {})
this.$nextTick(() => {
setFieldsValue(pick(record, ['role_name', 'description', 'permissions']))
})
},
addSon (record) {
this.visible = true

View File

@ -132,7 +132,9 @@ export default {
this.title = '编辑菜单'
const { form: { setFieldsValue } } = this
this.id = record.id
this.$nextTick(() => {
setFieldsValue(pick(record, ['permission_name', 'route', 'permission_mark', 'method', 'type', 'sort', 'icon']))
})
this.methodValue = record.method
this.typeValue = record.type
this.sort = record.sort

View File

@ -104,7 +104,9 @@ export default {
this.getUser(this.id)
console.log(this.defaultRoles)
const { form: { setFieldsValue } } = this
this.$nextTick(() => {
setFieldsValue(pick(record, ['username', 'email']))
})
},
handleEmail (rule, value, callback) {
if (!validEmail(value)) {