| | |
| | | expireTime: [this.account.expireTime], |
| | | id: [this.account.id]
|
| | | }); |
| | | this.searchOptions = this.account.organization ? [this.account.organization] : []; |
| | | } |
| | | |
| | | save() { |
| | |
| | | } |
| | | |
| | | check(accountName) { |
| | | this.http.get(environment.SERVER_BASH_URL + '/account/' + accountName).subscribe((res: any) => { |
| | | if (res.data > 0) { |
| | | this.validateForm.controls.accountName.setErrors({unique: true}); |
| | | } |
| | | }); |
| | | if (accountName) { |
| | | this.http.get(environment.SERVER_BASH_URL + '/account/' + accountName).subscribe((res: any) => { |
| | | if (res.data > 0) { |
| | | this.validateForm.controls.accountName.setErrors({unique: true}); |
| | | } else { |
| | | this.validateForm.controls.accountName.reset; |
| | | } |
| | | }); |
| | | } else { |
| | | this.validateForm.controls.accountName.setErrors({required: true}); |
| | | } |
| | | } |
| | | |
| | | 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; |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |