增加访客管理界面

change
panqihua 5 years ago
parent ba49ee7658
commit 134a76b869
  1. 5
      src/app/app-routing.module.ts
  2. 5
      src/app/app.component.html
  3. 5
      src/app/app.module.ts
  4. 2
      src/app/forum/forum.module.ts
  5. 0
      src/app/forum/forum/forum.component.html
  6. 0
      src/app/forum/forum/forum.component.scss
  7. 0
      src/app/forum/forum/forum.component.spec.ts
  8. 14
      src/app/forum/forum/forum.component.ts
  9. 4
      src/app/interface/HttpInterface.ts
  10. 6
      src/app/interface/Response.ts
  11. 19
      src/app/interface/Visitor.ts
  12. 12
      src/assets/i18n/en-US.json
  13. 19
      src/assets/i18n/zh-CN.json

@ -3,8 +3,9 @@ import {RouterModule, Routes} from '@angular/router';
import {LoginComponent} from './account/login/login.component';
import {RegisterComponent} from './account/register/register.component';
import {ResetpwdComponent} from './account/resetpwd/resetpwd.component';
import {ForumComponent} from './forum/forum.component';
import {ForumComponent} from './forum/forum/forum.component';
import {NoticeComponent} from './forum/notice/notice.component';
import {VisitorComponent} from './visitor/visitor/visitor.component';
// 路由配置
export const routes: Routes = [
@ -18,6 +19,8 @@ export const routes: Routes = [
{path: 'forum', component: ForumComponent},
// 公告管理
{path: 'notice', component: NoticeComponent},
// 访客管理
{path: 'visitor', component: VisitorComponent},
// 自动重定向到登陆
{path: '', redirectTo: 'login', pathMatch: 'full'}
];

@ -3,7 +3,10 @@
{{ 'APP_TITLE' | translate }}
</span>
<a [routerLink]="['/forum']" *ngIf="isLogin">{{ 'forum.name' | translate }}</a>
<ng-container *ngIf="isLogin">
<a [routerLink]="['/forum']">{{ 'forum.name' | translate }}</a>
<a [routerLink]="['/visitor']">{{ 'visitor.name' | translate }}</a>
</ng-container>
<div class="dropdown">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown"

@ -16,7 +16,9 @@ import {ErrorComponent} from './error/error.component';
// 账号管理模块
import {AccountModule} from './account/account/account.module';
// 论坛模块
import {ForumModule} from './forum/forum/forum.module';
import {ForumModule} from './forum/forum.module';
// 访客管理模块
import {VisitorModule} from './visitor/visitor.module';
// Http请求模块
import {HttpClient, HttpClientModule} from '@angular/common/http';
import {HtmlPipe} from './html.pipe';
@ -42,6 +44,7 @@ export function HttpLoaderFactory(http: HttpClient) {
ReactiveFormsModule,
AccountModule,
ForumModule,
VisitorModule,
HttpClientModule,
TranslateModule.forRoot({
loader: {

@ -1,7 +1,7 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
// 论坛组件
import {ForumComponent} from '../forum.component';
import {ForumComponent} from './forum/forum.component';
import {TranslateModule} from '@ngx-translate/core';
import {RouterModule} from '@angular/router';

@ -1,13 +1,13 @@
import {Component, OnInit} from '@angular/core';
import {Router} from '@angular/router';
import {ForumService} from './forum.service';
import {Result} from '../interface/Result';
import {Active, Complaint, Forum} from '../interface/ForumType';
import {Notice} from '../interface/Notice';
import {MessageInterface, MessageUtil} from '../message/message.service';
import {NoticeService} from './notice/notice.service';
import {ForumService} from '../forum.service';
import {Result} from '../../interface/Result';
import {Active, Complaint, Forum} from '../../interface/ForumType';
import {Notice} from '../../interface/Notice';
import {MessageInterface, MessageUtil} from '../../message/message.service';
import {NoticeService} from '../notice/notice.service';
import {TranslateService} from '@ngx-translate/core';
import {ForumNewResponse} from '../interface/Response';
import {ForumNewResponse} from '../../interface/Response';
/**
*

@ -27,7 +27,9 @@ const HttpInterface = {
// 添加公告
addNotice: '/api/forum/notice/add',
// 删除公告
deleteNotice: '/api/forum/notice/delete'
deleteNotice: '/api/forum/notice/delete',
// 访客管理
visitor: '/api/visitor'
};
for (const key of Object.keys(HttpInterface)) {

@ -4,6 +4,7 @@ import {EmailType} from './EmailType';
import {Notice} from './Notice';
import {Forum} from './ForumType';
import {Page} from './Page';
import {Visitor} from './Visitor';
export interface Response {
// 响应结果
@ -53,3 +54,8 @@ export interface ForumNoticeResponse extends Response {
export interface ForumNewResponse extends Response {
forumList: Page<Forum>;
}
// 访客信息响应
export interface VisitorResponse extends Response {
visitorList: Page<Visitor>;
}

@ -0,0 +1,19 @@
export interface Visitor {
id: string;
// 预约人
appointment: string;
// 预约时间
time: number;
// 拜访目的
notes: string;
// 审核状态
status: VisitorStatus;
// 审核管理员
managerName: string;
}
export enum VisitorStatus {
uncheck = 'uncheck',
ok = 'ok',
fail = 'fail'
}

@ -34,7 +34,17 @@
"notice_title": "notice title",
"notice_content": "notice content"
},
"tip":{
"visitor": {
"name": "访客预约管理",
"username": "预约人",
"time": "预约时间",
"notes": "拜访目的",
"admin": "审核管理员",
"action": "操作",
"allow": "通过",
"reject": "拒绝"
},
"tip": {
"input": "please input {{value}}",
"HELLO": "Hello <span style='color:red'>{{value}}</span> welcome to you",
"notnull": "The {{value}} cannot be empty",

@ -34,7 +34,20 @@
"notice_title": "公告标题",
"notice_content": "公告内容"
},
"tip":{
"visitor": {
"name": "访客预约管理",
"username": "预约人",
"time": "预约时间",
"notes": "拜访目的",
"admin": "审核管理员",
"action": "操作",
"ok": "通过",
"fail": "拒绝",
"checked": "已审核",
"uncheck": "未审核",
"status": "审核状态"
},
"tip": {
"input": "请输入{{value}}",
"HELLO": "欢迎管理员<span style='color:red'>{{value}}</span>登陆",
"notnull": "{{value}}不能为空",
@ -108,6 +121,10 @@
"check_ok": "审核成功",
"check_fail": "审核失败"
}
},
"visitor": {
"check_ok": "审核成功",
"check_fail": "审核失败"
}
}
}

Loading…
Cancel
Save