查询接口
let base = “http://127.0.0.1:81”;
let schoolTd;
function queryFun(){
KaTeX parse error: Expected '}', got 'EOF' at end of input: … url:`{base}/seach, data:{ strName:sj.value.toString() }, success:(req)=>{ createTable(req) } }) } queryFun(); 新增接口 function addFun(a,b,c,d,e,f,g){ $.ajax({ type:"get", url:
${base}/add`,
data:{
userName:a,
sex:b,
age:c,
className:d,
schoolNum:e,
iphone:f,
createTime:g
},
success:(req)=>{
queryFun();
}
})
}
// 班级新增确定
function func3() {
if (inputt[1].value == “”) {
inputt[1].style.borderColor = “red”;
arr[0].style.opacity = ‘1’;
} else if (inputt[2].value == “”) {
inputt[2].style.borderColor = “red”
arr[1].style.opacity = ‘1’
} else if (inputt[3].value == “”) {
inputt[3].style.borderColor = “red”
arr[2].style.opacity = ‘1’
} else if (inputt[4].value == “”) {
inputt[4].style.borderColor = “red”
arr[3].style.opacity = ‘1’
} else if (inputt[5].value == “”) {
inputt[5].style.borderColor = “red”
arr[4].style.opacity = ‘1’
} else if (srxb.value == “”) {
srxb.style.borderColor = “red”
} else {
if (!reg_tel.test(inputt[5].value)) {
return alert(‘请输入正确的手机号!’)
} else if (!reg_tell.test(inputt[2].value)) {
return alert(‘请输入正确的年龄!’)
}
else {
var n = new Date().getFullYear();
var y = new Date().getMonth() + 1;
var r = new Date().getDate();
bjxz.style = ‘display: none’;
hsmc.style = ‘display: none’
for (var i = 0; i < arr.length; i++) {
inputt[i + 1].style.borderColor = “#e2e2e2”
arr[i].style.opacity = ‘0’
}
addFun(inputt[1].value,srxb.value,
inputt[2].value,
inputt[3].value,
inputt[4].value,
inputt[5].value.toString(),
${n}/${y}/${r}
)