刘向辉 3 years ago
parent
commit
ae7ec6be5f
  1. 11116
      package-lock.json
  2. 18
      src/app/app.component.ts
  3. 3
      src/app/app.module.ts
  4. 6
      src/app/auth.guard.ts
  5. 50
      src/app/http-interceptors/base-interceptor.ts
  6. 2
      src/app/pages/change-password/change-password.component.html
  7. 29
      src/app/pages/change-password/change-password.component.ts
  8. 16
      src/app/pages/criminal-records-admin/criminal-records-admin.component.ts
  9. 16
      src/app/pages/criminal-records/criminal-records.component.ts
  10. 14
      src/app/pages/equipment-info/addequipment/addequipment.component.html
  11. 8
      src/app/pages/equipment-info/addequipment/addequipment.component.ts
  12. 18
      src/app/pages/equipment-info/editequipment/editequipment.component.html
  13. 8
      src/app/pages/equipment-info/editequipment/editequipment.component.ts
  14. 12
      src/app/pages/equipment-info/equipment-info.component.html
  15. 16
      src/app/pages/equipment-info/equipment-info.component.ts
  16. 16
      src/app/pages/home-page/home-page.component.ts
  17. 41
      src/app/pages/home/home.component.html
  18. 77
      src/app/pages/home/home.component.ts
  19. 2
      src/app/pages/login/login.component.html
  20. 68
      src/app/pages/login/login.component.ts
  21. 61
      src/app/pages/oil-station-info/oil-station-info.component.html
  22. 83
      src/app/pages/oil-station-info/oil-station-info.component.scss
  23. 31
      src/app/pages/oil-station-info/oil-station-info.component.ts
  24. 16
      src/app/pages/oil-unloading-process-list/oil-unloading-process-list.component.html
  25. 24
      src/app/pages/oil-unloading-process-list/oil-unloading-process-list.component.ts
  26. 139
      src/app/pages/oil-unloading-process/oil-unloading-process.component.html
  27. 18
      src/app/pages/oil-unloading-process/oil-unloading-process.component.scss
  28. 6
      src/app/pages/oil-unloading-process/oil-unloading-process.component.ts
  29. 16
      src/app/pages/today-warning-admin/today-warning-admin.component.ts
  30. 16
      src/app/pages/today-warning/today-warning.component.ts
  31. 47
      src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.html
  32. 30
      src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.ts
  33. 16
      src/app/pages/warning-statistics-list/warning-statistics-list.component.html
  34. 24
      src/app/pages/warning-statistics-list/warning-statistics-list.component.ts
  35. 25
      src/app/service/cache-token.service.ts
  36. 10
      src/app/ui/tabbar/tabbar.component.ts

11116
package-lock.json generated

File diff suppressed because it is too large Load Diff

18
src/app/app.component.ts

@ -2,7 +2,7 @@ import { Component, TemplateRef, ViewChild } from '@angular/core';
import { HttpClient } from '@angular/common/http' import { HttpClient } from '@angular/common/http'
import { Router, ActivatedRoute } from '@angular/router' import { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from './service/cache-token.service'//引入服务 import { CacheTokenService } from './service/cache-token.service'//引入服务
import { CookieService } from 'ngx-cookie-service';
import "reflect-metadata"; import "reflect-metadata";
import { NzNotificationService } from 'ng-zorro-antd/notification'; import { NzNotificationService } from 'ng-zorro-antd/notification';
@Component({ @Component({
@ -14,22 +14,10 @@ export class AppComponent {
@ViewChild(TemplateRef, { static: false }) template?: TemplateRef<{}>; @ViewChild(TemplateRef, { static: false }) template?: TemplateRef<{}>;
constructor(private http: HttpClient, private router: Router, public token: CacheTokenService, private cookieService: CookieService, private notificationService: NzNotificationService) { } constructor(private http: HttpClient, private router: Router, public token: CacheTokenService, private notificationService: NzNotificationService) { }
ngOnInit(): void { ngOnInit(): void {
// var token = this.cookieService.get("token")
// var refreshToken = this.cookieService.get("refreshToken");
// if(token && refreshToken) {
// this.http.post('/api/CompanyAccount/RefreshToken',{token: token,refreshToken: refreshToken}).subscribe((data: Data) => {
// sessionStorage.setItem("token",data.token);
// this.cookieService.set("token",data.token,null,'/');
// this.cookieService.set("refreshToken",data.refreshToken,null,'/');
// this.token.startUp()
// })
// }
console.log(document.documentElement.clientWidth)
console.log(document.documentElement.clientHeight)
} }
ngAfterViewInit(): void { ngAfterViewInit(): void {

3
src/app/app.module.ts

@ -13,7 +13,6 @@ import { HttpClientModule } from '@angular/common/http';
import { httpInterceptorProviders } from './http-interceptors/index' import { httpInterceptorProviders } from './http-interceptors/index'
import { CacheTokenService } from './service/cache-token.service' import { CacheTokenService } from './service/cache-token.service'
import { TreeService } from './service/tree.service' import { TreeService } from './service/tree.service'
import { CookieService } from 'ngx-cookie-service';//cookie插件
import { CountdownModule } from 'ngx-countdown'; //倒计时插件 import { CountdownModule } from 'ngx-countdown'; //倒计时插件
import { NzNotificationModule } from 'ng-zorro-antd/notification'; import { NzNotificationModule } from 'ng-zorro-antd/notification';
import { NzMessageModule } from 'ng-zorro-antd/message'; import { NzMessageModule } from 'ng-zorro-antd/message';
@ -36,7 +35,7 @@ import { NzMessageModule } from 'ng-zorro-antd/message';
NzNotificationModule, NzNotificationModule,
NzMessageModule NzMessageModule
], ],
providers: [httpInterceptorProviders, CacheTokenService, TreeService, CookieService], providers: [httpInterceptorProviders, CacheTokenService, TreeService],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule { } export class AppModule { }

6
src/app/auth.guard.ts

@ -1,14 +1,13 @@
import { Component, OnInit, Inject } from '@angular/core'; import { Component, OnInit, Inject } from '@angular/core';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
import { CookieService } from 'ngx-cookie-service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class AuthGuard implements CanActivate { export class AuthGuard implements CanActivate {
constructor(private router: Router,private cookieService: CookieService) { constructor(private router: Router) {
} }
@ -22,9 +21,8 @@ export class AuthGuard implements CanActivate {
} }
checkLogin(): boolean { checkLogin(): boolean {
console.log('xxxxxxxxxxxx')
// 判断本地有没有token // 判断本地有没有token
const token = this.cookieService.get("token") || sessionStorage.getItem('token'); const token = sessionStorage.getItem('token');
// 如果有token,允许访问 // 如果有token,允许访问
if (token) { return true; } if (token) { return true; }

50
src/app/http-interceptors/base-interceptor.ts

@ -1,13 +1,13 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { import {
HttpClient, HttpInterceptor, HttpHandler, HttpRequest, HttpClient, HttpInterceptor, HttpHandler, HttpRequest,
HttpErrorResponse HttpErrorResponse,
HttpResponse
} from '@angular/common/http'; } from '@angular/common/http';
import { throwError } from 'rxjs' import { throwError } from 'rxjs'
import { catchError } from 'rxjs/operators'; import { catchError, tap, finalize } from 'rxjs/operators';
import { Router } from '@angular/router' import { Router } from '@angular/router'
import { CacheTokenService } from '../service/cache-token.service'
import { CookieService } from 'ngx-cookie-service';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
//baseurl //baseurl
// const baseurl = 'http://39.106.78.171:8008'; // const baseurl = 'http://39.106.78.171:8008';
@ -15,7 +15,7 @@ import { NzMessageService } from 'ng-zorro-antd/message';
@Injectable() @Injectable()
export class BaseInterceptor implements HttpInterceptor { export class BaseInterceptor implements HttpInterceptor {
constructor(private router: Router, public token: CacheTokenService, private cookieService: CookieService, private message: NzMessageService) { } constructor(private router: Router, private message: NzMessageService) { }
intercept(req, next: HttpHandler) { intercept(req, next: HttpHandler) {
@ -26,24 +26,42 @@ export class BaseInterceptor implements HttpInterceptor {
} }
} }
req = req.clone({ params }); req = req.clone({ params });
// debugger // debugger
// console.log('xxxxxx',req) // console.log('xxxxxx',req)
let newReq = req.clone({ let newReq = req.clone({
url: req.hadBaseurl ? `${req.url}` : `${req.url}`, url: req.hadBaseurl ? `${req.url}` : `${req.url}`,
}); });
if (!req.cancelToken) { if (!req.cancelToken) {
/*获取token*/ /*获取token*/
let token = this.cookieService.get("token") let token = sessionStorage.getItem("token")
/*此处设置额外请求头,token令牌*/ /*此处设置额外请求头,token令牌*/
newReq.headers = if (!!token) {
newReq.headers.set('Authorization', `Bearer ${token}`) newReq.headers = newReq.headers.set('Authorization', `Bearer ${token}`)
}
} }
// 携带请求头发送下一次请求 // 携带请求头发送下一次请求
return next.handle(newReq) return next.handle(newReq)
.pipe( .pipe(
//箭头函数,注意this指向 tap(event => {
catchError((err) => this.handleError(err)) if (event instanceof HttpResponse) {
// 成功
// console.log('成功', event.headers.get('x-refresh-encryptedtoken'))
if (!!event.headers.get('x-refresh-token')) {
sessionStorage.setItem('token', event.headers.get('x-refresh-token'))
sessionStorage.setItem('encryptedAccessToken', event.headers.get('x-refresh-encryptedtoken'))
}
}
}, error => {
// 失败
console.log('请求http失败', error)
this.handleError(error)
}),
finalize(() => {
// 请求完成
// console.log('complete')
})
) )
} }
@ -51,15 +69,11 @@ export class BaseInterceptor implements HttpInterceptor {
//401 token过期 403没权限!!! 400参数错误 404未找到 614刷新令牌过期!!! //401 token过期 403没权限!!! 400参数错误 404未找到 614刷新令牌过期!!!
private handleError(error: HttpErrorResponse) { private handleError(error: HttpErrorResponse) {
console.log('http错误', error)
// 用户认证失败返回登录页 // 用户认证失败返回登录页
if (error.status === 401 || error.status === 614) { if (error.status === 401 || error.status === 614) {
this.token.delete()
sessionStorage.clear() sessionStorage.clear()
// window.localStorage.clear() // window.localStorage.clear()
localStorage.removeItem("isautologin") localStorage.removeItem("isautologin")
this.cookieService.set("token", '', new Date(new Date().getTime() + 1), '/')
this.cookieService.set("refreshToken", '', new Date(new Date().getTime() + 1), '/')
this.message.create('error', `用户认证信息过期,请重新登录!`); this.message.create('error', `用户认证信息过期,请重新登录!`);
this.router.navigate(['/login']) this.router.navigate(['/login'])
} }
@ -69,7 +83,9 @@ export class BaseInterceptor implements HttpInterceptor {
if (error.status === 400) { if (error.status === 400) {
this.message.create('error', `请核对您的输入信息或格式是否正确!`); this.message.create('error', `请核对您的输入信息或格式是否正确!`);
} }
if (error.status === 500) {
this.message.create('error', `状态500,服务器错误!`);
}
if (error.error instanceof ErrorEvent) { if (error.error instanceof ErrorEvent) {
// 发生客户端或网络错误。相应处理。 // 发生客户端或网络错误。相应处理。
console.error('An error occurred:', error.error.message); console.error('An error occurred:', error.error.message);

2
src/app/pages/change-password/change-password.component.html

@ -3,7 +3,7 @@
<nz-form-item> <nz-form-item>
<nz-form-control nzErrorTip=""> <nz-form-control nzErrorTip="">
<nz-input-group> <nz-input-group>
<input name="oldpassword" nz-input type="text" formControlName="oldpassword" placeholder="请输入原密码" autocomplete="off" /> <input name="oldpassword" nz-input type="password" formControlName="oldpassword" placeholder="请输入原密码" autocomplete="off" />
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>

29
src/app/pages/change-password/change-password.component.ts

@ -1,7 +1,8 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
@Component({ @Component({
selector: 'app-change-password', selector: 'app-change-password',
templateUrl: './change-password.component.html', templateUrl: './change-password.component.html',
@ -12,11 +13,33 @@ export class ChangePasswordComponent implements OnInit {
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
validateForm!: FormGroup; validateForm!: FormGroup;
ngOnInit(): void { ngOnInit(): void {
const { password } = MyValidators;
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
oldpassword: [null, [Validators.required]], oldpassword: [null, [Validators.required]],
newpassword: [null, [Validators.required]], newpassword: [null, [Validators.required, password]],
affirmpassword: [null, [Validators.required]] affirmpassword: [null, [Validators.required, password]]
}); });
} }
} }
export type MyErrorsOptions = { 'zh-cn': string; en: string } & Record<string, NzSafeAny>;
export type MyValidationErrors = Record<string, MyErrorsOptions>;
export class MyValidators extends Validators {
static password(control: AbstractControl): MyValidationErrors | null {
const value = control.value;
if (isEmptyInputValue(value)) {
return null;
}
return isPassword(value) ? null : { mobile: { 'zh-cn': `长度 12 位以上,包含①大写字母、②小写字母、③数字、④特殊字符四种中的三种组合`, en: `Password phone number is not valid` } };
}
}
function isEmptyInputValue(value: NzSafeAny): boolean {
return value == null || value.length === 0;
}
function isPassword(value: string): boolean {
return typeof value === 'string' && /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{12,99}$/.test(value);
}

16
src/app/pages/criminal-records-admin/criminal-records-admin.component.ts

@ -612,10 +612,10 @@ export class CriminalRecordsAdminComponent implements OnInit {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name, name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification, storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'),
isScrapped: true, isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
@ -639,10 +639,10 @@ export class CriminalRecordsAdminComponent implements OnInit {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification, storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {

16
src/app/pages/criminal-records/criminal-records.component.ts

@ -557,10 +557,10 @@ export class CriminalRecordsComponent implements OnInit {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name, name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification, storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'),
isScrapped: true, isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
@ -583,10 +583,10 @@ export class CriminalRecordsComponent implements OnInit {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification, storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {

14
src/app/pages/equipment-info/addequipment/addequipment.component.html

@ -14,30 +14,30 @@
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<p>规格</p> <p>存放地点</p>
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-input-group> <nz-input-group>
<input nz-input type="text" formControlName="specification" placeholder="请输入规格" /> <input nz-input type="text" formControlName="storageLocation" placeholder="请输入存放地点" />
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<p>购入日期</p> <p>生产日期</p>
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-date-picker formControlName="buytime" nzPlaceHolder="请输入购入日期"></nz-date-picker> <nz-date-picker formControlName="productionDate" nzPlaceHolder="请输入生产日期"></nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<p>生产日期</p> <p>下次维保日期</p>
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-date-picker formControlName="prodtime" nzPlaceHolder="请输入生产日期"></nz-date-picker> <nz-date-picker formControlName="maintenanceDate" nzPlaceHolder="请输入下次维保日期"></nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<p>有效期至</p> <p>有效期至</p>
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-date-picker formControlName="validitytime" nzPlaceHolder="有效期至"></nz-date-picker> <nz-date-picker formControlName="validityEndTime" nzPlaceHolder="有效期至"></nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<div class="btnbox"> <div class="btnbox">

8
src/app/pages/equipment-info/addequipment/addequipment.component.ts

@ -15,10 +15,10 @@ export class AddequipmentComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
name: [null, [Validators.required]], name: [null, [Validators.required]],
specification: [null, [Validators.required]], storageLocation: [null, [Validators.required]],
buytime: [null, [Validators.required]], productionDate: [null, [Validators.required]],
prodtime: [null, [Validators.required]], maintenanceDate: [null, [Validators.required]],
validitytime: [null, [Validators.required]] validityEndTime: [null, [Validators.required]]
}); });
} }

18
src/app/pages/equipment-info/editequipment/editequipment.component.html

@ -14,30 +14,34 @@
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<p>规格</p> <p>存放地点</p>
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-input-group> <nz-input-group>
<input [(ngModel)]="data2.specification" nz-input type="text" formControlName="specification" placeholder="请输入规格" /> <input [(ngModel)]="data2.storageLocation" nz-input type="text" formControlName="storageLocation"
placeholder="请输入存放地点" />
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<p>购入日期</p> <p>生产日期</p>
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-date-picker [(ngModel)]="data2.purchaseDate" formControlName="buytime" nzPlaceHolder="请输入购入日期"></nz-date-picker> <nz-date-picker [(ngModel)]="data2.productionDate" formControlName="productionDate" nzPlaceHolder="请输入生产日期">
</nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<p>生产日期</p> <p>下次维保日期</p>
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-date-picker [(ngModel)]="data2.productionDate" formControlName="prodtime" nzPlaceHolder="请输入生产日期"></nz-date-picker> <nz-date-picker [(ngModel)]="data2.maintenanceDate" formControlName="maintenanceDate" nzPlaceHolder="请输入下次维保日期">
</nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<p>有效期至</p> <p>有效期至</p>
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-date-picker [(ngModel)]="data2.validityEndTime" formControlName="validitytime" nzPlaceHolder="有效期至"></nz-date-picker> <nz-date-picker [(ngModel)]="data2.validityEndTime" formControlName="validityEndTime" nzPlaceHolder="有效期至">
</nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<div class="btnbox"> <div class="btnbox">

8
src/app/pages/equipment-info/editequipment/editequipment.component.ts

@ -19,10 +19,10 @@ export class EditequipmentComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
name: [null, [Validators.required]], name: [null, [Validators.required]],
specification: [null, [Validators.required]], storageLocation: [null, [Validators.required]],
buytime: [null, [Validators.required]], productionDate: [null, [Validators.required]],
prodtime: [null, [Validators.required]], maintenanceDate: [null, [Validators.required]],
validitytime: [null, [Validators.required]] validityEndTime: [null, [Validators.required]]
}); });
this.data2 = JSON.parse(JSON.stringify(this.data)) this.data2 = JSON.parse(JSON.stringify(this.data))
} }

12
src/app/pages/equipment-info/equipment-info.component.html

@ -29,13 +29,13 @@
消防器材 消防器材
</div> </div>
<div nz-col nzSpan="4"> <div nz-col nzSpan="4">
规格 存放地点
</div> </div>
<div nz-col nzSpan="4"> <div nz-col nzSpan="4">
购入日期 生产日期
</div> </div>
<div nz-col nzSpan="4"> <div nz-col nzSpan="4">
生产日期 下次维保日期
</div> </div>
<div nz-col nzSpan="4"> <div nz-col nzSpan="4">
有效期至 有效期至
@ -50,13 +50,13 @@
{{item.name}} {{item.name}}
</div> </div>
<div nz-col nzSpan="4"> <div nz-col nzSpan="4">
{{item.specification}} {{item.storageLocation}}
</div> </div>
<div nz-col nzSpan="4"> <div nz-col nzSpan="4">
{{item.purchaseDate | date:"yyyy-MM-dd"}} {{item.productionDate | date:"yyyy-MM-dd"}}
</div> </div>
<div nz-col nzSpan="4"> <div nz-col nzSpan="4">
{{item.productionDate | date:"yyyy-MM-dd"}} {{item.maintenanceDate | date:"yyyy-MM-dd"}}
</div> </div>
<div nz-col nzSpan="4"> <div nz-col nzSpan="4">
{{item.validityEndTime | date:"yyyy-MM-dd"}} {{item.validityEndTime | date:"yyyy-MM-dd"}}

16
src/app/pages/equipment-info/equipment-info.component.ts

@ -73,10 +73,10 @@ export class EquipmentInfoComponent implements OnInit {
await new Promise(resolve => { await new Promise(resolve => {
let body = { let body = {
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification, storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id organizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id
} }
this.http.post('/api/services/app/FireEquipment/Create', body).subscribe(data => { this.http.post('/api/services/app/FireEquipment/Create', body).subscribe(data => {
@ -118,10 +118,10 @@ export class EquipmentInfoComponent implements OnInit {
let body = { let body = {
id: item.id, id: item.id,
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification, storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.organizationUnitId organizationUnitId: item.organizationUnitId
} }
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe(data => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe(data => {

16
src/app/pages/home-page/home-page.component.ts

@ -698,10 +698,10 @@ export class HomePageComponent implements OnInit {
isScrapped: true, isScrapped: true,
organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId, organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId,
name: instance.copydata2.violatedItemSnapshotObj.name, name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification, storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD') validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD')
} }
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = { let body = {
@ -723,10 +723,10 @@ export class HomePageComponent implements OnInit {
let body = { let body = {
id: copydata.violatedItemSnapshotObj.id, id: copydata.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification, storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId
} }
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {

41
src/app/pages/home/home.component.html

@ -90,3 +90,44 @@
</div> </div>
</div> </div>
</ng-template> </ng-template>
<!-- 修改密码 -->
<nz-modal [(nzVisible)]="isVisible" [nzTitle]="modalTitle" [nzContent]="modalContent" [nzFooter]="modalFooter"
[nzWidth]="350">
<ng-template #modalTitle>
修改初始密码
</ng-template>
<ng-template #modalContent>
<form nz-form [formGroup]="passwordValidateForm">
<nz-form-item>
<nz-form-control nzErrorTip="">
<nz-input-group>
<input name="oldpassword" type="password" nz-input formControlName="oldpassword"
placeholder="请输入原密码" autocomplete="off" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control>
<nz-input-group>
<input name="newpassword" nz-input type="password" formControlName="newpassword" placeholder="请输入新密码"
autocomplete="off" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control>
<nz-input-group>
<input name="affirmpassword" nz-input type="password" formControlName="affirmpassword" placeholder="确认新密码"
autocomplete="new-password" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</form>
</ng-template>
<ng-template #modalFooter>
<button nz-button nzType="primary" (click)="handleOk()" [nzLoading]="isConfirmLoading">确定</button>
</ng-template>
</nz-modal>

77
src/app/pages/home/home.component.ts

@ -3,18 +3,19 @@ import { Router, NavigationEnd } from '@angular/router';
import { filter } from 'rxjs/operators'; import { filter } from 'rxjs/operators';
import { NavChangeService } from '../../service/navChange.service'; import { NavChangeService } from '../../service/navChange.service';
import { CacheTokenService } from '../../service/cache-token.service' //引入服务 import { CacheTokenService } from '../../service/cache-token.service' //引入服务
import { CookieService } from 'ngx-cookie-service';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { SignalRAspNetCoreHelper } from '../../../shared/helpers/SignalRAspNetCoreHelper'; import { SignalRAspNetCoreHelper } from '../../../shared/helpers/SignalRAspNetCoreHelper';
import { NzNotificationService } from 'ng-zorro-antd/notification'; import { NzNotificationService } from 'ng-zorro-antd/notification';
import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component'; import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ChangePasswordComponent } from '../change-password/change-password.component'; import { ChangePasswordComponent, MyValidators } from '../change-password/change-password.component';
import { listRefreshService } from '../../service/listRefresh.service'; import { listRefreshService } from '../../service/listRefresh.service';
import { DisposeequipmentComponent } from '../warning-statistics-list/disposeequipment/disposeequipment.component'; import { DisposeequipmentComponent } from '../warning-statistics-list/disposeequipment/disposeequipment.component';
declare var abp: any declare var abp: any
import * as moment from 'moment'; import * as moment from 'moment';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
templateUrl: './home.component.html', templateUrl: './home.component.html',
@ -22,8 +23,16 @@ import * as moment from 'moment';
}) })
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
@ViewChild('warning', { static: false }) template?: TemplateRef<{}>; @ViewChild('warning', { static: false }) template?: TemplateRef<{}>;
passwordValidateForm!: FormGroup;
constructor(private listRefreshService: listRefreshService, private http: HttpClient, private router: Router, private navChangeService: NavChangeService, public token: CacheTokenService, constructor(private listRefreshService: listRefreshService, private http: HttpClient, private router: Router, private navChangeService: NavChangeService, public token: CacheTokenService,
private cookieService: CookieService, private message: NzMessageService, private notificationService: NzNotificationService, private modal: NzModalService, private viewContainerRef: ViewContainerRef) { } private message: NzMessageService, private notificationService: NzNotificationService, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private fb: FormBuilder) {
const { password } = MyValidators;
this.passwordValidateForm = this.fb.group({
oldpassword: [null, [Validators.required]],
newpassword: [null, [Validators.required, password]],
affirmpassword: [null, [Validators.required, password]]
});
}
isGasStationNav: boolean isGasStationNav: boolean
isGasStation: boolean isGasStation: boolean
@ -85,7 +94,48 @@ export class HomeComponent implements OnInit {
} }
if ((sessionStorage.getItem('isDefaultPassword') == 'true' || sessionStorage.getItem('isPasswordExpired') == 'true') && JSON.parse(sessionStorage.getItem('userdata')).userName != 'admin') {
this.changePasswordPopup()
}
}
//初次登陆修改密码弹窗
isVisible = false
isConfirmLoading = false
changePasswordPopup() {
this.isVisible = true
}
handleOk(): void {
console.log(this.passwordValidateForm)
if (this.passwordValidateForm.invalid) {
this.message.create('warning', `输入格式不正确`);
} else {
if (this.passwordValidateForm.value.newpassword != this.passwordValidateForm.value.affirmpassword) {
this.message.create('warning', '两次密码输入不一致!');
} else if (this.passwordValidateForm.value.newpassword == this.passwordValidateForm.value.oldpassword) {
this.message.create('warning', '旧密码和新密码不能相同!');
} else {
this.isConfirmLoading = true;
let body = {
currentPassword: this.passwordValidateForm.value.oldpassword,
newPassword: this.passwordValidateForm.value.newpassword
} }
this.http.post('/api/services/app/User/ChangePassword', body).subscribe(data => {
this.message.create('success', '修改成功!');
this.isConfirmLoading = false;
this.isVisible = false;
//清除sessionStorage
sessionStorage.removeItem('isDefaultPassword')
}, err => {
this.message.create('warning', err.error.error.message);
this.isConfirmLoading = false;
})
}
}
}
reloadPage = (userNotification) => { reloadPage = (userNotification) => {
console.log('abp.notifications.received收到通知', userNotification); console.log('abp.notifications.received收到通知', userNotification);
@ -111,7 +161,6 @@ export class HomeComponent implements OnInit {
} }
this.messageId.push(obj) this.messageId.push(obj)
} }
isVisible = false
modalData modalData
look(item) { look(item) {
@ -151,10 +200,10 @@ export class HomeComponent implements OnInit {
isScrapped: true, isScrapped: true,
organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId, organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId,
name: instance.copydata2.violatedItemSnapshotObj.name, name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification, storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD') validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD')
} }
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = { let body = {
@ -183,10 +232,10 @@ export class HomeComponent implements OnInit {
let body = { let body = {
id: copydata.violatedItemSnapshotObj.id, id: copydata.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification, storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId
} }
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
@ -305,11 +354,7 @@ export class HomeComponent implements OnInit {
this.message.create('success', `退出成功`); this.message.create('success', `退出成功`);
this.token.delete() this.token.delete()
sessionStorage.clear() sessionStorage.clear()
// window.localStorage.clear()
localStorage.removeItem("isautologin") localStorage.removeItem("isautologin")
this.cookieService.set("token", '', new Date(new Date().getTime() + 1), '/');
this.cookieService.set("refreshToken", '', new Date(new Date().getTime() + 1), '/');
this.router.navigate(['/login']) this.router.navigate(['/login'])
} }

2
src/app/pages/login/login.component.html

@ -48,5 +48,3 @@
</div> </div>
</div> </div>

68
src/app/pages/login/login.component.ts

@ -2,11 +2,11 @@ import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http' import { HttpClient } from '@angular/common/http'
import { Router, ActivatedRoute } from '@angular/router' import { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from '../../service/cache-token.service'//引入服务 import { CacheTokenService } from '../../service/cache-token.service'//引入服务
import { CookieService } from 'ngx-cookie-service';//cookie插件 import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import { NzNotificationService } from 'ng-zorro-antd/notification'; import { NzNotificationService } from 'ng-zorro-antd/notification';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
declare var abp: any declare var abp: any
@Component({ @Component({
@ -18,15 +18,24 @@ declare var abp: any
export class LoginComponent implements OnInit { export class LoginComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, private cookieService: CookieService, private fb: FormBuilder, private message: NzMessageService, private notificationService: NzNotificationService) { } passwordValidateForm!: FormGroup;
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, private fb: FormBuilder, private message: NzMessageService, private notificationService: NzNotificationService) {
ngOnInit() { const { password } = MyValidators;
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
userName: [null, [Validators.required]], userName: [null, [Validators.required]],
password: [null, [Validators.required]], password: [null, [Validators.required, password]],
remember: [null], remember: [null],
autologin: [null], autologin: [null],
}); });
this.passwordValidateForm = this.fb.group({
oldpassword: [null, [Validators.required]],
newpassword: [null, [Validators.required, password]],
affirmpassword: [null, [Validators.required, password]]
});
}
ngOnInit() {
//如果本地储存了账号密码信息,那就回显在输入框 //如果本地储存了账号密码信息,那就回显在输入框
let account = localStorage.getItem('account') let account = localStorage.getItem('account')
let password = localStorage.getItem('password') let password = localStorage.getItem('password')
@ -47,14 +56,11 @@ export class LoginComponent implements OnInit {
errmsg: string = ''; //错误信息 errmsg: string = ''; //错误信息
//跳转注册页面 //跳转注册页面
toRegister() { toRegister() {
this.router.navigate(['/register']) this.router.navigate(['/register'])
} }
//记住密码 //记住密码
rememberInfo() { rememberInfo() {
// 判断用户是否勾选记住密码,如果勾选,在本地储存中储存登录信息 // 判断用户是否勾选记住密码,如果勾选,在本地储存中储存登录信息
@ -70,9 +76,6 @@ export class LoginComponent implements OnInit {
} }
} }
remember: any//记住密码 remember: any//记住密码
autologin: any//自动登录 autologin: any//自动登录
isLoading = false; isLoading = false;
@ -104,13 +107,14 @@ export class LoginComponent implements OnInit {
}).subscribe( }).subscribe(
(data: any) => { (data: any) => {
sessionStorage.setItem("token", data.result.accessToken); sessionStorage.setItem("token", data.result.accessToken);
this.cookieService.set("token", data.result.accessToken, null, '/');
this.cookieService.set("refreshToken", data.result.encryptedAccessToken, null, '/');
sessionStorage.setItem("encryptedAccessToken", data.result.encryptedAccessToken); sessionStorage.setItem("encryptedAccessToken", data.result.encryptedAccessToken);
console.log('token', data) console.log('token', data.result)
this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe((data: any) => { this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe((data: any) => {
console.log('GetCurrentLoginInformations', data.result)
sessionStorage.setItem('userdata', JSON.stringify(data.result.user)) sessionStorage.setItem('userdata', JSON.stringify(data.result.user))
sessionStorage.setItem('userdataOfgasstation', JSON.stringify(data.result.user)) sessionStorage.setItem('userdataOfgasstation', JSON.stringify(data.result.user))
sessionStorage.setItem('isDefaultPassword', JSON.stringify(data.result.user.isDefaultPassword))
sessionStorage.setItem('isPasswordExpired', JSON.stringify(data.result.user.isPasswordExpired))
this.isLoading = false; this.isLoading = false;
//记住密码 //记住密码
this.rememberInfo() this.rememberInfo()
@ -125,10 +129,12 @@ export class LoginComponent implements OnInit {
sessionStorage.setItem("isGasStation", 'true'); sessionStorage.setItem("isGasStation", 'true');
this.router.navigate(['/todaywarning/petrolStation']) this.router.navigate(['/todaywarning/petrolStation'])
this.message.create('success', `登录成功`); this.message.create('success', `登录成功`);
} else { } else {
sessionStorage.setItem("isGasStation", 'false'); sessionStorage.setItem("isGasStation", 'false');
this.router.navigate(['/homepage']) this.router.navigate(['/homepage'])
this.message.create('success', `登录成功`); this.message.create('success', `登录成功`);
} }
} }
}, err => { }, err => {
@ -145,15 +151,31 @@ export class LoginComponent implements OnInit {
) )
} }
roleList = [
'管理员', '职工'
]
selectedRole: string
selecteRole(role) {
this.selectedRole = role
}
forget() { forget() {
this.message.create('warning', `请联系管理员`); this.message.create('warning', `请联系管理员`);
} }
}
export type MyErrorsOptions = { 'zh-cn': string; en: string } & Record<string, NzSafeAny>;
export type MyValidationErrors = Record<string, MyErrorsOptions>;
export class MyValidators extends Validators {
static password(control: AbstractControl): MyValidationErrors | null {
const value = control.value;
if (isEmptyInputValue(value)) {
return null;
}
return isPassword(value) ? null : { mobile: { 'zh-cn': `长度 12 位以上,包含①大写字母、②小写字母、③数字、④特殊字符四种中的三种组合`, en: `Password phone number is not valid` } };
}
} }
function isEmptyInputValue(value: NzSafeAny): boolean {
return value == null || value.length === 0;
}
function isPassword(value: string): boolean {
return typeof value === 'string' && /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{12,99}$/.test(value);
}

61
src/app/pages/oil-station-info/oil-station-info.component.html

@ -304,45 +304,43 @@
<tr *ngFor="let item of httpBody.licenses;let key = index"> <tr *ngFor="let item of httpBody.licenses;let key = index">
<td class="head" [title]="item.name">{{item.name}}</td> <td class="head" [title]="item.name">{{item.name}}</td>
<td colspan="3" class="imgbox"> <td colspan="3" class="imgbox">
<div class="uploadDivbox"> <div class="timeDiv">
<div class="uploadDiv"> <div class="timeDivflex">
<img *ngIf="item.imageUrl" style="width: 100%;height: 100%;" [src]="item.imageUrl" alt=""> <div class="itemname">
<input *ngIf="!item.imageUrl" (change)="filechange($event,key)" class="fileinput" type="file" 证件编号:<span style="color: red;">*</span>
name="" id="">
<button *ngIf="!item.imageUrl" nz-button [nzLoading]=""><i nz-icon nzType="upload"
nzTheme="outline"></i>上传图片</button>
</div>
<div class="uploadDiv" *ngIf="item.imageUrl">
<input (change)="filechange($event,key)" class="fileinput" type="file" name="" id="">
<button nz-button [nzLoading]=""><i nz-icon nzType="upload" nzTheme="outline"></i>重新上传</button>
</div> </div>
<div class="timeDiv" style="width: 500px;">
<div class="timeDivflex" style="margin-bottom: 6px;">
<nz-form-item title="证件编号"> <nz-form-item title="证件编号">
<nz-form-control> <nz-form-control>
<nz-input-group> <nz-input-group>
<input style="border: 1px solid #91CCFF" [ngModelOptions]="{standalone: true}" <input style="border: 1px solid #91CCFF" [ngModelOptions]="{standalone: true}"
placeholder="证件编号" [(ngModel)]="item.code" nz-input placeholder="请输入证件编号" [(ngModel)]="item.code" nz-input type="text" />
type="text" />
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div class="timeDivflex"> <div class="timeDivflex">
<div class="itemname">
证照有效期:<span style="color: red;">*</span>
</div>
<label style="color: white;" [ngModelOptions]="{standalone: true}" nz-checkbox
[(ngModel)]="item.isPerpetual" (ngModelChange)="perpetualChange(item,$event)">是否为长期证照</label>
<nz-form-item style="border: 1px solid #91CCFF" title="证照有效期开始时间"> <nz-form-item style="border: 1px solid #91CCFF" title="证照有效期开始时间">
<nz-form-control> <nz-form-control>
<nz-date-picker required [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'开始时间'" <nz-date-picker required [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'开始时间'"
[(ngModel)]="item.startTime" (ngModelChange)="onChange($event)"></nz-date-picker> [(ngModel)]="item.startTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item style="border: 1px solid #91CCFF" title="证照有效期结束时间"> <nz-form-item style="border: 1px solid #91CCFF" title="证照有效期结束时间" *ngIf="!item.isPerpetual">
<nz-form-control> <nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'结束时间'" <nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'结束时间'"
[(ngModel)]="item.endTime" (ngModelChange)="onChange($event)"></nz-date-picker> [(ngModel)]="item.endTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div class="timeDivflex" style="margin: 6px 0;"> <div class="timeDivflex">
<div class="itemname">
证照提醒时间:<span style="color: red;">*</span>
</div>
<nz-form-item style="border: 1px solid #91CCFF" title="证照到期第一次提醒时间"> <nz-form-item style="border: 1px solid #91CCFF" title="证照到期第一次提醒时间">
<nz-form-control> <nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'一次提醒时间'" <nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'一次提醒时间'"
@ -356,25 +354,26 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div class="timeDivflex" style="margin-bottom: 6px;"> <div class="timeDivflex">
<div class="itemname">
证照年检时间:<span style="color: red;">*</span>
</div>
<label style="color: white;" [ngModelOptions]="{standalone: true}" nz-checkbox <label style="color: white;" [ngModelOptions]="{standalone: true}" nz-checkbox
[(ngModel)]="item.hasAnnualInspection">是否年检</label> [(ngModel)]="item.hasAnnualInspection">是否年检</label>
</div> <nz-form-item style="border: 1px solid #91CCFF" title="年检时间" *ngIf="item.hasAnnualInspection">
<div class="timeDivflex timeDivflex2" *ngIf="item.hasAnnualInspection">
<nz-form-item style="border: 1px solid #91CCFF" title="年检时间">
<nz-form-control> <nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'年检时间'" <nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'年检时间'"
[(ngModel)]="item.annualInspectionTime" (ngModelChange)="onChange($event)"></nz-date-picker> [(ngModel)]="item.annualInspectionTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item style="border: 1px solid #91CCFF" title="年检提醒时间"> <nz-form-item style="border: 1px solid #91CCFF" title="年检提醒时间" *ngIf="item.hasAnnualInspection">
<nz-form-control> <nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'年检提醒时间'" <nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'年检提醒时间'"
[(ngModel)]="item.annualInspectionWarnTime" (ngModelChange)="onChange($event)"> [(ngModel)]="item.annualInspectionWarnTime" (ngModelChange)="onChange($event)">
</nz-date-picker> </nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item title="年检机构"> <nz-form-item title="年检机构" *ngIf="item.hasAnnualInspection">
<nz-form-control> <nz-form-control>
<nz-input-group> <nz-input-group>
<input style="border: 1px solid #91CCFF" [ngModelOptions]="{standalone: true}" <input style="border: 1px solid #91CCFF" [ngModelOptions]="{standalone: true}"
@ -385,13 +384,27 @@
</nz-form-item> </nz-form-item>
</div> </div>
</div> </div>
<div class="uploadDivbox">
<div class="itemname">
证照图片:
</div>
<div class="uploadDiv">
<img *ngIf="item.imageUrl" style="width: 100%;height: 100%;" [src]="item.imageUrl" alt="">
<input *ngIf="!item.imageUrl" (change)="filechange($event,key)" class="fileinput" type="file"
name="" id="">
<button *ngIf="!item.imageUrl" nz-button [nzLoading]=""><i nz-icon nzType="upload"
nzTheme="outline"></i>上传图片</button>
</div>
<div class="uploadDiv" *ngIf="item.imageUrl">
<input (change)="filechange($event,key)" class="fileinput" type="file" name="" id="">
<button nz-button [nzLoading]=""><i nz-icon nzType="upload" nzTheme="outline"></i>重新上传</button>
</div>
</div> </div>
<a class="deleteTr" nz-popconfirm nzPopconfirmTitle="确定删除该证照吗?" nzPopconfirmPlacement="bottom" <a class="deleteTr" nz-popconfirm nzPopconfirmTitle="确定删除该证照吗?" nzPopconfirmPlacement="bottom"
(nzOnConfirm)="deleteTrConfirm(key)"> (nzOnConfirm)="deleteTrConfirm(key)">
<i *ngIf="item.name != '营业执照' && item.name != '危险化学品' && item.name != '成品油零售'" nz-icon nzType="close" <i *ngIf="item.name != '营业执照' && item.name != '危险化学品' && item.name != '成品油零售'" nz-icon nzType="close"
nzTheme="outline"></i> nzTheme="outline"></i>
</a> </a>
</td> </td>
</tr> </tr>
<tr style="height: 50px;"> <tr style="height: 50px;">

83
src/app/pages/oil-station-info/oil-station-info.component.scss

@ -89,35 +89,49 @@
} }
.imgtable { .imgtable {
width: 100%;
tr, text-align: center;
td { border-collapse: collapse;
height: 200px;
}
.imgbox { .imgbox {
width: 100%;
height: 100%;
position: relative; position: relative;
.deleteTr{ display: flex;
position: absolute; flex-direction: column;
right: 5px;
top: 5px; .timeDiv {
cursor: pointer; width: 100%;
display: flex;
flex-direction: column;
.timeDivflex {
width: 100%;
height: 34px;
display: flex;
align-items: center;
margin: 5px 0;
nz-form-item {
width: 20%;
margin-right: 15px;
}
} }
}
.uploadDivbox { .uploadDivbox {
width: 100%; width: 100%;
height: 100%; height: 80px;
box-sizing: border-box;
padding: 0 16px;
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
} margin: 5px 0;
.uploadDiv { .uploadDiv {
margin-left: 16px;
width: 120px; width: 120px;
height: 80px; height: 80px;
// border: 1px solid red;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -144,36 +158,23 @@
color: #91CCFF; color: #91CCFF;
} }
} }
.timeDiv {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-around;
.timeDivflex {
width: 100%;
display: flex;
nz-form-item {
width: 45%;
margin-right: 15px;
}
} }
.timeDivflex2 { .itemname {
align-items: center; width: 120px;
nz-form-item { text-align: right;
width: 30%; box-sizing: border-box;
margin-right: 9px; padding-right: 12px;
}
} }
.deleteTr {
position: absolute;
right: 5px;
top: 5px;
cursor: pointer;
} }
} }
} }
} }

31
src/app/pages/oil-station-info/oil-station-info.component.ts

@ -94,10 +94,19 @@ export class OilStationInfoComponent implements OnInit {
} }
if (this.httpBody.licenses.length == 0) { if (this.httpBody.licenses.length == 0) {
this.httpBody.licenses = [ this.httpBody.licenses = [
{ name: '营业执照', code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 1, hasAnnualInspection: true }, { name: '营业执照', code: '', isPerpetual: false, startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 1, hasAnnualInspection: true },
{ name: '危险化学品', code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 3, hasAnnualInspection: false }, { name: '危险化学品', code: '', isPerpetual: false, startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 3, hasAnnualInspection: false },
{ name: '成品油零售', code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 2, hasAnnualInspection: true } { name: '成品油零售', code: '', isPerpetual: false, startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 2, hasAnnualInspection: true }
] ]
} else {
console.log('走这里了',this.httpBody.licenses)
this.httpBody.licenses.forEach(item => {
if (item.endTime == '9999-01-01T00:00:00') {
item.isPerpetual = true
} else {
item.isPerpetual = false
}
})
} }
this.httpBody.stationType ? this.httpBody.stationType = String(this.httpBody.stationType) : null this.httpBody.stationType ? this.httpBody.stationType = String(this.httpBody.stationType) : null
setTimeout(() => { setTimeout(() => {
@ -179,6 +188,13 @@ export class OilStationInfoComponent implements OnInit {
licenses: [ licenses: [
] ]
} }
perpetualChange(item, $event) {
if ($event) {
item.endTime = '9999-01-01'
}
}
onChange($event) { onChange($event) {
} }
@ -204,7 +220,7 @@ export class OilStationInfoComponent implements OnInit {
} }
addTr() { addTr() {
this.httpBody.licenses.push( this.httpBody.licenses.push(
{ name: this.addName, code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: -1, hasAnnualInspection: false }, { name: this.addName, code: '', isPerpetual: false, startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: -1, hasAnnualInspection: false },
) )
} }
deleteTrConfirm(key) { deleteTrConfirm(key) {
@ -247,10 +263,15 @@ export class OilStationInfoComponent implements OnInit {
body.stationType body.stationType
body.govUnitDetail = JSON.stringify(this.httpBody.govUnitDetail) body.govUnitDetail = JSON.stringify(this.httpBody.govUnitDetail)
console.log(body) console.log(body)
body.licenses.forEach(item => {
delete item.isPerpetual
})
this.http.put('/api/services/app/GasStation/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/GasStation/Update', body).subscribe((data: any) => {
this.isLoadingSave = false this.isLoadingSave = false
this.message.create('success', '保存成功!'); this.message.create('success', '保存成功!');
this.httpBody.licenses = data.result.licenses // this.httpBody.licenses = data.result.licenses
}, err => { }, err => {
this.isLoadingSave = false this.isLoadingSave = false
this.message.create('error', '保存失败!'); this.message.create('error', '保存失败!');

16
src/app/pages/oil-unloading-process-list/oil-unloading-process-list.component.html

@ -103,13 +103,13 @@
<div nz-col nzSpan="1"> <div nz-col nzSpan="1">
<span style="margin-left: 15px;">序号</span> <span style="margin-left: 15px;">序号</span>
</div> </div>
<div nz-col nzSpan="2"> <div nz-col nzSpan="3">
<span>油站名称</span> <span>油站名称</span>
</div> </div>
<div nz-col nzSpan="2"> <div nz-col nzSpan="2">
公司名称 公司名称
</div> </div>
<div nz-col nzSpan="2"> <div nz-col nzSpan="4">
区域 区域
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
@ -124,9 +124,9 @@
<div nz-col nzSpan="3" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"> <div nz-col nzSpan="3" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
操作中准备预警节点数量 操作中准备预警节点数量
</div> </div>
<div nz-col nzSpan="3" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"> <!-- <div nz-col nzSpan="3" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
全流程准备预警节点数量 全流程准备预警节点数量
</div> </div> -->
<div nz-col nzSpan="1"> <div nz-col nzSpan="1">
状态 状态
</div> </div>
@ -139,13 +139,13 @@
<div nz-col nzSpan="1"> <div nz-col nzSpan="1">
<span style="margin-left: 15px;">{{key + 1}}</span> <span style="margin-left: 15px;">{{key + 1}}</span>
</div> </div>
<div nz-col nzSpan="2" [title]="item.gasStation.stationName"> <div nz-col nzSpan="3" [title]="item.gasStation.stationName">
<span>{{item.gasStation.stationName}}</span> <span>{{item.gasStation.stationName}}</span>
</div> </div>
<div nz-col nzSpan="2" [title]="item.gasStation.companyName"> <div nz-col nzSpan="2" [title]="item.gasStation.companyName">
{{item.gasStation.companyName}} {{item.gasStation.companyName}}
</div> </div>
<div nz-col nzSpan="2" [title]="item.gasStation.locationName"> <div nz-col nzSpan="4" [title]="item.gasStation.locationName">
{{item.gasStation.locationName}} {{item.gasStation.locationName}}
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
@ -160,9 +160,9 @@
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
{{item.proccessingCount}} {{item.proccessingCount}}
</div> </div>
<div nz-col nzSpan="3"> <!-- <div nz-col nzSpan="3">
{{item.allProccessCount}} {{item.allProccessCount}}
</div> </div> -->
<div nz-col nzSpan="1"> <div nz-col nzSpan="1">
<ng-container <ng-container
*ngIf="item.proccessBeforeCount == 0 && item.proccessingCount == 0 && item.allProccessCount == 0; else elseTemplate"> *ngIf="item.proccessBeforeCount == 0 && item.proccessingCount == 0 && item.allProccessCount == 0; else elseTemplate">

24
src/app/pages/oil-unloading-process-list/oil-unloading-process-list.component.ts

@ -662,6 +662,28 @@ export class OilUnloadingProcessListComponent implements OnInit {
}); });
} }
look(item) { look(item) {
// console.log(item)
let arr = []
let arr1 = item.oilUnloadingNodes.find((item) => { return item.nodeName == '车辆进场' });
let arr2 = item.oilUnloadingNodes.find((item) => { return item.nodeName == '设置卸油隔离区' });
let arr3 = item.oilUnloadingNodes.find((item) => { return item.nodeName == '卸油连接静电接地' });
let arr4 = item.oilUnloadingNodes.find((item) => { return item.nodeName == '卸油设置消防器材' });
let arr5 = item.oilUnloadingNodes.find((item) => { return item.nodeName == '连接卸油管' });
let arr6 = item.oilUnloadingNodes.find((item) => { return item.nodeName == '卸油中无人监卸' });
let arr7 = item.oilUnloadingNodes.find((item) => { return item.nodeName == '拆除卸油管' });
let arr8 = item.oilUnloadingNodes.find((item) => { return item.nodeName == '车辆离场' || item.nodeName == '车辆离厂' || item.nodeName == '车辆出厂' });
// console.log(1, arr1)
// console.log(2, arr2)
// console.log(3, arr3)
// console.log(4, arr4)
// console.log(5, arr5)
// console.log(6, arr6)
// console.log(7, arr7)
// console.log(8, arr8)
arr = [arr1, arr2, arr3, arr4, arr5, arr6, arr7, arr8]
console.log('卸油流程', arr)
const modal = this.modal.create({ const modal = this.modal.create({
nzContent: OilUnloadingProcessComponent, nzContent: OilUnloadingProcessComponent,
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
@ -674,7 +696,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
'background': '#000D21', 'background': '#000D21',
}, },
nzComponentParams: { nzComponentParams: {
data: item data: arr
}, },
nzFooter: null, nzFooter: null,
nzOnOk: async () => { nzOnOk: async () => {

139
src/app/pages/oil-unloading-process/oil-unloading-process.component.html

@ -14,32 +14,34 @@
</div> </div>
<div class="content content1"> <div class="content content1">
<div class="imgbox"> <div class="imgbox">
<span class="timespan" <span class="timespan" [ngClass]="{'timespanerr': !data[0].isCorrect}"><i nz-icon
[ngClass]="{'timespanerr': !data.oilUnloadingNodes[0].isCorrect || !data.oilUnloadingNodes[0].violateImage}"><i nzType="clock-circle" nzTheme="outline"></i>{{data[0].violateTime
nz-icon nzType="clock-circle" nzTheme="outline"></i>{{data.oilUnloadingNodes[0].violateTime ? (data.oilUnloadingNodes[0].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span> ? (data[0].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data.oilUnloadingNodes[0].violateImage)" [ngClass]="{'selectedimg': !data.oilUnloadingNodes[0].violateImage}"> <div class="img" (click)="lookImg(data[0].violateImage)"
<img [src]="data.oilUnloadingNodes[0].violateImage ? data.oilUnloadingNodes[0].violateImage : '../../../../assets/images/nopng.png'" [ngClass]="{'selectedimg': !data[0].violateImage}">
<img [src]="data[0].violateImage ? data[0].violateImage : '../../../../assets/images/nopng.png'"
alt=""> alt="">
<img *ngIf="!data.oilUnloadingNodes[0].isCorrect" class="err" <img *ngIf="!data[0].isCorrect" class="err"
src="../../../../assets/images/err.png" alt=""> src="../../../../assets/images/err.png" alt="">
</div> </div>
<span class="name">油罐车进场</span> <span class="name">油罐车进场</span>
</div> </div>
<img src="../../../assets/images/rightArrow.png" alt=""> <img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox"> <div class="imgbox">
<span class="timespan" <span class="timespan" [ngClass]="{'timespanerr': !data[1].isCorrect}"><i nz-icon
[ngClass]="{'timespanerr': !data.oilUnloadingNodes[3].isCorrect || !data.oilUnloadingNodes[3].violateImage}"><i nzType="clock-circle" nzTheme="outline"></i>{{data[1].violateTime
nz-icon nzType="clock-circle" nzTheme="outline"></i>{{data.oilUnloadingNodes[3].violateTime ? (data.oilUnloadingNodes[3].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span> ? (data[1].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data.oilUnloadingNodes[3].violateImage)" [ngClass]="{'selectedimg': !data.oilUnloadingNodes[3].violateImage}"> <div class="img" (click)="lookImg(data[1].violateImage)"
<img [src]="data.oilUnloadingNodes[3].violateImage ? data.oilUnloadingNodes[3].violateImage : '../../../../assets/images/nopng.png'" [ngClass]="{'selectedimg': !data[1].violateImage}">
<img [src]="data[1].violateImage ? data[1].violateImage : '../../../../assets/images/nopng.png'"
alt=""> alt="">
<img *ngIf="!data.oilUnloadingNodes[3].isCorrect" class="err" <img *ngIf="!data[1].isCorrect" class="err"
src="../../../../assets/images/err.png" alt=""> src="../../../../assets/images/err.png" alt="">
</div> </div>
<span class="name">设置隔离区域</span> <span class="name">设置隔离区域</span>
</div> </div>
<img src="../../../assets/images/rightArrow.png" alt=""> <img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox"> <!-- <div class="imgbox">
<span class="timespan" <span class="timespan"
[ngClass]="{'timespanerr': !data.oilUnloadingNodes[4].isCorrect || !data.oilUnloadingNodes[4].violateImage}"><i [ngClass]="{'timespanerr': !data.oilUnloadingNodes[4].isCorrect || !data.oilUnloadingNodes[4].violateImage}"><i
nz-icon nzType="clock-circle" nzTheme="outline"></i>{{data.oilUnloadingNodes[4].violateTime ? (data.oilUnloadingNodes[4].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span> nz-icon nzType="clock-circle" nzTheme="outline"></i>{{data.oilUnloadingNodes[4].violateTime ? (data.oilUnloadingNodes[4].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
@ -51,28 +53,30 @@
</div> </div>
<span class="name">固定罐车轮胎</span> <span class="name">固定罐车轮胎</span>
</div> </div>
<img src="../../../assets/images/rightArrow.png" alt=""> <img src="../../../assets/images/rightArrow.png" alt=""> -->
<div class="imgbox"> <div class="imgbox">
<span class="timespan" <span class="timespan" [ngClass]="{'timespanerr': !data[2].isCorrect}"><i nz-icon
[ngClass]="{'timespanerr': !data.oilUnloadingNodes[6].isCorrect || !data.oilUnloadingNodes[6].violateImage}"><i nzType="clock-circle" nzTheme="outline"></i>{{data[2].violateTime
nz-icon nzType="clock-circle" nzTheme="outline"></i>{{data.oilUnloadingNodes[6].violateTime ? (data.oilUnloadingNodes[6].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span> ? (data[2].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data.oilUnloadingNodes[6].violateImage)" [ngClass]="{'selectedimg': !data.oilUnloadingNodes[6].violateImage}"> <div class="img" (click)="lookImg(data[2].violateImage)"
<img [src]="data.oilUnloadingNodes[6].violateImage ? data.oilUnloadingNodes[6].violateImage : '../../../../assets/images/nopng.png'" [ngClass]="{'selectedimg': !data[2].violateImage}">
<img [src]="data[2].violateImage ? data[2].violateImage : '../../../../assets/images/nopng.png'"
alt=""> alt="">
<img *ngIf="!data.oilUnloadingNodes[6].isCorrect" class="err" <img *ngIf="!data[2].isCorrect" class="err"
src="../../../../assets/images/err.png" alt=""> src="../../../../assets/images/err.png" alt="">
</div> </div>
<span class="name">连接静电接地</span> <span class="name">连接静电接地</span>
</div> </div>
<img src="../../../assets/images/rightArrow.png" alt=""> <img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox"> <div class="imgbox">
<span class="timespan" <span class="timespan" [ngClass]="{'timespanerr': !data[3].isCorrect}"><i nz-icon
[ngClass]="{'timespanerr': !data.oilUnloadingNodes[5].isCorrect || !data.oilUnloadingNodes[5].violateImage}"><i nzType="clock-circle" nzTheme="outline"></i>{{data[3].violateTime
nz-icon nzType="clock-circle" nzTheme="outline"></i>{{data.oilUnloadingNodes[5].violateTime ? (data.oilUnloadingNodes[5].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span> ? (data[3].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data.oilUnloadingNodes[5].violateImage)" [ngClass]="{'selectedimg': !data.oilUnloadingNodes[5].violateImage}"> <div class="img" (click)="lookImg(data[3].violateImage)"
<img [src]="data.oilUnloadingNodes[5].violateImage ? data.oilUnloadingNodes[5].violateImage : '../../../../assets/images/nopng.png'" [ngClass]="{'selectedimg': !data[3].violateImage}">
<img [src]="data[3].violateImage ? data[3].violateImage : '../../../../assets/images/nopng.png'"
alt=""> alt="">
<img *ngIf="!data.oilUnloadingNodes[5].isCorrect" class="err" <img *ngIf="!data[3].isCorrect" class="err"
src="../../../../assets/images/err.png" alt=""> src="../../../../assets/images/err.png" alt="">
</div> </div>
<span class="name">放置消防器材</span> <span class="name">放置消防器材</span>
@ -89,7 +93,7 @@
卸油操作 卸油操作
</div> </div>
<div class="content content2"> <div class="content content2">
<div class="colimglist"> <!-- <div class="colimglist">
<div class="imgbox"> <div class="imgbox">
<span class="timespan" <span class="timespan"
[ngClass]="{'timespanerr': !data.oilUnloadingNodes[7].isCorrect || !data.oilUnloadingNodes[7].violateImage}"><i [ngClass]="{'timespanerr': !data.oilUnloadingNodes[7].isCorrect || !data.oilUnloadingNodes[7].violateImage}"><i
@ -130,56 +134,93 @@
<span class="name">第三方确认</span> <span class="name">第三方确认</span>
</div> </div>
</div> </div> -->
<div class="colimglist"> <div class="colimglist">
<div class="imgbox"> <!-- <div class="imgbox">
<span class="name">开始卸油</span> <span class="name">开始卸油</span>
</div> -->
<div class="imgbox">
<span class="timespan" [ngClass]="{'timespanerr': !data[4].isCorrect}"><i
nz-icon nzType="clock-circle"
nzTheme="outline"></i>{{data[4].violateTime ?
(data[4].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[4].violateImage)"
[ngClass]="{'selectedimg': !data[4].violateImage}">
<img [src]="data[4].violateImage ? data[4].violateImage : '../../../../assets/images/nopng.png'"
alt="">
<img *ngIf="!data[4].isCorrect" class="err"
src="../../../../assets/images/err.png" alt="">
</div>
<span class="name">连接卸油管</span>
</div> </div>
<img class="rightArrow" src="../../../assets/images/rightArrow.png" alt=""> <img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox"> <div class="imgbox">
<span class="timespan" <span class="timespan" [ngClass]="{'timespanerr': !data[5].isCorrect}"><i
[ngClass]="{'timespanerr': !data.oilUnloadingNodes[10].isCorrect || !data.oilUnloadingNodes[10].violateImage}"><i nz-icon nzType="clock-circle"
nz-icon nzType="clock-circle" nzTheme="outline"></i>{{data.oilUnloadingNodes[10].violateTime ? (data.oilUnloadingNodes[10].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span> nzTheme="outline"></i>{{data[5].violateTime ?
<div class="img" (click)="lookImg(data.oilUnloadingNodes[10].violateImage)" [ngClass]="{'selectedimg': !data.oilUnloadingNodes[10].violateImage}"> (data[5].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<img [src]="data.oilUnloadingNodes[10].violateImage ? data.oilUnloadingNodes[10].violateImage : '../../../../assets/images/nopng.png'" <div class="img" (click)="lookImg(data[5].violateImage)"
[ngClass]="{'selectedimg': !data[5].violateImage}">
<img [src]="data[5].violateImage ? data[5].violateImage : '../../../../assets/images/nopng.png'"
alt=""> alt="">
<img *ngIf="!data.oilUnloadingNodes[10].isCorrect" class="err" <img *ngIf="!data[5].isCorrect" class="err"
src="../../../../assets/images/err.png" alt=""> src="../../../../assets/images/err.png" alt="">
</div> </div>
<span class="name">全程监卸</span> <span class="name">全程监卸</span>
</div> </div>
<img class="rightArrow" src="../../../assets/images/rightArrow.png" alt=""> <img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox"> <div class="imgbox">
<span class="timespan" <span class="timespan" [ngClass]="{'timespanerr': !data[6].isCorrect}"><i
[ngClass]="{'timespanerr': !data.oilUnloadingNodes[11].isCorrect || !data.oilUnloadingNodes[11].violateImage}"><i nz-icon nzType="clock-circle"
nz-icon nzType="clock-circle" nzTheme="outline"></i>{{data.oilUnloadingNodes[11].violateTime ? (data.oilUnloadingNodes[11].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span> nzTheme="outline"></i>{{data[6].violateTime ?
<div class="img" (click)="lookImg(data.oilUnloadingNodes[11].violateImage)" [ngClass]="{'selectedimg': !data.oilUnloadingNodes[11].violateImage}"> (data[6].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<img [src]="data.oilUnloadingNodes[11].violateImage ? data.oilUnloadingNodes[11].violateImage : '../../../../assets/images/nopng.png'" <div class="img" (click)="lookImg(data[6].violateImage)"
[ngClass]="{'selectedimg': !data[6].violateImage}">
<img [src]="data[6].violateImage ? data[6].violateImage : '../../../../assets/images/nopng.png'"
alt=""> alt="">
<img *ngIf="!data.oilUnloadingNodes[11].isCorrect" class="err" <img *ngIf="!data[6].isCorrect" class="err"
src="../../../../assets/images/err.png" alt=""> src="../../../../assets/images/err.png" alt="">
</div> </div>
<span class="name">拆除卸油管</span> <span class="name">拆除卸油管</span>
</div> </div>
<img class="rightArrow" src="../../../assets/images/rightArrow.png" alt=""> <img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox">
<span class="timespan"
[ngClass]="{'timespanerr': !data[7].isCorrect}"><i
nz-icon nzType="clock-circle"
nzTheme="outline"></i>{{data[7].violateTime ?
(data[7].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[7].violateImage)"
[ngClass]="{'selectedimg': !data[7].violateImage}">
<img [src]="data[7].violateImage ? data[7].violateImage : '../../../../assets/images/nopng.png'"
alt="">
<img *ngIf="!data[7].isCorrect" class="err"
src="../../../../assets/images/err.png" alt="">
</div>
<span class="name">油罐车离场</span>
</div>
<!-- <img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox"> <div class="imgbox">
<span class="timespan" <span class="timespan"
[ngClass]="{'timespanerr': !data.oilUnloadingNodes[12].isCorrect || !data.oilUnloadingNodes[12].violateImage}"><i [ngClass]="{'timespanerr': !data.oilUnloadingNodes[12].isCorrect || !data.oilUnloadingNodes[12].violateImage}"><i
nz-icon nzType="clock-circle" nzTheme="outline"></i>{{data.oilUnloadingNodes[12].violateTime ? (data.oilUnloadingNodes[12].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span> nz-icon nzType="clock-circle"
<div class="img" (click)="lookImg(data.oilUnloadingNodes[12].violateImage)" [ngClass]="{'selectedimg': !data.oilUnloadingNodes[12].violateImage}"> nzTheme="outline"></i>{{data.oilUnloadingNodes[12].violateTime ?
(data.oilUnloadingNodes[12].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data.oilUnloadingNodes[12].violateImage)"
[ngClass]="{'selectedimg': !data.oilUnloadingNodes[12].violateImage}">
<img [src]="data.oilUnloadingNodes[12].violateImage ? data.oilUnloadingNodes[12].violateImage : '../../../../assets/images/nopng.png'" <img [src]="data.oilUnloadingNodes[12].violateImage ? data.oilUnloadingNodes[12].violateImage : '../../../../assets/images/nopng.png'"
alt=""> alt="">
<img *ngIf="!data.oilUnloadingNodes[12].isCorrect" class="err" <img *ngIf="!data.oilUnloadingNodes[12].isCorrect" class="err"
src="../../../../assets/images/err.png" alt=""> src="../../../../assets/images/err.png" alt="">
</div> </div>
<span class="name">清理现场</span> <span class="name">清理现场</span>
</div> -->
</div> </div>
</div> <!--
<div class="line"></div> <div class="line"></div>
<div class="line2"></div> <div class="line2"></div>
<img class="bottomArrow2" src="../../../assets/images/bottomArrow2.png" alt=""> <img class="bottomArrow2" src="../../../assets/images/bottomArrow2.png" alt=""> -->
</div> </div>
</div> </div>
</div> </div>

18
src/app/pages/oil-unloading-process/oil-unloading-process.component.scss

@ -104,9 +104,14 @@
.content1 { .content1 {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-around; justify-content: center;
box-sizing: border-box; box-sizing: border-box;
padding: 0 30px; padding: 0 30px;
.rightArrow {
width: 40px;
height: 38px;
margin: 0 12px;
}
} }
.content2 { .content2 {
@ -158,12 +163,13 @@
.topbox { .topbox {
width: 100%; width: 100%;
height: 184px; height: 200px;
} }
.bottombox { .bottombox {
width: 100%; width: 100%;
height: 384px; // height: 384px;
height: 200px;
} }
.bottomArrow { .bottomArrow {
@ -215,9 +221,9 @@
} }
.selectedimg { .selectedimg {
box-shadow: 0px 0px 8px #FF4B65; // box-shadow: 0px 0px 8px #FF4B65;
border: 1px solid #FF4B65; // border: 1px solid #FF4B65;
background: #3f213b; // background: #3f213b;
img { img {
width: 24px; width: 24px;

6
src/app/pages/oil-unloading-process/oil-unloading-process.component.ts

@ -11,7 +11,7 @@ export class OilUnloadingProcessComponent implements OnInit {
constructor(private message: NzMessageService) { } constructor(private message: NzMessageService) { }
ngOnInit(): void { ngOnInit(): void {
console.log(this.data) // console.log(this.data)
} }
lookImg(url) { lookImg(url) {
if (url) { if (url) {
@ -32,8 +32,10 @@ export class OilUnloadingProcessComponent implements OnInit {
}); });
node.click(); node.click();
}, 0); }, 0);
}else{ } else {
this.message.create('warning', `该节点没有图片`); this.message.create('warning', `该节点没有图片`);
} }
} }
} }

16
src/app/pages/today-warning-admin/today-warning-admin.component.ts

@ -229,10 +229,10 @@ export class TodayWarningAdminComponent implements OnInit {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name, name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification, storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'),
isScrapped: true, isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
@ -256,10 +256,10 @@ export class TodayWarningAdminComponent implements OnInit {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification, storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {

16
src/app/pages/today-warning/today-warning.component.ts

@ -176,10 +176,10 @@ export class TodayWarningComponent implements OnInit {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name, name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification, storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'),
isScrapped: true, isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
@ -203,10 +203,10 @@ export class TodayWarningComponent implements OnInit {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification, storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {

47
src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.html

@ -6,22 +6,32 @@
<i nz-icon nzType="close" nzTheme="outline" (click)="destroyModal()"></i> <i nz-icon nzType="close" nzTheme="outline" (click)="destroyModal()"></i>
</div> </div>
<nz-radio-group *ngIf="!data2.handleTime" class="radiobox" [(ngModel)]="radioValue" <p *ngIf="!data2.handleTime && !isScrap" style="color: green;text-align: center;margin-top: 12px;">维保<span
(ngModelChange)="ngModelChange($event)"> *ngIf="data2.numberOfTimes == 2">临期预警</span><span *ngIf="data2.numberOfTimes == 3">逾期预警</span>
<label nz-radio nzValue="A">维保</label> </p>
<label nz-radio nzValue="B">报废</label> <p *ngIf="!data2.handleTime && isScrap" style="color: red;text-align: center;margin-top: 12px;">报废<span
</nz-radio-group> *ngIf="data2.numberOfTimes == 2">临期预警</span><span *ngIf="data2.numberOfTimes == 3">逾期预警</span>
</p>
<p *ngIf="data2.handleTime && (isScraped == '维保' || isScraped == '报废')" style="text-align: center;color: #91CCFF;"> <p *ngIf="data2.handleTime && (isScraped == '维保' || isScraped == '报废')" style="text-align: center;color: #91CCFF;">
<br> <br>
<span *ngIf="isScraped == '维保'" style="color: green;">已处置<br></span>
<span *ngIf="isScraped == '报废'" style="color: red;">已处置<br></span>
<span>器材名称:{{newdata.name}}</span><br> <span>器材名称:{{newdata.name}}</span><br>
<span *ngIf="isScraped == '维保'" style="color: green;">处置方式:维保<br></span> <span *ngIf="isScraped == '维保'" style="color: green;">处置方式:维保<br></span>
<span *ngIf="isScraped == '报废'" style="color: red;">处置方式:报废<br></span> <span *ngIf="isScraped == '报废'" style="color: red;">处置方式:报废<br></span>
<span>处置时间:{{data2.handleTime | date:"yyyy-MM-dd HH:mm:ss"}}<br></span> <span>处置时间:{{data2.handleTime | date:"yyyy-MM-dd HH:mm:ss"}}<br></span>
<span>规格:{{newdata.specification}}<br></span> <span>存放地点:{{newdata.storageLocation}}<br></span>
<span>购入时间:{{newdata.purchaseDate | date:"yyyy-MM-dd"}}<br></span> <span>生产日期:{{newdata.productionDate | date:"yyyy-MM-dd"}}<br></span>
<span>生产时间:{{newdata.productionDate | date:"yyyy-MM-dd"}}<br></span> <span>下次维保日期:{{newdata.maintenanceDate | date:"yyyy-MM-dd"}}<br></span>
<span>有效期至:{{newdata.validityEndTime | date:"yyyy-MM-dd"}}</span> <span>有效期至:{{newdata.validityEndTime | date:"yyyy-MM-dd"}}</span>
</p> </p>
<p *ngIf=" !data2.handleTime && isScrap" style="text-align: center;color: #91CCFF;">
<span>器材名称:{{data2.violatedItemSnapshotObj.name}}</span><br>
<span>存放地点:{{data2.violatedItemSnapshotObj.storageLocation}}<br></span>
<span>有效期至:{{data2.violatedItemSnapshotObj.validityEndTime | date:"yyyy-MM-dd"}}</span>
</p>
<form nz-form [formGroup]="validateForm" class="form"> <form nz-form [formGroup]="validateForm" class="form">
<div *ngIf=" !data2.handleTime && !isScrap"> <div *ngIf=" !data2.handleTime && !isScrap">
<p>消防器材名称</p> <p>消防器材名称</p>
@ -33,28 +43,28 @@
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<p>规格</p> <p>存放地点</p>
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-input-group> <nz-input-group>
<input [(ngModel)]="data2.violatedItemSnapshotObj.specification" nz-input type="text" <input [(ngModel)]="data2.violatedItemSnapshotObj.storageLocation" nz-input type="text"
formControlName="specification" placeholder="请输入规格" /> formControlName="storageLocation" placeholder="请输入存放地点" />
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<p>购入日期</p> <p>生产日期</p>
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-date-picker [nzAllowClear]="false" [(ngModel)]="data2.violatedItemSnapshotObj.purchaseDate" <nz-date-picker [nzAllowClear]="false" [(ngModel)]="data2.violatedItemSnapshotObj.productionDate"
formControlName="buytime" nzPlaceHolder="请输入购入日期"> formControlName="productionDate" nzPlaceHolder="请输入生产日期">
</nz-date-picker> </nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<p>生产日期</p> <p>下次维保日期</p>
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-date-picker [nzAllowClear]="false" [(ngModel)]="data2.violatedItemSnapshotObj.productionDate" <nz-date-picker [nzAllowClear]="false" [(ngModel)]="data2.violatedItemSnapshotObj.maintenanceDate"
formControlName="prodtime" nzPlaceHolder="请输入生产日期"> formControlName="maintenanceDate" nzPlaceHolder="请输入下次维保日期">
</nz-date-picker> </nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
@ -62,12 +72,11 @@
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-date-picker [nzAllowClear]="false" [(ngModel)]="data2.violatedItemSnapshotObj.validityEndTime" <nz-date-picker [nzAllowClear]="false" [(ngModel)]="data2.violatedItemSnapshotObj.validityEndTime"
formControlName="validitytime" nzPlaceHolder="有效期至"> formControlName="validityEndTime" nzPlaceHolder="有效期至">
</nz-date-picker> </nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div class="btnbox" *ngIf="!data2.handleTime"> <div class="btnbox" *ngIf="!data2.handleTime">
<button nz-button type="submit" class="ok" (click)="ok()">确定</button> <button nz-button type="submit" class="ok" (click)="ok()">确定</button>
<button nz-button type="button" class="cancel" (click)="destroyModal()">取消</button> <button nz-button type="button" class="cancel" (click)="destroyModal()">取消</button>

30
src/app/pages/warning-statistics-list/disposeequipment/disposeequipment.component.ts

@ -17,14 +17,17 @@ export class DisposeequipmentComponent implements OnInit {
radioValue = "A" radioValue = "A"
data2 data2
copydata2 copydata2
isScrap
isScraped isScraped
newdata newdata
ngOnInit(): void { ngOnInit(): void {
this.data2 = JSON.parse(JSON.stringify(this.data)) this.data2 = JSON.parse(JSON.stringify(this.data))
this.copydata2 = JSON.parse(JSON.stringify(this.data)) this.copydata2 = JSON.parse(JSON.stringify(this.data))
console.log('快照预警数据', this.data2)
// console.log('快照预警数据', this.data2)
if (this.data2.handleTime) { if (this.data2.handleTime) {
let params = { let params = {
Id: this.data2.violatedItemSnapshotObj.id Id: this.data2.violatedItemSnapshotObj.id
@ -38,14 +41,20 @@ export class DisposeequipmentComponent implements OnInit {
this.isScraped = '维保' this.isScraped = '维保'
} }
}) })
}else{
if(this.data2.desc == '维保'){
this.isScrap = false
}else{
this.isScrap = true
}
} }
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
name: [null, [Validators.required]], name: [null, [Validators.required]],
specification: [null, [Validators.required]], storageLocation: [null, [Validators.required]],
buytime: [null, [Validators.required]], productionDate: [null, [Validators.required]],
prodtime: [null, [Validators.required]], maintenanceDate: [null, [Validators.required]],
validitytime: [null, [Validators.required]] validityEndTime: [null, [Validators.required]]
}); });
@ -57,13 +66,4 @@ export class DisposeequipmentComponent implements OnInit {
ok() { ok() {
this.modal.triggerOk() this.modal.triggerOk()
} }
//是否报废
isScrap = false
ngModelChange(e) {
if (e == 'A') {
this.isScrap = false
} else {
this.isScrap = true
}
}
} }

16
src/app/pages/warning-statistics-list/warning-statistics-list.component.html

@ -104,16 +104,16 @@
overflow:hidden; overflow:hidden;
text-overflow:ellipsis;">序号</span> text-overflow:ellipsis;">序号</span>
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="2">
预警类别 预警类别
</div> </div>
<div nz-col nzSpan="4"> <div nz-col nzSpan="3">
预警内容 预警内容
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
公司名称 公司名称
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="5">
区域名称 区域名称
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
@ -134,7 +134,7 @@
<div nz-col nzSpan="1"> <div nz-col nzSpan="1">
<span style="margin-left: 20px;">{{key+1}}</span> <span style="margin-left: 20px;">{{key+1}}</span>
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="2">
<ng-container *ngIf="item.numberOfTimes; else elseTemplate"> <ng-container *ngIf="item.numberOfTimes; else elseTemplate">
<span *ngIf="item.numberOfTimes == 1">办理提醒</span> <span *ngIf="item.numberOfTimes == 1">办理提醒</span>
<span *ngIf="item.numberOfTimes == 2">临期提醒</span> <span *ngIf="item.numberOfTimes == 2">临期提醒</span>
@ -144,7 +144,7 @@
逾期报警 逾期报警
</ng-template> </ng-template>
</div> </div>
<div nz-col nzSpan="4"> <div nz-col nzSpan="3">
<ng-container *ngIf="item.numberOfTimes; else elseTemplate2"> <ng-container *ngIf="item.numberOfTimes; else elseTemplate2">
<span *ngIf="item.numberOfTimes == 1">{{item.desc}}办理提醒</span> <span *ngIf="item.numberOfTimes == 1">{{item.desc}}办理提醒</span>
<span *ngIf="item.numberOfTimes == 2">{{item.desc}}临期提醒</span> <span *ngIf="item.numberOfTimes == 2">{{item.desc}}临期提醒</span>
@ -154,13 +154,13 @@
消防设备逾期报警 消防设备逾期报警
</ng-template> </ng-template>
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3" [title]="item.gasStation.companyName">
{{item.gasStation.companyName ? item.gasStation.companyName : '/'}} {{item.gasStation.companyName ? item.gasStation.companyName : '/'}}
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="5" [title]="item.gasStation.locationName">
{{item.gasStation.locationName ? item.gasStation.locationName : '/'}} {{item.gasStation.locationName ? item.gasStation.locationName : '/'}}
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3" [title]="item.gasStation.stationName">
{{item.gasStation.stationName ? item.gasStation.stationName : '/'}} {{item.gasStation.stationName ? item.gasStation.stationName : '/'}}
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">

24
src/app/pages/warning-statistics-list/warning-statistics-list.component.ts

@ -424,7 +424,7 @@ export class WarningStatisticsListComponent implements OnInit {
}) })
} }
refreshEchartsData1(data) { refreshEchartsData1(data) {
console.log('echarts信息', data) // console.log('echarts信息', data)
//饼图 //饼图
let totalCount = 0 let totalCount = 0
data.violationList.forEach(element => { data.violationList.forEach(element => {
@ -539,7 +539,7 @@ export class WarningStatisticsListComponent implements OnInit {
} }
let ViolationIds = [] let ViolationIds = []
console.log(456, this.validateForm.value) // console.log(456, this.validateForm.value)
if (this.validateForm.value.eventSystemName) { if (this.validateForm.value.eventSystemName) {
ViolationIds.push(this.validateForm.value.eventSystemName) ViolationIds.push(this.validateForm.value.eventSystemName)
} else { } else {
@ -587,7 +587,7 @@ export class WarningStatisticsListComponent implements OnInit {
this.validateForm.controls[key].markAsPristine(); this.validateForm.controls[key].markAsPristine();
this.validateForm.controls[key].updateValueAndValidity(); this.validateForm.controls[key].updateValueAndValidity();
} }
console.log('赋值日期', [this.startdate, this.enddate]) // console.log('赋值日期', [this.startdate, this.enddate])
this.validateForm.patchValue({ this.validateForm.patchValue({
datePicker: [this.startdate, this.enddate], datePicker: [this.startdate, this.enddate],
eventSystemName: null, eventSystemName: null,
@ -629,7 +629,7 @@ export class WarningStatisticsListComponent implements OnInit {
}, },
nzFooter: null, nzFooter: null,
nzOnOk: async () => { nzOnOk: async () => {
console.log(99999, instance.content) // console.log(99999, instance.content)
} }
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
@ -663,10 +663,10 @@ export class WarningStatisticsListComponent implements OnInit {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name, name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification, storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'),
isScrapped: true, isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
@ -690,10 +690,10 @@ export class WarningStatisticsListComponent implements OnInit {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification, storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'), productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'), maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'), validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
} }
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {

25
src/app/service/cache-token.service.ts

@ -1,31 +1,28 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http' import { HttpClient } from '@angular/common/http'
import { CookieService } from 'ngx-cookie-service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class CacheTokenService { export class CacheTokenService {
constructor(private http:HttpClient,private cookieService: CookieService) { } constructor(private http: HttpClient) { }
public timer; public timer;
//刷新token令牌定时器 //刷新token令牌定时器
startUp = ():void=>{ startUp = (): void => {
window.clearInterval(this.timer) window.clearInterval(this.timer)
this.timer = window.setInterval( ()=>{ this.timer = window.setInterval(() => {
var token = this.cookieService.get("token"); var token = sessionStorage.getItem("token");
var refreshToken = this.cookieService.get("refreshToken"); var refreshToken = sessionStorage.getItem("refreshToken");
this.http.post('/api/CompanyAccount/RefreshToken', { this.http.post('/api/CompanyAccount/RefreshToken', {
token: token, token: token,
refreshToken: refreshToken refreshToken: refreshToken
}).subscribe( (data:any) => { }).subscribe((data: any) => {
sessionStorage.setItem("token",data.token); sessionStorage.setItem("token", data.token);
this.cookieService.set("token",data.token,null,'/');
this.cookieService.set("refreshToken",data.refreshToken,null,'/');
}) })
} ,18*60*1000) }, 18 * 60 * 1000)
} }
@ -33,12 +30,12 @@ export class CacheTokenService {
//删除定时器 //删除定时器
delete = ():void=> { delete = (): void => {
window.clearInterval(this.timer) window.clearInterval(this.timer)
} }
createTime = (time:string)=>{ createTime = (time: string) => {
var newtime = time.substr(0,4) + '年' + time.substr(5,2) + '月' + time.substr(8,2) + '日' + time.substr(11,8) var newtime = time.substr(0, 4) + '年' + time.substr(5, 2) + '月' + time.substr(8, 2) + '日' + time.substr(11, 8)
} }
} }

10
src/app/ui/tabbar/tabbar.component.ts

@ -2,8 +2,6 @@ import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { HttpClient } from '@angular/common/http' import { HttpClient } from '@angular/common/http'
import { Router, ActivatedRoute } from '@angular/router' import { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from '../../service/cache-token.service' //引入服务 import { CacheTokenService } from '../../service/cache-token.service' //引入服务
import { ChangepasswordComponent } from '../changepassword/changepassword.component'
import { CookieService } from 'ngx-cookie-service';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
@ -15,7 +13,7 @@ import { NzMessageService } from 'ng-zorro-antd/message';
export class TabbarComponent implements OnInit { export class TabbarComponent implements OnInit {
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService,
private cookieService: CookieService, private message: NzMessageService) { } private message: NzMessageService) { }
surname: string surname: string
userName: string userName: string
isGasStation: string isGasStation: string
@ -24,10 +22,10 @@ export class TabbarComponent implements OnInit {
this.getTime() this.getTime()
}, 1000); }, 1000);
this.isGasStation = JSON.parse(sessionStorage.getItem('isGasStation')) this.isGasStation = JSON.parse(sessionStorage.getItem('isGasStation'))
if(this.isGasStation == 'true'){ if (this.isGasStation == 'true') {
this.surname = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).name this.surname = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).name
this.userName = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).userName this.userName = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).userName
}else{ } else {
this.surname = JSON.parse(sessionStorage.getItem('userdata')).name this.surname = JSON.parse(sessionStorage.getItem('userdata')).name
this.userName = JSON.parse(sessionStorage.getItem('userdata')).userName this.userName = JSON.parse(sessionStorage.getItem('userdata')).userName
} }
@ -69,8 +67,6 @@ export class TabbarComponent implements OnInit {
// window.localStorage.clear() // window.localStorage.clear()
localStorage.removeItem("isautologin") localStorage.removeItem("isautologin")
this.cookieService.set("token", '', new Date(new Date().getTime() + 1), '/');
this.cookieService.set("refreshToken", '', new Date(new Date().getTime() + 1), '/');
this.router.navigate(['/login']) this.router.navigate(['/login'])
} }

Loading…
Cancel
Save