From 4156fed8a32e81a61b706b8a17876f7a1fdcabb7 Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Wed, 27 Dec 2017 15:45:16 +0800 Subject: [PATCH] 安装 用户更新 --- src/app/routes/systems/account/account.component.ts | 21 +++++---------------- 1 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/app/routes/systems/account/account.component.ts b/src/app/routes/systems/account/account.component.ts index 9078ab4..7d925d8 100644 --- a/src/app/routes/systems/account/account.component.ts +++ b/src/app/routes/systems/account/account.component.ts @@ -22,14 +22,13 @@ query: any = { pageIndex: 1, - pageSize: 3, + pageSize: 10, isDelete: this.options[1].value }; data: any[] = []; total: 0; selectedRows: any[] = []; - curRows: any[] = []; allChecked = false; indeterminate = false; sortMap: any = {}; @@ -50,7 +49,7 @@ this.data = res.data.data; this.total = res.data.total; - this.dataChange(this.data); + this.refreshStatus(); }); } @@ -95,20 +94,15 @@ } checkAll(value: boolean) { - this.curRows.forEach(i => { + this.data.forEach(i => { i.checked = value; }); this.refreshStatus(); } - dataChange(res: any) { - this.curRows = res; - this.refreshStatus(); - } - refreshStatus() { - const allChecked = this.curRows.every(value => value.checked); - const allUnChecked = this.curRows.every(value => !value.checked); + const allChecked = this.data.every(value => value.checked); + const allUnChecked = this.data.every(value => !value.checked); this.allChecked = allChecked; this.indeterminate = (!allChecked) && (!allUnChecked); this.selectedRows = this.data.filter(value => value.checked); @@ -118,11 +112,6 @@ this.sortMap = {}; this.sortMap[field] = value; this.query.sorter = value ? `${field} ${value}` : ''; - this.load(true); - } - - reset(ls: any[]) { - for (const item of ls) item.value = false; this.load(true); } -- Gitblit v1.8.0