后台
/**
* 分页 商品的标题变动
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入goodsTitle")
public R<IPage<GoodsTitle>> list(@ApiIgnore @RequestParam Map<String, Object> map, Query query) {
if (StrUtil.isBlank(query.getAscs()) && StrUtil.isBlank(query.getDescs())) {
query.setAscs(CommonConstant.FIELD_SORT);// sort字段排序
}
IPage<GoodsTitle> pages = goodsTitleService.page(Condition.getPage(query), Condition.getQueryWrapper(map, GoodsTitle.class));
return R.data(pages);
}
前端
searchChange(params, done) {
let validatenull = this.validatenull;
let findObject = this.findObject;
let option = this.option;
let keys = Object.keys(params);
keys.forEach(function (key) {
const column = findObject(option.column, key);
if (column.hasOwnProperty('match')) {
let value = params[key];
if (!validatenull(value)) {
params[key + "_" + column["match"]] = value;// 如:_equal
params[key] = null;
}
}
});
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
增加的属性是这样:match: "equal",