1、在options中添加queryParams参数
var options = {
url: prefix + "/list",
queryParams: queryParams,
columns: [{
field: 'id',
title: '主键'
},
{
field: 'name',
title: '名称'
}]
};
$.table.init(options);
2、在当前页添加queryParams方法
设置自定义查询参数为:userName
请求后台参数为:pageSize、pageNum、searchValue、orderByColumn、isAsc、userName
function queryParams(params) {
var search = .table.queryParams(params);
search.userName =("#userName").val();
return search;
}
3、如果是表格树,添加ajaxParams参数
var options = {
code: "deptId",
parentCode: "parentId",
uniqueId: "deptId",
url: prefix + "/list",
ajaxParams: {
"userId": "1",
"userName": "ruoyi"
},
columns: [{
field: 'id',
title: '主键'
},
{
field: 'name',
title: '名称'
}]
};
$.treeTable.init(options);
powered by kaifamiao