后台添加手机用户

This commit is contained in:
chenbo 2024-01-03 14:03:20 +08:00
parent 53819a174e
commit e0b37628a9
1 changed files with 12 additions and 9 deletions

View File

@ -84,11 +84,10 @@
</el-card>
<el-dialog v-model="dialogFormVisible" title="添加用户" width="30%">
<el-form :model="form">
<el-form-item label="手机号">
<el-form :model="form" ref="addForm">
<el-form-item label="手机号" prop="mobile">
<el-input v-model="form.mobile" autocomplete="off" />
<span>
<el-icon><Pointer /></el-icon>
初始密码:123456
</span>
@ -125,18 +124,22 @@ const { pager, getLists, resetPage, resetParams } = usePaging({
onActivated(() => {
getLists()
})
const dialogFormVisible = ref(false)
const form = reactive({
"mobile": ""
})
const addForm = ref()
const addUser = () => {
addUserApi(form)
ElMessage({
message: '用户添加成功',
type: 'success',
addUserApi(form).then(() => {
ElMessage({
message: '用户添加成功',
type: 'success',
})
addForm.value.resetFields()
dialogFormVisible.value = false
getLists()
})
dialogFormVisible.value = false
getLists()
}
getLists()
</script>