From ff5ee2b5f624345c65693aeddc1187629a7e85ac Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Fri, 05 Jan 2018 16:10:07 +0800 Subject: [PATCH] 账户 管理 --- src/app/routes/systems/account/account-edit/account-edit.component.html | 3 +-- src/app/routes/systems/account/account-edit/account-edit.component.ts | 13 +++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/app/routes/systems/account/account-edit/account-edit.component.html b/src/app/routes/systems/account/account-edit/account-edit.component.html index 3dd8d80..3ab5a28 100644 --- a/src/app/routes/systems/account/account-edit/account-edit.component.html +++ b/src/app/routes/systems/account/account-edit/account-edit.component.html @@ -38,8 +38,7 @@ <label>������</label> </div> <div nz-form-control nz-col [nzSpan]="8" > - <!-- <input nz-input formControlName="organizationId" maxlength="20" placeholder="20���������" /> --> - <nz-select style="width: 290px;" nzAllowClear [nzPlaceHolder]="'input search text'" [nzFilter]="true" nzShowSearch + <nz-select style="width: 290px;" nzAllowClear [nzPlaceHolder]="'input search text'" [nzFilter]="false" nzShowSearch formControlName="organizationId" (nzSearchChange)="searchChange($event)" [nzNotFoundContent]="'������������'" > <nz-option *ngFor="let option of searchOptions" [nzLabel]="option['name']" [nzValue]="option['id']"> </nz-option> </nz-select> diff --git a/src/app/routes/systems/account/account-edit/account-edit.component.ts b/src/app/routes/systems/account/account-edit/account-edit.component.ts index 692a055..d91dcc6 100644 --- a/src/app/routes/systems/account/account-edit/account-edit.component.ts +++ b/src/app/routes/systems/account/account-edit/account-edit.component.ts @@ -39,6 +39,7 @@ expireTime: [this.account.expireTime], id: [this.account.id] }); + this.searchOptions = this.account.organization ? [this.account.organization] : []; } save() { @@ -70,9 +71,13 @@ } searchChange(searchText) { - const query = encodeURI(searchText); - this.http.get(environment.SERVER_BASH_URL + '/organization/list/' + query).subscribe((res: any) => { - this.searchOptions = res.data; - }); + if (searchText) { + const query = encodeURI(searchText); + if (query) { + this.http.get(environment.SERVER_BASH_URL + '/organization/list/' + query).subscribe((res: any) => { + this.searchOptions = res.data; + }); + } + } } } -- Gitblit v1.8.0