xufenglei
2018-07-20 efa7b6d79650d2f6813071b49f02ccce94c03f86
src/app/routes/environment/management/management.component.ts
@@ -13,7 +13,6 @@
})
export class EnvironmentManagementComponent implements OnInit, OnDestroy {
    data: any = {};
    offlineChartData: any[] = [];
    constructor(
@@ -42,26 +41,8 @@
            });
        }
        this.offlineChartData = offlineChartData;
        this.data = {
            searchData: searchData
        };
    }
    ngOnDestroy(): void {
    }
    sort(sortName, sortValue) {
        this.data.searchData = [
            ...(<any[]>this.data.searchData).sort((a, b) => {
                if (a[sortName] > b[sortName]) {
                    return (sortValue === 'ascend') ? 1 : -1;
                } else if (a[sortName] < b[sortName]) {
                    return (sortValue === 'ascend') ? -1 : 1;
                } else {
                    return 0;
                }
            })
        ];
    }
}