From 1193f95d1eb81b95c27311c51282eb8b72cec106 Mon Sep 17 00:00:00 2001 From: 沈斌 <bluelazysb@hotmail.com> Date: Tue, 19 Dec 2017 10:03:38 +0800 Subject: [PATCH] updates --- src/app/routes/users/installer/installer.component.ts | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/app/routes/users/installer/installer.component.ts b/src/app/routes/users/installer/installer.component.ts index d7ce8aa..f7ac49c 100644 --- a/src/app/routes/users/installer/installer.component.ts +++ b/src/app/routes/users/installer/installer.component.ts @@ -42,7 +42,7 @@ this.q.pi = 1; } this.http.get('./assets/users-installer-data.json', this.q).subscribe((res: any) => { - const data = res.data; + let data = res.data; const total = res.total; if (this.q.sorter !== '') { @@ -55,22 +55,29 @@ }); } + if (this.q.u_name) { + data = data.filter(d => d.name.indexOf(this.q.u_name) > -1); + } + if (this.q.u_mobile) { + data = data.filter(d => d.mobile.toString().indexOf(this.q.u_mobile) > -1); + } + const start = (this.q.pi - 1) * this.q.ps; this.data = data.slice(start, start + this.q.ps); this.total = total; }); } - edit(i) { - this.modalHelper.static(UserInstallerEditComponent, { i }).subscribe(() => { - this.load(); + edit(user) { + this.modalHelper.static(UserInstallerEditComponent, { user }).subscribe(() => { + this.load(true); this.msgSrv.info('���������������������������������'); }); } add() { - const i = {}; - this.modalHelper.static(UserInstallerEditComponent, { i }); + const user = {}; + this.modalHelper.static(UserInstallerEditComponent, { user }); } save() { -- Gitblit v1.8.0