手机号邮箱验证

This commit is contained in:
wangxuemei
2024-10-16 15:23:38 +08:00
parent ac6bd15964
commit 5b4cc0a975
9 changed files with 80 additions and 58 deletions

View File

@@ -6,7 +6,7 @@
<a-form layout="inline">
<a-form-item class="select">
<!-- v-model:value="searchParam.name" -->
<a-input v-model:value="searchParam.teacherNameOrMobel" style="width: 276px; height: 40px; border-radius: 8px"
<a-input v-model:value="searchParam.name" style="width: 276px; height: 40px; border-radius: 8px"
placeholder="请输入讲师姓名/手机号进行检索" allowClear showSearch>
</a-input>
</a-form-item >
@@ -97,16 +97,16 @@
<!-- 讲师名称 ,手机号码-->
<a-row :gutter="16">
<a-col :span="24">
<a-form-item label="讲师名称" name="userNo">
<a-form-item label="讲师名称" name="name">
<a-input v-model:value="formParam.name" class="draitem"
placeholder="请输入讲师姓名" allowClear showSearch>
</a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="手机号码" name="mobile">
<a-form-item label="手机号码" name="mobile" prop="mobile">
<a-input v-model:value="formParam.mobile" class="draitem"
placeholder="请输入手机号码" allowClear showSearch @blur="sendPhone">
placeholder="请输入手机号码" allowClear showSearch :maxLength="11" @blur="sendPhone">
</a-input>
</a-form-item>
</a-col>
@@ -121,8 +121,8 @@
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="讲师邮箱" name="email">
<a-input v-model:value="formParam.email" class="draitem"
<a-form-item label="讲师邮箱" name="email" prop="email">
<a-input v-model:value="formParam.email" type="email" class="draitem"
placeholder="请输入讲师邮箱" allowClear showSearch @blur="sendEmail">
</a-input>
</a-form-item>
@@ -251,7 +251,8 @@ import ProjectManager from "@/components/project/ProjectManagerNew";
import { getTeacherList, getTeacherById, deleteInTeacher, updateTeacherState, insertTeacher, updateInTeacher } from "../../api/Lecturer";
import { fileUp } from "../../api/indexEval";
import {getCookieForName} from "@/api/method"
import SearchTeacher from "@/components/project/SearchTeacher";;
import SearchTeacher from "@/components/project/SearchTeacher";
import boe from '@/assets/boe.jpg'
export default {
name: "ExternalLecturer",
components: {
@@ -290,12 +291,13 @@ export default {
formParam: {
description:"",
teacherType:'2',
photo: 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png'
photo:boe,
status:1
},
vf:true,
searchParam: {
teacherType:2,
teacherNameOrMobel: null,//姓名
name: null,//姓名
status: null,//状态
pageNo: "1",
pageSize: "10"
@@ -339,8 +341,8 @@ export default {
};
const AccountStatusList = ref([
{ value: '', label: "全部" },
{ value: 0, label: "启用" },
{ value: 1, label: "停用" },
{ value: 1, label: "启用" },
{ value: 2, label: "停用" },
])
const columns = ref([
{
@@ -421,7 +423,7 @@ export default {
pageNo: 1,
pageSize: 10,
teacherType:2,
teacherNameOrMobel: null,
name: null,
status: null
};
getTableDate();
@@ -452,7 +454,7 @@ export default {
state.teacherdialog = true;
state.teacherdialogtitle = '新增讲师'
state.vf = true
state.formParam.photo = state.formParam.photo === null ? 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png' : state.formParam.photo
state.formParam.photo = state.formParam.photo === null ?boe : state.formParam.photo
}
//修改讲师信息弹窗
@@ -514,7 +516,7 @@ export default {
//确认删除
const closeDeleteTeacher = () => {
//调用删除接口
deleteInTeacher({id:state.delTeacherId}).then((res) => {
deleteInTeacher(state.delTeacherId).then((res) => {
if (res.data.code == 200) {
message.success("删除成功");
state.deleteTeacherdialog = false
@@ -564,8 +566,9 @@ export default {
//清空数据
const cancel = () => {
state.formParam = {
status:1,
teacherType:2,
photo: 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png',
photo:boe,
name: null,
mobile: null,
email: null,
@@ -580,6 +583,20 @@ export default {
const rules = {
name: [{ required: true, message: '讲师不能为空' }],
supplier:[{ required: true, message: '供应商不能为空' }],
email:[
{
type: "email",
message: '请输入正确的邮箱地址',
trigger: "blur"
}
],
mobile: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur"
}
]
}
const rule =()=>{
if (state.formParam.name==null){
@@ -606,7 +623,7 @@ export default {
console.log("外部讲师详情", res.data);
state.formParam = res.data.data
state.formParam.description = state.formParam.description === null ? '' : state.formParam.description
state.formParam.photo = state.formParam.photo === null ? 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png' : state.formParam.photo
state.formParam.photo = state.formParam.photo === null ?boe : state.formParam.photo
})
.catch((err) => {
console.log("外部讲师详情", err);
@@ -631,7 +648,7 @@ export default {
const handleExport = () => {
window.open(
`${process.env.VUE_APP_BASE_API}/teacher/export?pageNo=${state.searchParam.pageNo
}&pageSize=${state.searchParam.pageSize}&teacherNameOrMobel=${state.searchParam.teacherNameOrMobel ? state.searchParam.teacherNameOrMobel : ""}&status=${state.searchParam.status ? state.searchParam.status : ""}`
}&pageSize=${state.searchParam.pageSize}&name=${state.searchParam.name ? state.searchParam.name : ""}&status=${state.searchParam.status ? state.searchParam.status : ""}`
);
// this.download('lesson_records/export', {
// ...state.searchParam