|
@@ -137,7 +137,7 @@ export default {
|
|
|
const columns = this.columns
|
|
|
columns.forEach(item => {
|
|
|
if(item.sorter){
|
|
|
- item.sortDirections = ['descend', 'ascend']
|
|
|
+ item.sortDirections = ['descend', 'ascend','']
|
|
|
}
|
|
|
})
|
|
|
this.needTotalList = this.initTotalList(columns)
|
|
@@ -176,8 +176,9 @@ export default {
|
|
|
* @param {Object} sorter 排序条件
|
|
|
*/
|
|
|
loadData (pagination, filters, sorter) {
|
|
|
- console.log(sorter)
|
|
|
+ console.log(sorter,this.localSorter)
|
|
|
this.localLoading = true
|
|
|
+ this.localSorter = sorter
|
|
|
const parameter = Object.assign({
|
|
|
pageNo: (pagination && pagination.current) ||
|
|
|
this.showPagination && this.localPagination.current || this.pageNum,
|
|
@@ -186,17 +187,16 @@ export default {
|
|
|
tableId: this.tableId,
|
|
|
index: this.index
|
|
|
},
|
|
|
- (sorter && sorter.field && {
|
|
|
+ (sorter && sorter.field &&sorter.order && {
|
|
|
sortField: sorter.field
|
|
|
- }) || this.localSorter && {sortField: this.localSorter.field},
|
|
|
+ }) || this.localSorter && this.localSorter.order && {sortField: this.localSorter.field},
|
|
|
(sorter && sorter.order && {
|
|
|
sortOrder: sorter.order
|
|
|
}) || this.localSorter && {sortOrder: this.localSorter.order}, {
|
|
|
...filters
|
|
|
}
|
|
|
)
|
|
|
- this.localSorter = sorter
|
|
|
- // console.log('parameter', parameter)
|
|
|
+ console.log('parameter', parameter)
|
|
|
const result = this.data(parameter)
|
|
|
// 对接自己的通用数据接口需要修改下方代码中的 r.pageNo, r.count, r.data
|
|
|
// eslint-disable-next-line
|