ion model_search(){
var model_ids_val = '';
var url = window.location.href;//获取本页面的url连接
var model_ids = '';
var new_url = '';
var is_rewrite = '0';
$(".model_class").each(function(){//生成model_ids数据
if ($(this).is(":checked")) {
model_ids += 'M'+$(this).attr("ext");
}
});
if(is_rewrite>0){
//判断是否存在model_ids
if(url.indexOf('model_ids') ==-1){//不存在拼接
new_url = url;
}else{//替换
new_url = url.replace("-model_ids-"+model_ids_val,"");
}
new_url = new_url.replace(".html","-model_ids-"+model_ids+".html");
}else{
//判断是否存在model_ids
if(url.indexOf('model_ids') ==-1){//不存在拼接
new_url = url;
}else{//替换
new_url = url.replace("&model_ids="+model_ids_val,"");
}
new_url = new_url+'&model_ids='+model_ids; //新地址
}
location.href=new_url;//跳转
}
//任务模型多选
function model_all(){
$(".model_class").each(function(){
$(this).attr("checked", "checked");
$(this).parent().attr("class", "selected");
});
}
function select_model_a(model_id){
var model_ids = $("#task_model_ids").val();
var model_id = model_id;
var classes = $("#model_a_" + model_id).attr("class");
if (classes == 'selected') {
$("#model_a_" + model_id).attr("class", " ");
$("#model_a_" + model_id + " input").attr("checked", "");
}
else {
$("#model_a_" + model_id + " input").attr("checked", "checked");
$("#model_a_" + model_id).attr("class", "selected");
}
}