Skip to content

Commit 660a41f

Browse files
xiangzpsendya
authored andcommitted
新增filters和sorter状态,用来保留refresh时丢失已选筛选排序bug
由于refresh里调用loadData未穿参数,会导致调用时已选的排序等数据在请求查询接口时丢失
1 parent 47cc069 commit 660a41f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/components/Table/index.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ export default {
1111

1212
localLoading: false,
1313
localDataSource: [],
14-
localPagination: Object.assign({}, this.pagination)
14+
localPagination: Object.assign({}, this.pagination),
15+
16+
// 存储表格onchange时的filters, sorter对象
17+
filters: {},
18+
sorter: {}
1519
}
1620
},
1721
props: Object.assign({}, T.props, {
@@ -135,7 +139,10 @@ export default {
135139
* @param {Object} filters 过滤条件
136140
* @param {Object} sorter 排序条件
137141
*/
138-
loadData (pagination, filters, sorter) {
142+
loadData (pagination, filters = this.filters, sorter = this.sorter) {
143+
this.filters = filters
144+
this.sorter = sorter
145+
139146
this.localLoading = true
140147
const parameter = Object.assign({
141148
pageNo: (pagination && pagination.current) ||

0 commit comments

Comments
 (0)