Skip to content

Commit

Permalink
fix(abc:simple-table): fix missing muli-sort, close #549
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Jul 4, 2018
1 parent d5ee7a6 commit 0aab18e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
12 changes: 7 additions & 5 deletions packages/abc/simple-table/simple-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,11 +604,13 @@ export class SimpleTableComponent implements OnInit, OnChanges, OnDestroy {

const ms = this.multiSort;
if (ms) {
Object.keys(this._sortMap).forEach(key => {
const item = this._sortMap[key];
ret[item.key] =
(item.column.sortReName || this.sortReName || {})[item.v] || item.v;
});
Object.keys(this._sortMap)
.filter(key => this._sortMap[key].enabled && this._sortMap[key].v)
.forEach(key => {
const item = this._sortMap[key];
ret[item.key] =
(item.column.sortReName || this.sortReName || {})[item.v] || item.v;
});
// 合并处理
if (typeof ms === 'object') {
ret = {
Expand Down
1 change: 1 addition & 0 deletions packages/abc/simple-table/simple-table.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,7 @@ describe('abc: simple-table', () => {
describe('#multiSort', () => {
beforeEach(() =>
(context.columns = [
{ title: '', index: 'index' },
{
title: '',
index: 'index',
Expand Down
2 changes: 1 addition & 1 deletion scaffold

0 comments on commit 0aab18e

Please sign in to comment.