Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增filters和sorter状态,用来保留refresh时丢失已选筛选排序bug #1257

Merged
merged 1 commit into from
Nov 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/components/Table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ export default {

localLoading: false,
localDataSource: [],
localPagination: Object.assign({}, this.pagination)
localPagination: Object.assign({}, this.pagination),

// 存储表格onchange时的filters, sorter对象
filters: {},
sorter: {}
}
},
props: Object.assign({}, T.props, {
Expand Down Expand Up @@ -135,7 +139,10 @@ export default {
* @param {Object} filters 过滤条件
* @param {Object} sorter 排序条件
*/
loadData (pagination, filters, sorter) {
loadData (pagination, filters = this.filters, sorter = this.sorter) {
this.filters = filters
this.sorter = sorter

this.localLoading = true
const parameter = Object.assign({
pageNo: (pagination && pagination.current) ||
Expand Down