|
@ -199,14 +199,24 @@ export class RequestApi extends Base { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private async requestHandle(ops: any) { |
|
|
/** |
|
|
|
|
|
* 构建查询基本参数 |
|
|
|
|
|
* @param ops 当前分页排序信息 |
|
|
|
|
|
* @param noPageable 强制忽略表格分页配置 |
|
|
|
|
|
*/ |
|
|
|
|
|
buildFetchDataBaseParams(ops: any, noPageable: boolean = false) { |
|
|
const reqParams: any = {}; |
|
|
const reqParams: any = {}; |
|
|
if (this.props.pageable && !this.props.tree && !this.props.localMode) { |
|
|
if (noPageable) { |
|
|
reqParams.page = ops.pagination.page; |
|
|
reqParams.pageable = false; |
|
|
reqParams.size = ops.pagination.rowsPerPage; |
|
|
} else { |
|
|
|
|
|
if (this.props.pageable && !this.props.tree && !this.props.localMode) { |
|
|
|
|
|
reqParams.page = ops.pagination.page; |
|
|
|
|
|
reqParams.size = ops.pagination.rowsPerPage; |
|
|
|
|
|
} |
|
|
|
|
|
reqParams.pageable = this.props.tree || this.props.localMode ? false : this.props.pageable; |
|
|
} |
|
|
} |
|
|
reqParams.pageable = this.props.tree || this.props.localMode ? false : this.props.pageable; |
|
|
|
|
|
if (ops.pagination.sortBy && ops.pagination.sortBy !== '') { |
|
|
if (ops.pagination.sortBy && ops.pagination.sortBy !== '') { |
|
|
|
|
|
// 处理表格点击列头进行的排序
|
|
|
if (ops.pagination.descending) { |
|
|
if (ops.pagination.descending) { |
|
|
reqParams.sortBy = '-' + ops.pagination.sortBy; |
|
|
reqParams.sortBy = '-' + ops.pagination.sortBy; |
|
|
reqParams.descending = ops.pagination.descending; |
|
|
reqParams.descending = ops.pagination.descending; |
|
@ -214,10 +224,17 @@ export class RequestApi extends Base { |
|
|
reqParams.sortBy = ops.pagination.sortBy; |
|
|
reqParams.sortBy = ops.pagination.sortBy; |
|
|
} |
|
|
} |
|
|
} else if (this.props.sortBy && this.props.sortBy.length > 0) { |
|
|
} else if (this.props.sortBy && this.props.sortBy.length > 0) { |
|
|
|
|
|
// 处理表格配置的默认排序
|
|
|
reqParams.sortBy = this.props.sortBy; |
|
|
reqParams.sortBy = this.props.sortBy; |
|
|
} |
|
|
} |
|
|
|
|
|
return reqParams; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private async requestHandle(ops: any) { |
|
|
|
|
|
// 构建查询基本参数
|
|
|
|
|
|
const reqParams: any = this.buildFetchDataBaseParams(ops); |
|
|
|
|
|
|
|
|
// 后台 RestCrudController 查询
|
|
|
// 根据基本参数 + 查询表单 构建基于后台 criteria 查询的 URLSearchParams 对象
|
|
|
let urlSearchParams = this.tools?.criteriaFM.buildURLSearchParams(reqParams); |
|
|
let urlSearchParams = this.tools?.criteriaFM.buildURLSearchParams(reqParams); |
|
|
|
|
|
|
|
|
// 请求前事件触发
|
|
|
// 请求前事件触发
|
|
|