39 changed files with 445 additions and 5605 deletions
@ -0,0 +1 @@
|
||||
<p>违规记录</p> |
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
@Component({ |
||||
selector: 'app-criminal-records', |
||||
templateUrl: './criminal-records.component.html', |
||||
styleUrls: ['./criminal-records.component.scss'] |
||||
}) |
||||
export class CriminalRecordsComponent implements OnInit { |
||||
|
||||
constructor() { } |
||||
|
||||
ngOnInit(): void { |
||||
} |
||||
|
||||
} |
@ -1 +1,19 @@
|
||||
<p>我是首页</p> |
||||
<div class="box"> |
||||
<div> |
||||
<app-tabbar></app-tabbar> |
||||
</div> |
||||
<div class="menu"> |
||||
<li [routerLink]="['/home/plan']"> |
||||
三维预案 |
||||
</li> |
||||
<li [routerLink]="['/home/warning']"> |
||||
今日预警 |
||||
</li> |
||||
<li [routerLink]="['/home/records']"> |
||||
违规记录 |
||||
</li> |
||||
</div> |
||||
<div> |
||||
<router-outlet></router-outlet> |
||||
</div> |
||||
</div> |
@ -0,0 +1,11 @@
|
||||
.box{ |
||||
width: 100%; |
||||
height: 100%; |
||||
overflow: hidden; |
||||
} |
||||
.menu{ |
||||
height: 64px; |
||||
width: 100%; |
||||
display: flex; |
||||
justify-content: center; |
||||
} |
@ -1,25 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { HomeComponent } from './home.component'; |
||||
|
||||
describe('HomeComponent', () => { |
||||
let component: HomeComponent; |
||||
let fixture: ComponentFixture<HomeComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ HomeComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(HomeComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,25 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { LoginComponent } from './login.component'; |
||||
|
||||
describe('LoginComponent', () => { |
||||
let component: LoginComponent; |
||||
let fixture: ComponentFixture<LoginComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ LoginComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(LoginComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,18 @@
|
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
import { NgModule } from '@angular/core'; |
||||
import { PlanComponent } from './plan/plan.component'; |
||||
import { TodayWarningComponent } from './today-warning/today-warning.component'; |
||||
import { CriminalRecordsComponent } from './criminal-records/criminal-records.component'; |
||||
|
||||
|
||||
const routes: Routes = [ |
||||
{ path: 'plan', component: PlanComponent }, |
||||
{ path: 'warning', component: TodayWarningComponent }, |
||||
{ path: 'records', component: CriminalRecordsComponent } |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule] |
||||
}) |
||||
export class PagesRoutingModule { } |
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
@Component({ |
||||
selector: 'app-plan', |
||||
templateUrl: './plan.component.html', |
||||
styleUrls: ['./plan.component.scss'] |
||||
}) |
||||
export class PlanComponent implements OnInit { |
||||
|
||||
constructor() { } |
||||
|
||||
ngOnInit(): void { |
||||
} |
||||
|
||||
} |
@ -1,25 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { RegisterComponent } from './register.component'; |
||||
|
||||
describe('RegisterComponent', () => { |
||||
let component: RegisterComponent; |
||||
let fixture: ComponentFixture<RegisterComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ RegisterComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(RegisterComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1 @@
|
||||
<p>今日预警</p> |
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
@Component({ |
||||
selector: 'app-today-warning', |
||||
templateUrl: './today-warning.component.html', |
||||
styleUrls: ['./today-warning.component.scss'] |
||||
}) |
||||
export class TodayWarningComponent implements OnInit { |
||||
|
||||
constructor() { } |
||||
|
||||
ngOnInit(): void { |
||||
} |
||||
|
||||
} |
@ -1,25 +0,0 @@
|
||||
<mat-toolbar [color]="'primary'"> |
||||
<!-- <mat-toolbar> --> |
||||
<h1 *ngIf="companyName">{{companyName}}</h1> |
||||
|
||||
|
||||
<!-- 登录信息按钮 --> |
||||
<button mat-icon-button [matMenuTriggerFor]="appMenu" class="login"> |
||||
<mat-icon>account_circle</mat-icon> |
||||
</button> |
||||
<mat-menu #appMenu="matMenu"> |
||||
<button mat-menu-item [routerLink]="['/datacollection/userdata']" > |
||||
<mat-icon>perm_identity</mat-icon> |
||||
<span>个人资料</span> |
||||
</button> |
||||
<button mat-menu-item (click)='changpsw()'> |
||||
<mat-icon>verified_user</mat-icon> |
||||
<span>修改密码</span> |
||||
</button> |
||||
<button mat-menu-item (click)='signOut()'> |
||||
<mat-icon>power_settings_new</mat-icon> |
||||
<span>退出系统</span> |
||||
</button> |
||||
</mat-menu> |
||||
|
||||
</mat-toolbar> |
@ -1,45 +0,0 @@
|
||||
mat-toolbar{ |
||||
position: relative; |
||||
padding-left: 65px; |
||||
} |
||||
.logo{ |
||||
height: 64px; |
||||
widows: 64px; |
||||
} |
||||
|
||||
h1{ |
||||
line-height: 64px; |
||||
color: white; |
||||
} |
||||
mat-icon{ |
||||
color: white; |
||||
} |
||||
.login{ |
||||
position: absolute; |
||||
right:30px; |
||||
} |
||||
.fullscreen{ |
||||
position: absolute; |
||||
right:60px; |
||||
} |
||||
.help { |
||||
position: absolute; |
||||
right:90px; |
||||
} |
||||
.setting{ |
||||
position: absolute; |
||||
right:120px; |
||||
} |
||||
.lockscreen{ |
||||
position: absolute; |
||||
right:160px; |
||||
} |
||||
.darktheme{ |
||||
position: absolute; |
||||
right:140px; |
||||
display: none; |
||||
} |
||||
|
||||
.boxed{ |
||||
width: 1200px; |
||||
} |
@ -1,25 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { TabbarComponent } from './tabbar.component'; |
||||
|
||||
describe('TabbarComponent', () => { |
||||
let component: TabbarComponent; |
||||
let fixture: ComponentFixture<TabbarComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ TabbarComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(TabbarComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,66 +0,0 @@
|
||||
import { Component, OnInit,Output,EventEmitter } from '@angular/core'; |
||||
import { HttpClient } from '@angular/common/http' |
||||
import { Router,ActivatedRoute } from '@angular/router' |
||||
import {CacheTokenService} from '../service/cache-token.service' //引入服务
|
||||
import { MatDialog } from '@angular/material/dialog'; |
||||
import {ChangepasswordComponent} from '../ui/changepassword/changepassword.component' |
||||
import { MatSnackBar } from '@angular/material/snack-bar'; |
||||
import { CookieService } from 'ngx-cookie-service'; |
||||
|
||||
|
||||
|
||||
@Component({ |
||||
selector: 'app-tabbar', |
||||
templateUrl: './tabbar.component.html', |
||||
styleUrls: ['./tabbar.component.scss'] |
||||
}) |
||||
export class TabbarComponent implements OnInit { |
||||
|
||||
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public dialog: MatDialog,public snackBar: MatSnackBar, |
||||
private cookieService: CookieService) { } |
||||
|
||||
ngOnInit() { |
||||
this.getUserInfo() |
||||
} |
||||
|
||||
companyName:any; //企业name
|
||||
|
||||
//获取用户信息
|
||||
getUserInfo () { |
||||
this.http.get('/api/CompanyAccount/Profiles').subscribe((data:any)=>{ |
||||
sessionStorage.setItem('companyId',data.companyId) |
||||
this.companyName = data.companyName |
||||
}) |
||||
} |
||||
|
||||
//退出系统
|
||||
signOut = () => { |
||||
let out = confirm("您确定要退出吗") |
||||
if(out) { |
||||
this.http.post('/api/CompanyAccount/SignOut',{}).subscribe( |
||||
data=> { |
||||
this.token.delete() |
||||
sessionStorage.clear() |
||||
window.localStorage.clear() |
||||
this.cookieService.set("token",'',new Date(new Date().getTime() + 1),'/'); |
||||
this.cookieService.set("refreshToken",'',new Date(new Date().getTime() + 1),'/'); |
||||
this.snackBar.open('成功退出', '确定', { |
||||
duration: 3000 |
||||
}); |
||||
this.router.navigate(['/login']) |
||||
} |
||||
) |
||||
} |
||||
} |
||||
|
||||
//修改密码
|
||||
changpsw() { |
||||
let dialogRef = this.dialog.open(ChangepasswordComponent,
|
||||
{width:'348px'}); |
||||
|
||||
dialogRef.afterClosed().subscribe();
|
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -1,18 +0,0 @@
|
||||
@import "./theming"; |
||||
@include mat-core(); |
||||
|
||||
$my-app-primary:mat-palette($mat-blue,500); |
||||
$my-app-accent :mat-palette($mat-pink,A200,A100,A400); |
||||
$my-app-warn :mat-palette($mat-red); |
||||
$my-app-theme :mat-light-theme($my-app-primary,$my-app-accent,$my-app-warn); |
||||
@include angular-material-theme($my-app-theme); |
||||
|
||||
|
||||
$my-dark-primary:mat-palette($mat-red,A700); |
||||
$my-dark-accent :mat-palette($mat-amber,A200,A100,A400); |
||||
$my-dark-warn :mat-palette($mat-deep-orange); |
||||
$my-dark-theme :mat-dark-theme($my-dark-primary,$my-dark-accent,$my-dark-warn); |
||||
|
||||
.myapp-dark-theme{ |
||||
@include angular-material-theme($my-dark-theme); |
||||
} |
@ -0,0 +1,19 @@
|
||||
<div class="box"> |
||||
<div class="boxleft"> |
||||
中国石化 |
||||
</div> |
||||
<!-- 登录信息按钮 --> |
||||
<div class="boxright"> |
||||
<span> |
||||
{{time}} |
||||
</span> |
||||
<a nz-dropdown [nzDropdownMenu]="menu" [nzTrigger]="'click'" [nzBackdrop]='false'> |
||||
用户头像 |
||||
</a> |
||||
<nz-dropdown-menu #menu="nzDropdownMenu"> |
||||
<ul nz-menu nzSelectable> |
||||
<li nz-menu-item (click)="signOut()">退出系统</li> |
||||
</ul> |
||||
</nz-dropdown-menu> |
||||
</div> |
||||
</div> |
@ -0,0 +1,9 @@
|
||||
.box{ |
||||
width: 100%; |
||||
height: 62px; |
||||
background-image: linear-gradient(#001530, #051C3C ,#162f50, #243c55); |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
color: #fff; |
||||
} |
@ -0,0 +1,81 @@
|
||||
import { Component, OnInit, Output, EventEmitter } from '@angular/core'; |
||||
import { HttpClient } from '@angular/common/http' |
||||
import { Router, ActivatedRoute } from '@angular/router' |
||||
import { CacheTokenService } from '../../service/cache-token.service' //引入服务
|
||||
import { MatDialog } from '@angular/material/dialog'; |
||||
import { ChangepasswordComponent } from '../changepassword/changepassword.component' |
||||
import { MatSnackBar } from '@angular/material/snack-bar'; |
||||
import { CookieService } from 'ngx-cookie-service'; |
||||
|
||||
|
||||
|
||||
@Component({ |
||||
selector: 'app-tabbar', |
||||
templateUrl: './tabbar.component.html', |
||||
styleUrls: ['./tabbar.component.scss'] |
||||
}) |
||||
export class TabbarComponent implements OnInit { |
||||
|
||||
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, public dialog: MatDialog, public snackBar: MatSnackBar, |
||||
private cookieService: CookieService) { } |
||||
|
||||
ngOnInit() { |
||||
setInterval(()=>{ |
||||
this.getTime() |
||||
},1000); |
||||
} |
||||
|
||||
//获得时间
|
||||
time:string |
||||
getTime() { |
||||
let myDate = new Date(); |
||||
let y = myDate.getFullYear(); |
||||
let M = myDate.getMonth() + 1; //获取当前月份(0-11,0代表1月)
|
||||
let d = myDate.getDate(); //获取当前日(1-31)
|
||||
let h = myDate.getHours(); //获取当前小时数(0-23)
|
||||
let m = myDate.getMinutes(); //获取当前分钟数(0-59)
|
||||
let s = myDate.getSeconds(); //获取当前秒数(0-59)
|
||||
|
||||
//检查是否小于10
|
||||
M = check(M); |
||||
d = check(d); |
||||
h = check(h); |
||||
m = check(m); |
||||
s = check(s); |
||||
let timestr = y + "-" + M + "-" + d + " " + h + ":" + m + ":" + s; |
||||
this.time = timestr; |
||||
//时间数字小于10,则在之前加个“0”补位。
|
||||
function check(i) { |
||||
let num = (i < 10) ? ("0" + i) : i; |
||||
return num; |
||||
} |
||||
} |
||||
|
||||
//退出系统
|
||||
signOut() { |
||||
let out = confirm("您确定要退出吗") |
||||
if (out) { |
||||
this.http.post('/api/CompanyAccount/SignOut', {}).subscribe( |
||||
data => { |
||||
this.token.delete() |
||||
sessionStorage.clear() |
||||
window.localStorage.clear() |
||||
this.cookieService.set("token", '', new Date(new Date().getTime() + 1), '/'); |
||||
this.cookieService.set("refreshToken", '', new Date(new Date().getTime() + 1), '/'); |
||||
this.router.navigate(['/login']) |
||||
} |
||||
) |
||||
} |
||||
} |
||||
|
||||
//修改密码
|
||||
changpsw() { |
||||
let dialogRef = this.dialog.open(ChangepasswordComponent, |
||||
{ width: '348px' }); |
||||
|
||||
dialogRef.afterClosed().subscribe(); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
Loading…
Reference in new issue