" + temp + "";
else
classinfohtml += "
";
});
$("#cc").html(classinfohtml);
// 科类 循环渲染
var classinfohtml1 = "";
$.each(classinfo1, function(index, temp) {
if (index == 0)
classinfohtml1 += "
";
else
classinfohtml1 += "
";
});
$("#kl").html(classinfohtml1);
clickinfo();
}
});
}
$('#province a').click(function() {
$(this).parent().each(function() { //移除其余非点中状态
$('#province a').removeClass("on");
});
$(this).addClass("on"); //给所点中的增加样式
senddate();
})
// 加载
senddate();
})
/**
* 触发检索
*
*/
function aclick(data, type) {
$(data).parent().each(function() { //移除其余非点中状态
$(this).children().each(function() { //移除其余非点中状态
$(this).removeClass("active");
});
});
$(data).addClass("active"); //给所点中的增加样式
if (type==4){
clickinfo(type);
}else {
clickinfo1();
}
}
function clickinfo1() {
var yearinfo = []; // 年度
var classinfo = []; // 科类
var classinfo1 = []; // 科类
// var classinfo=['理工','文史','综合改革','艺术','体育'];
var zslx = []; // 招生类型
var zsxq = []; // 计划类别
var province = ''; // 选择的省份
$("#province").find('label').each(function() {
if ($(this).attr("class") == 'active')
province = $(this).text().replace(/\s/g, '');
});
// 暂时不需要通过 年份科类 等进行数据更新
// 获取选中年份
var yearinfoval = '';
$("#zsnf").find('label').each(function() {
if ($(this).attr("class") == 'active')
yearinfoval = $(this).text().replace(/\s/g, '');
});
// 获取选中科类
var classinfoval = '';
// $("#klmc").find('a').each(function(){
// if($(this).attr("class")=='on')
// classinfoval = $(this).text();
// });
// 获取招生校区
var zsxqVal = '';
// $("#zsxq").find('a').each(function(){
// if($(this).attr("class")=='on')
// zsxqVal = $(this).text();
// });
$.ajax({
url: '/system/resource/bkzsw/zsjhorder1.jsp',
type: 'post',
data: { owner:2018273360,tempid:4, sf: encodeURI(province) , nf: encodeURI(yearinfoval),},
dataType: 'json',
success: function(data) {
data.forEach(function(temp) {
if (temp.cc && classinfo.indexOf(temp.cc) == -1) { // 层次
classinfo.push(temp.cc);
}
if (temp.kl && classinfo1.indexOf(temp.kl) == -1) { // 科类封装
classinfo1.push(temp.kl);
}
})
// 科类 循环渲染
var classinfohtml = "";
var newclassinfo = sortClassinfo(classinfo);
$.each(newclassinfo, function(index, temp) {
if (index == 0)
classinfohtml += "
";
else
classinfohtml += "
";
});
$("#cc").html(classinfohtml);
// 科类 循环渲染
var classinfohtml1 = "";
$.each(classinfo1, function(index, temp) {
if (index == 0)
classinfohtml1 += "
";
else
classinfohtml1 += "
";
});
$("#kl").html(classinfohtml1);
clickinfo();
}
});
}
// zp_start 20230326 添加排序
function addOrderSearch(searchOrder) {
if (!orderType || "asc" == orderType) {
orderType = "desc";
} else {
orderType = "asc";
}
if (!orderStr || orderStr != searchOrder) {
orderType = "desc";
orderStr = searchOrder;
}
clickinfo();
}
// zp_end 20230326 添加排序
/**
* 进行数据查询渲染
*
*/
function clickinfo() {
// 获取选中省份
var province = '';
$("#province").find('label').each(function() {
if ($(this).attr("class") == 'active')
province = $(this).text().replace(/\s/g, '');
});
// 获取选中年份
var yearinfoval = '';
$("#zsnf").find('label').each(function() {
if ($(this).attr("class") == 'active')
yearinfoval = $(this).text().replace(/\s/g, '');
});
// 获取选中科类
var classinfoval1 = '';
$("#kl").find('label').each(function() {
if ($(this).attr("class") == 'active')
classinfoval1 = $(this).text().replace(/\s/g, '');
});
// 获取选中科类
var classinfoval = '';
$("#cc").find('label').each(function() {
if ($(this).attr("class") == 'active')
classinfoval = $(this).text().replace(/\s/g, '');
});
$.ajax({
url: '/system/resource/bkzsw/zsjhorder1.jsp',
type: 'post',
data: { owner:2018273360,tempid:4, sf: encodeURI(province), cc: encodeURI(classinfoval), nf: encodeURI(yearinfoval), kl: encodeURI(classinfoval1), orderByStr: encodeURI(orderStr), orderType: encodeURI(orderType) },
//data: {owner:1418633232,tempid:16,province:province,year:yearinfoval,classinfo:classinfoval,zslx:zslxval},
dataType: 'json',
success: function(data) {
var number = 0;
var count = 0;
var max = 0;
var min = 0;
var zsjhfzyqkhtml = "
| 省市 | 年份 | 科类 | 层次 | 录取专业 | 最高分 | 最低分 | 平均分 |
|---|
";
data.forEach(function(temp) {
if (temp.pjf != null && !isNaN(temp.pjf)) {
number += parseFloat(temp.pjf);
count++;
}
if (temp.zgf != null && parseFloat(temp.zgf) > parseFloat(max)) {
max = temp.zgf;
}
if (temp.zdf != null && (parseFloat(temp.zdf) < parseFloat(min) || min == 0)) {
min = temp.zdf;
}
zsjhfzyqkhtml +=
"
| " + (temp.sf ? temp.sf : "") + " | " + (temp.nf ? temp.nf : "") + " | " + (temp.kl ? temp.kl : "") + " | " + (temp.cc ? temp.cc : "") + " | " + (temp.lqzy ?
temp.lqzy : "") + " | " + (temp.zgf ? temp.zgf : "") + " | " + (temp.zdf ? temp.zdf : "") + " | " + (temp.pjf ? temp.pjf : "") + " |
";
})
if (isNaN(parseFloat(number) / parseInt(count))) {
count = 0;
} else {
count = parseFloat(number) / parseInt(count);
count = count.toFixed(2)
}
$("#zsjhgk").html("
| 省市 | 年份 | 科类 | 层次 | 最高分 | 最低分 | 平均分 |
|---|
| " + province + " | " + yearinfoval + " | " + classinfoval1 + " | " + classinfoval + " | " + max + " | " + min + " | " + count + " |
");
$("#zsjhfzyqk").html(zsjhfzyqkhtml);
}
});
}
function sortClassinfo(classinfo) {
const result = [];
// 按顺序检查并添加存在的项
if (classinfo.includes('本科提前批B段')) {
result.push('本科提前批B段');
}
if (classinfo.includes('本科')) {
result.push('本科');
}
if (classinfo.includes('对口高职本科批')) {
result.push('对口高职本科批');
}
return result;
}