|
@@ -35,7 +35,20 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
-
|
|
|
|
|
|
+ <a-row :gutter="20">
|
|
|
|
+ <a-col :span="24">
|
|
|
|
+ <!-- 用户账号 -->
|
|
|
|
+ <a-form-item label="用户账号" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
|
|
|
|
+ <a-input
|
|
|
|
+ placeholder="请输入用户账号"
|
|
|
|
+ :maxLength="50"
|
|
|
|
+ v-decorator="['formData.loginName', {
|
|
|
|
+ initialValue: formData.loginName,
|
|
|
|
+ rules: [{ required: true, message: '请输入用户账号!' },{pattern: /^[0-9A-Za-z]+$/, message: '用户账号为数字或大小写字母组成!'}] }]"
|
|
|
|
+ />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
<!-- 性别 -->
|
|
<!-- 性别 -->
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
@@ -109,7 +122,7 @@
|
|
style="min-height: 50px;"
|
|
style="min-height: 50px;"
|
|
:maxLength="500"
|
|
:maxLength="500"
|
|
placeholder="请输入备注(最多500个字符)"
|
|
placeholder="请输入备注(最多500个字符)"
|
|
- autosize />
|
|
|
|
|
|
+ autoSize />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -160,10 +173,10 @@ export default {
|
|
name: '',
|
|
name: '',
|
|
loginFlag: '', // 活动状态
|
|
loginFlag: '', // 活动状态
|
|
phone: '',
|
|
phone: '',
|
|
|
|
+ loginName: '',
|
|
sex: '',
|
|
sex: '',
|
|
remarks: ''
|
|
remarks: ''
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -178,11 +191,8 @@ export default {
|
|
console.log(values, 'values222')
|
|
console.log(values, 'values222')
|
|
if (!err) {
|
|
if (!err) {
|
|
values.formData.roleNames = values.formData.roleNames.join(',')
|
|
values.formData.roleNames = values.formData.roleNames.join(',')
|
|
- console.log(values.formData, ' formData.type222222222')
|
|
|
|
- console.log(Object.assign({ id: this.data.id ? this.data.id : '' }, values.formData))
|
|
|
|
saveUserPower(Object.assign({ id: this.data.id ? this.data.id : '' }, values.formData)).then(res => {
|
|
saveUserPower(Object.assign({ id: this.data.id ? this.data.id : '' }, values.formData)).then(res => {
|
|
- console.log(res, 'res--save')
|
|
|
|
- if (res.status + '' === '200') {
|
|
|
|
|
|
+ if (res.status == 200) {
|
|
this.$message.success(res.message ? res.message : '保存成功')
|
|
this.$message.success(res.message ? res.message : '保存成功')
|
|
this.$emit('refresh')
|
|
this.$emit('refresh')
|
|
setTimeout(function () {
|
|
setTimeout(function () {
|
|
@@ -200,13 +210,14 @@ export default {
|
|
this.formData.name = ''
|
|
this.formData.name = ''
|
|
this.formData.loginFlag = ''
|
|
this.formData.loginFlag = ''
|
|
this.formData.phone = ''
|
|
this.formData.phone = ''
|
|
|
|
+ this.formData.loginName = ''
|
|
this.formData.sex = ''
|
|
this.formData.sex = ''
|
|
this.formData.remarks = ''
|
|
this.formData.remarks = ''
|
|
},
|
|
},
|
|
// 获取角色列表接口
|
|
// 获取角色列表接口
|
|
getRoleList () {
|
|
getRoleList () {
|
|
getRoleList().then(res => {
|
|
getRoleList().then(res => {
|
|
- if (res.status + '' === '200') {
|
|
|
|
|
|
+ if (res.status == 200) {
|
|
this.roleList = res.data
|
|
this.roleList = res.data
|
|
} else {
|
|
} else {
|
|
this.$message.warning(res.message)
|
|
this.$message.warning(res.message)
|
|
@@ -231,13 +242,9 @@ export default {
|
|
this.formData = Object.assign({}, this.data)
|
|
this.formData = Object.assign({}, this.data)
|
|
delete this.formData.no
|
|
delete this.formData.no
|
|
let roleNames = this.formData.roleNames
|
|
let roleNames = this.formData.roleNames
|
|
- console.log(roleNames, 'roleNames')
|
|
|
|
if (roleNames) {
|
|
if (roleNames) {
|
|
roleNames = roleNames.split(',')
|
|
roleNames = roleNames.split(',')
|
|
- console.log(roleNames, 'roleNames22')
|
|
|
|
const arr = []
|
|
const arr = []
|
|
- console.log(this.roleList, 'this.roleList')
|
|
|
|
-
|
|
|
|
roleNames.map(item => {
|
|
roleNames.map(item => {
|
|
const row = this.roleList.find(a => {
|
|
const row = this.roleList.find(a => {
|
|
return a.name == item
|
|
return a.name == item
|
|
@@ -246,16 +253,11 @@ export default {
|
|
arr.push(row.id)
|
|
arr.push(row.id)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
- console.log(arr, 'arrs')
|
|
|
|
this.formData.roleNames = arr
|
|
this.formData.roleNames = arr
|
|
} else {
|
|
} else {
|
|
this.formData.roleNames = []
|
|
this.formData.roleNames = []
|
|
}
|
|
}
|
|
-
|
|
|
|
this.formData.loginFlag = Number(this.formData.loginFlag)
|
|
this.formData.loginFlag = Number(this.formData.loginFlag)
|
|
- // this.formData.sex = Number(this.formData.sex)
|
|
|
|
- console.log(this.formData, 'this.formData')
|
|
|
|
} else {
|
|
} else {
|
|
this.titleText = '添加用户'
|
|
this.titleText = '添加用户'
|
|
}
|
|
}
|
|
@@ -267,9 +269,7 @@ export default {
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style >
|
|
|
|
- .modalBox{
|
|
|
|
- }
|
|
|
|
|
|
+<style>
|
|
.ant-modal-footer {
|
|
.ant-modal-footer {
|
|
display: none;
|
|
display: none;
|
|
}
|
|
}
|