// 新增函数
function func2() {
xzqd1.style = "display: none"
xzqd.style = "display: block"
bjxz.style = 'display: block';
hsmc.style = 'display: block'
}
// 输入框获取焦点
function hqjd(e, a) {
e.target.style.borderColor = "#51c9ff"
arr[a].style.opacity = '0'
}
// 输入框失去焦点
function sqjd(e, a) {
if (e.target.value == "" || e.target == undefined || e.target == null) {
e.target.style.borderColor = "red";
arr[a].style.opacity = '1';
} else {
e.target.style.borderColor = "#e2e2e2"
arr[a].style.opacity = '0';
}
}
// 查询接口
function queryFun(){
$.ajax({
type:"get",
url:`${base}/queryed`,
data:{
queryStr: sj.value.toString()
},
success:(req)=>{
console.log(req);
createFun(req)
}
})
}
queryFun();
// 新增接口
function addFunc(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)=>{
console.log(req);
queryFun();
}
})
}
// 查询
function cxxx() {
queryFun();
// var filter, tr, td, td4, td5, td6;
// filter = sj.value.toString();
// tr = document.getElementsByTagName("tr");
// for (var i = 0; i < tr.length; i++) {
// td = tr[i].getElementsByTagName("td")[1];
// td4 = tr[i].getElementsByTagName("td")[4];
// td5 = tr[i].getElementsByTagName("td")[5];
// td6 = tr[i].getElementsByTagName("td")[6];
// if (td || td4 || td5 || td6) {
// if (td.innerHTML.toString() == filter || td4.innerHTML.toString() == filter || td5.innerHTML.toString() == filter || td6.innerHTML.toString() == filter) {
// tr[i].style.display = "";
// } else {
// tr[i].style.display = "none";
// }
// }
// }
}
// 重置
function czz() {
tr = document.getElementsByTagName("tr");
sj.value = "";
queryFun();
// for (var i = 0; i < tr.length; i++) {
// tr[i].style.display = "";
// }
}