|
@@ -191,15 +191,22 @@ export default {
|
|
if (!newValue) {
|
|
if (!newValue) {
|
|
this.$emit('close')
|
|
this.$emit('close')
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.ruleForm.resetFields()
|
|
|
|
+ this.form.name = ''
|
|
|
|
+ this.form.phone = ''
|
|
|
|
+ this.form.loginName = ''
|
|
|
|
+ this.form.sex = undefined
|
|
|
|
+ this.form.loginFlag = ''
|
|
this.form.roleNames = []
|
|
this.form.roleNames = []
|
|
|
|
+ this.form.remarks = ''
|
|
|
|
+ this.titleText = '新增用户'
|
|
} else {
|
|
} else {
|
|
this.getRoleList()
|
|
this.getRoleList()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
nowData: {
|
|
nowData: {
|
|
handler (newValue, oldValue) {
|
|
handler (newValue, oldValue) {
|
|
- if (this.isShow && newValue) {
|
|
|
|
- if (this.data.id) { // 编辑
|
|
|
|
|
|
+ if (this.isshow && newValue) {
|
|
|
|
+ if (this.nowData.id) { // 编辑
|
|
this.titleText = '编辑用户'
|
|
this.titleText = '编辑用户'
|
|
this.form = Object.assign({}, this.nowData)
|
|
this.form = Object.assign({}, this.nowData)
|
|
if (this.nowData.roleIds) {
|
|
if (this.nowData.roleIds) {
|
|
@@ -207,8 +214,7 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.form.roleNames = []
|
|
this.form.roleNames = []
|
|
}
|
|
}
|
|
- } else { // 新增
|
|
|
|
- this.titleText = '新增用户'
|
|
|
|
|
|
+ this.form.loginFlag = Number(this.nowData.loginFlag)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|