<div class="form-group">
<label class="col-lg-3 col-sm-2 control-label">资源种类</label>
<div class="col-lg-9">
<select id="item1" onchange="fn()" name="resource"
class="form-control m-bot15" placeholder="请选择" style="width: 200px;">
<option value="">请选择</option>
<option value="服务器">服务器</option>
<option value="内存">内存</option>
<option value="存储">存储</option>
<option value="其他">其他</option>
</select>
</div>
</div>
function fn(){
var name=$("#item1").find("option:selected").val();
if(name !==null){
resource=name;
}
};
//查询参数
function queryParams(params) {
var search={};
$.each($("#searchform").serializeArray(), function(i, field) {
search[field.name] = field.value;
})
var filters=JSON.stringify(search);
var dataObj=eval("("+filters+")");
var str={"page":this.pageNumber,
"pageSize":this.pageSize,
"filter":{"filters":[{"field":"resource","value":dataObj.resource}]},
"sort":[{"field":"name","dir":"ASC"}]};
var baseData = JSON.stringify(str);
var param = {
models :baseData
}
return param;
}