This commit is contained in:
richard-loafle 2020-02-07 17:48:57 +09:00
commit 82537b2d0d
2 changed files with 10 additions and 3 deletions

View File

@ -13,6 +13,7 @@
</mat-card-header>
<mat-card-content>
<ucap-integrated-search
#integratedSearch
[sessionVerinfo]="sessionVerinfo"
[presence]="presence$ | async"
[searchWord]="!!data.keyword ? data.keyword : ''"

View File

@ -1,4 +1,4 @@
import { Component, OnInit, Inject, OnDestroy } from '@angular/core';
import { Component, OnInit, Inject, OnDestroy, ViewChild } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA, PageEvent } from '@angular/material';
import { KEY_VER_INFO } from '@app/types';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
@ -31,6 +31,7 @@ import {
ProfileDialogData,
ProfileDialogResult
} from '../profile/profile.dialog.component';
import { IntegratedSearchComponent } from 'projects/ucap-webmessenger-ui/src/lib/components/integrated-search.component';
export interface IntegratedSearchDialogData {
keyword: string;
@ -59,6 +60,9 @@ export class IntegratedSearchDialogComponent implements OnInit, OnDestroy {
pageCurrent = 1;
pageListCount = 20;
@ViewChild('integratedSearch', { static: false })
integratedSearchComponent: IntegratedSearchComponent;
constructor(
public dialogRef: MatDialogRef<
IntegratedSearchDialogData,
@ -109,12 +113,14 @@ export class IntegratedSearchDialogComponent implements OnInit, OnDestroy {
onReSearch(searchWord: string) {
this.pageCurrent = 1;
this.integratedSearchComponent.paginator.pageIndex = 0;
this.onSearch(searchWord);
}
onSearch(searchWord: string) {
this.currentSearchWord = this.data.keyword;
if (this.currentSearchWord !== searchWord) {
this.currentSearchWord = searchWord;
}
if (searchWord.trim().length > 0) {
this.searchingProcessing = true;