diff --git a/src/app/visitor/visitor.module.ts b/src/app/visitor/visitor.module.ts
index 279a825..9d40a9d 100644
--- a/src/app/visitor/visitor.module.ts
+++ b/src/app/visitor/visitor.module.ts
@@ -4,6 +4,7 @@ import {TranslateModule} from '@ngx-translate/core';
import {RouterModule} from '@angular/router';
import {VisitorComponent} from './visitor/visitor.component';
import {ReactiveFormsModule} from '@angular/forms';
+import {PageModule} from '../page/page/page.module';
/**
@@ -15,7 +16,8 @@ import {ReactiveFormsModule} from '@angular/forms';
CommonModule,
TranslateModule,
RouterModule,
- ReactiveFormsModule
+ ReactiveFormsModule,
+ PageModule
]
})
export class VisitorModule {
diff --git a/src/app/visitor/visitor/visitor.component.html b/src/app/visitor/visitor/visitor.component.html
index 3448d52..992e347 100644
--- a/src/app/visitor/visitor/visitor.component.html
+++ b/src/app/visitor/visitor/visitor.component.html
@@ -1,3 +1,26 @@
+
+
+
+
+
+
diff --git a/src/app/visitor/visitor/visitor.component.ts b/src/app/visitor/visitor/visitor.component.ts
index 58bfbb5..73f11d2 100644
--- a/src/app/visitor/visitor/visitor.component.ts
+++ b/src/app/visitor/visitor/visitor.component.ts
@@ -8,22 +8,32 @@ import {environment} from '../../../environments/environment';
import {CookieService} from 'ngx-cookie-service';
import {AbstractRoute} from '../../AbstractRoute';
import {Router} from '@angular/router';
+import {FormBuilder, FormGroup, Validators} from '@angular/forms';
+import {Commons} from '../../commons';
@Component({
selector: 'app-visitor',
templateUrl: './visitor.component.html',
styleUrls: ['./visitor.component.scss']
})
-export class VisitorComponent implements OnInit, MessageInterface {
+export class VisitorComponent extends Commons implements OnInit, MessageInterface {
constructor(private visitorService: VisitorService,
private messageUtil: MessageUtil,
private cookieService: CookieService,
private abstractRoute: AbstractRoute,
private router: Router,
+ private fb: FormBuilder,
) {
+ super();
}
+ // 查询表单
+ queryForm = this.fb.group({
+ // 查询预约人
+ appointment: this.fb.control('', [Validators.required]),
+ });
+
// 访客信息
visitors: Page
;
// 审核状态
@@ -36,7 +46,7 @@ export class VisitorComponent implements OnInit, MessageInterface {
// 加载访客信息
loadAll(page) {
this.currentPage = page;
- this.visitorService.loadAll(page).subscribe(r => {
+ this.visitorService.loadAll(Object.assign(this.queryForm.value, {currentPage: page})).subscribe(r => {
if (r.result === Result.OK) {
this.visitors = r.visitorList;
} else {
@@ -66,4 +76,8 @@ export class VisitorComponent implements OnInit, MessageInterface {
}
}
+ form(): FormGroup {
+ return this.queryForm;
+ }
+
}
diff --git a/src/app/visitor/visitor/visitor.service.ts b/src/app/visitor/visitor/visitor.service.ts
index a76692c..704760c 100644
--- a/src/app/visitor/visitor/visitor.service.ts
+++ b/src/app/visitor/visitor/visitor.service.ts
@@ -16,11 +16,9 @@ export class VisitorService extends JSONRequest {
}
// 加载访客信息
- loadAll(page: number): Observable {
+ loadAll(queryForm: object): Observable {
return this.http.get(HttpInterface.visitor, Object.assign(this.httpOptions, {
- params: {
- currentPage: page,
- }
+ params: queryForm
})).pipe(
catchError(this.handleError('加载访客信息'))
);