多列排序平序问题

This commit is contained in:
wanghaoo 2018-09-26 16:51:21 +08:00
parent dae312519a
commit d52c9c26ca
3 changed files with 12 additions and 12 deletions

9
dist/demo.js vendored
View File

@ -51230,10 +51230,11 @@
} }
}); });
if (orderColslen > 0) { if (orderColslen > 0) {
//第一层排序
data = data.sort(function (a, b) { data = data.sort(function (a, b) {
return self._sortBy(a, b, orderCols, orderColslen, 1); return self._sortBy(a, b, orderCols, orderColslen, 1);
}); });
} else {
data = oldData.concat();;
} }
return data; return data;
}; };
@ -51282,13 +51283,13 @@
return da.key == column.key; return da.key == column.key;
}); });
seleObj.order = order; seleObj.order = order;
if (order === "flatscend") {
_this.changeOrderNum(column);
}
if (!seleObj.orderNum && (order == 'ascend' || order == 'descend')) { if (!seleObj.orderNum && (order == 'ascend' || order == 'descend')) {
seleObj.orderNum = _this.getOrderNum(); seleObj.orderNum = _this.getOrderNum();
} }
data = _this.multiSort(columns); data = _this.multiSort(columns);
if (order === "flatscend") {
_this.changeOrderNum(column);
}
} }
_this.setState({ _this.setState({

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -111,12 +111,11 @@ export default function sort(Table, Icon) {
} }
}) })
if(orderColslen>0){ if(orderColslen>0){
//第一层排序
data = data.sort(function(a, b) { data = data.sort(function(a, b) {
return self._sortBy(a,b,orderCols,orderColslen,1); return self._sortBy(a,b,orderCols,orderColslen,1);
}); });
}else{
data = oldData.concat();
} }
return data; return data;
@ -160,13 +159,13 @@ export default function sort(Table, Icon) {
}else{ }else{
seleObj = columns.find(da=>da.key == column.key); seleObj = columns.find(da=>da.key == column.key);
seleObj.order = order; seleObj.order = order;
if(order === "flatscend"){
this.changeOrderNum(column);
}
if(!seleObj.orderNum && (order=='ascend'||order=='descend')){ if(!seleObj.orderNum && (order=='ascend'||order=='descend')){
seleObj.orderNum = this.getOrderNum(); seleObj.orderNum = this.getOrderNum();
} }
data = this.multiSort(columns); data = this.multiSort(columns);
if(order === "flatscend"){
this.changeOrderNum(column);
}
} }