刘向辉 3 years ago
parent
commit
ae7ec6be5f
  1. 3542
      package-lock.json
  2. 18
      src/app/app.component.ts
  3. 3
      src/app/app.module.ts
  4. 8
      src/app/auth.guard.ts
  5. 52
      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. 16
      src/app/pages/equipment-info/addequipment/addequipment.component.html
  11. 8
      src/app/pages/equipment-info/addequipment/addequipment.component.ts
  12. 20
      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. 195
      src/app/pages/home/home.component.html
  18. 77
      src/app/pages/home/home.component.ts
  19. 4
      src/app/pages/login/login.component.html
  20. 68
      src/app/pages/login/login.component.ts
  21. 153
      src/app/pages/oil-station-info/oil-station-info.component.html
  22. 127
      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. 29
      src/app/service/cache-token.service.ts
  36. 14
      src/app/ui/tabbar/tabbar.component.ts

3542
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 { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from './service/cache-token.service'//引入服务
import { CookieService } from 'ngx-cookie-service';
import "reflect-metadata";
import { NzNotificationService } from 'ng-zorro-antd/notification';
@Component({
@ -14,22 +14,10 @@ export class AppComponent {
@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 {
// 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 {

3
src/app/app.module.ts

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

8
src/app/auth.guard.ts

@ -1,14 +1,13 @@
import { Component, OnInit, Inject } from '@angular/core';
import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
import { CookieService } from 'ngx-cookie-service';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
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 {
console.log('xxxxxxxxxxxx')
// 判断本地有没有token
const token = this.cookieService.get("token") || sessionStorage.getItem('token');
const token = sessionStorage.getItem('token');
// 如果有token,允许访问
if (token) { return true; }

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

@ -1,13 +1,13 @@
import { Injectable } from '@angular/core';
import {
HttpClient, HttpInterceptor, HttpHandler, HttpRequest,
HttpErrorResponse
HttpErrorResponse,
HttpResponse
} from '@angular/common/http';
import { throwError } from 'rxjs'
import { catchError } from 'rxjs/operators';
import { catchError, tap, finalize } from 'rxjs/operators';
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';
//baseurl
// const baseurl = 'http://39.106.78.171:8008';
@ -15,10 +15,10 @@ import { NzMessageService } from 'ng-zorro-antd/message';
@Injectable()
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) {
let params = req.params;
for (const key of req.params.keys()) {
if (params.get(key) === undefined || params.get(key) === null) {
@ -26,24 +26,42 @@ export class BaseInterceptor implements HttpInterceptor {
}
}
req = req.clone({ params });
// debugger
// console.log('xxxxxx',req)
// debugger
// console.log('xxxxxx',req)
let newReq = req.clone({
url: req.hadBaseurl ? `${req.url}` : `${req.url}`,
});
if (!req.cancelToken) {
/*获取token*/
let token = this.cookieService.get("token")
let token = sessionStorage.getItem("token")
/*此处设置额外请求头,token令牌*/
newReq.headers =
newReq.headers.set('Authorization', `Bearer ${token}`)
if (!!token) {
newReq.headers = newReq.headers.set('Authorization', `Bearer ${token}`)
}
}
// 携带请求头发送下一次请求
return next.handle(newReq)
.pipe(
//箭头函数,注意this指向
catchError((err) => this.handleError(err))
tap(event => {
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刷新令牌过期!!!
private handleError(error: HttpErrorResponse) {
console.log('http错误', error)
// 用户认证失败返回登录页
if (error.status === 401 || error.status === 614) {
this.token.delete()
sessionStorage.clear()
// window.localStorage.clear()
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.router.navigate(['/login'])
}
@ -69,7 +83,9 @@ export class BaseInterceptor implements HttpInterceptor {
if (error.status === 400) {
this.message.create('error', `请核对您的输入信息或格式是否正确!`);
}
if (error.status === 500) {
this.message.create('error', `状态500,服务器错误!`);
}
if (error.error instanceof ErrorEvent) {
// 发生客户端或网络错误。相应处理。
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-control nzErrorTip="">
<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-form-control>
</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 { 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 { NzSafeAny } from 'ng-zorro-antd/core/types';
@Component({
selector: 'app-change-password',
templateUrl: './change-password.component.html',
@ -12,11 +13,33 @@ export class ChangePasswordComponent implements OnInit {
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
validateForm!: FormGroup;
ngOnInit(): void {
const { password } = MyValidators;
this.validateForm = this.fb.group({
oldpassword: [null, [Validators.required]],
newpassword: [null, [Validators.required]],
affirmpassword: [null, [Validators.required]]
newpassword: [null, [Validators.required, password]],
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 = {
id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
@ -639,10 +639,10 @@ export class CriminalRecordsAdminComponent implements OnInit {
let body = {
id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
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 = {
id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
@ -583,10 +583,10 @@ export class CriminalRecordsComponent implements OnInit {
let body = {
id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {

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

@ -14,30 +14,30 @@
</nz-input-group>
</nz-form-control>
</nz-form-item>
<p>规格</p>
<p>存放地点</p>
<nz-form-item>
<nz-form-control>
<nz-input-group>
<input nz-input type="text" formControlName="specification" placeholder="请输入规格" />
<input nz-input type="text" formControlName="storageLocation" placeholder="请输入存放地点" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<p>购入日期</p>
<p>生产日期</p>
<nz-form-item>
<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-item>
<p>生产日期</p>
<p>下次维保日期</p>
<nz-form-item>
<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-item>
<p>有效期至</p>
<nz-form-item>
<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-item>
<div class="btnbox">
@ -45,4 +45,4 @@
<button nz-button type="button" class="cancel" (click)="destroyModal()">取消</button>
</div>
</form>
</div>
</div>

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

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

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

@ -14,30 +14,34 @@
</nz-input-group>
</nz-form-control>
</nz-form-item>
<p>规格</p>
<p>存放地点</p>
<nz-form-item>
<nz-form-control>
<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-form-control>
</nz-form-item>
<p>购入日期</p>
<p>生产日期</p>
<nz-form-item>
<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-item>
<p>生产日期</p>
<p>下次维保日期</p>
<nz-form-item>
<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-item>
<p>有效期至</p>
<nz-form-item>
<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-item>
<div class="btnbox">
@ -45,4 +49,4 @@
<button nz-button type="button" class="cancel" (click)="destroyModal()">取消</button>
</div>
</form>
</div>
</div>

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

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

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

@ -29,13 +29,13 @@
消防器材
</div>
<div nz-col nzSpan="4">
规格
存放地点
</div>
<div nz-col nzSpan="4">
购入日期
生产日期
</div>
<div nz-col nzSpan="4">
生产日期
下次维保日期
</div>
<div nz-col nzSpan="4">
有效期至
@ -50,13 +50,13 @@
{{item.name}}
</div>
<div nz-col nzSpan="4">
{{item.specification}}
{{item.storageLocation}}
</div>
<div nz-col nzSpan="4">
{{item.purchaseDate | date:"yyyy-MM-dd"}}
{{item.productionDate | date:"yyyy-MM-dd"}}
</div>
<div nz-col nzSpan="4">
{{item.productionDate | date:"yyyy-MM-dd"}}
{{item.maintenanceDate | date:"yyyy-MM-dd"}}
</div>
<div nz-col nzSpan="4">
{{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 => {
let body = {
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id
}
this.http.post('/api/services/app/FireEquipment/Create', body).subscribe(data => {
@ -118,10 +118,10 @@ export class EquipmentInfoComponent implements OnInit {
let body = {
id: item.id,
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.organizationUnitId
}
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,
organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId,
name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD')
storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).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) => {
let body = {
@ -723,10 +723,10 @@ export class HomePageComponent implements OnInit {
let body = {
id: copydata.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId
}
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {

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

@ -1,92 +1,133 @@
<div class="box">
<!-- <div>
<!-- <div>
<app-tabbar></app-tabbar>
</div> -->
<div class="menu">
<div class="boxleft">
<img src="../../../assets/images/logo2.png" alt="">
</div>
<div class="libox" *ngIf="!isGasStationNav">
<li [routerLink]="['/homepage']" routerLinkActive="router-link-active">
首页
</li>
<li [routerLink]="['/plan']" routerLinkActive="router-link-active">
数字油站
</li>
<li [routerLink]="['/todaywarning']" routerLinkActive="router-link-active">
今日预警
</li>
<li [routerLink]="['/records']" routerLinkActive="router-link-active">
预警记录
</li>
</div>
<div class="libox" *ngIf="isGasStationNav">
<li [routerLink]="['/plan/petrolStation']" routerLinkActive="router-link-active">
数字油站
</li>
<li [routerLink]="['/todaywarning/petrolStation']" routerLinkActive="router-link-active">
今日预警
</li>
<li [routerLink]="['/records/petrolStation']" routerLinkActive="router-link-active">
预警记录
</li>
</div>
<div class="menu">
<div class="boxleft">
<img src="../../../assets/images/logo2.png" alt="">
</div>
<div class="libox" *ngIf="!isGasStationNav">
<li [routerLink]="['/homepage']" routerLinkActive="router-link-active">
首页
</li>
<li [routerLink]="['/plan']" routerLinkActive="router-link-active">
数字油站
</li>
<li [routerLink]="['/todaywarning']" routerLinkActive="router-link-active">
今日预警
</li>
<li [routerLink]="['/records']" routerLinkActive="router-link-active">
预警记录
</li>
</div>
<div class="libox" *ngIf="isGasStationNav">
<li [routerLink]="['/plan/petrolStation']" routerLinkActive="router-link-active">
数字油站
</li>
<li [routerLink]="['/todaywarning/petrolStation']" routerLinkActive="router-link-active">
今日预警
</li>
<li [routerLink]="['/records/petrolStation']" routerLinkActive="router-link-active">
预警记录
</li>
</div>
<!-- 登录信息按钮 -->
<div class="boxright">
<img *ngIf="!isfullscreen" (click)="fullscreenToggle()" style="margin-right: 8px;cursor: pointer;"
src="../../../assets/images/fullscreen.png" alt="" title="全屏">
<img *ngIf="isfullscreen" (click)="closefullscreen()" style="margin-right: 8px;cursor: pointer;"
src="../../../assets/images/fullscreen.png" alt="" title="全屏">
<span class="time">
{{time}}
</span>
<!-- 登录信息按钮 -->
<div class="boxright">
<img *ngIf="!isfullscreen" (click)="fullscreenToggle()" style="margin-right: 8px;cursor: pointer;"
src="../../../assets/images/fullscreen.png" alt="" title="全屏">
<img *ngIf="isfullscreen" (click)="closefullscreen()" style="margin-right: 8px;cursor: pointer;"
src="../../../assets/images/fullscreen.png" alt="" title="全屏">
<span style="margin: 0 12px;">|</span>
<span class="time">
{{time}}
</span>
<span style="margin-right: 8px;"> {{surname}} </span>
<a nz-dropdown [nzDropdownMenu]="menu" [nzTrigger]="'click'" [nzBackdrop]='false'>
<img src="../../../assets/images/head.png" alt="">
</a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li *ngIf="isGasStation" nz-menu-item (click)="navChange('/oliStationInfo')">基本信息</li>
<li *ngIf="isGasStation" nz-menu-item (click)="navChange('/equipmentInfo')">器材信息</li>
<li nz-menu-item (click)="changePassword()">修改密码</li>
<li *ngIf="userName == 'admin'" nz-menu-item (click)="navChange('/system/organization')">系统管理</li>
<li nz-menu-item (click)="signOut()">退出系统</li>
</ul>
</nz-dropdown-menu>
<span style="margin: 0 12px;" *ngIf="isGasStationBack">|</span>
<img style="cursor: pointer;" *ngIf="isGasStationBack" src="../../../assets/images/goback.png" alt=""
(click)="goback()">
</div>
<span style="margin: 0 12px;">|</span>
<span style="margin-right: 8px;"> {{surname}} </span>
<a nz-dropdown [nzDropdownMenu]="menu" [nzTrigger]="'click'" [nzBackdrop]='false'>
<img src="../../../assets/images/head.png" alt="">
</a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li *ngIf="isGasStation" nz-menu-item (click)="navChange('/oliStationInfo')">基本信息</li>
<li *ngIf="isGasStation" nz-menu-item (click)="navChange('/equipmentInfo')">器材信息</li>
<li nz-menu-item (click)="changePassword()">修改密码</li>
<li *ngIf="userName == 'admin'" nz-menu-item (click)="navChange('/system/organization')">系统管理</li>
<li nz-menu-item (click)="signOut()">退出系统</li>
</ul>
</nz-dropdown-menu>
<span style="margin: 0 12px;" *ngIf="isGasStationBack">|</span>
<img style="cursor: pointer;" *ngIf="isGasStationBack" src="../../../assets/images/goback.png" alt=""
(click)="goback()">
</div>
<div class="content">
<router-outlet></router-outlet>
</div>
</div>
<div class="content">
<router-outlet></router-outlet>
</div>
</div>
<ng-template #warning let-item="data">
<div class="topbox">
<div>
<img src="../assets/images/warning.png" alt="">
</div>
<div class="text">
<span class="name">您有一条新的预警提醒!</span>
<span class="details">{{item.notification.data.properties.ViolationName}}</span>
</div>
<div class="topbox">
<div>
<img src="../assets/images/warning.png" alt="">
</div>
<div class="btnbox">
<div class="look" (click)="look(item)">
查看
</div>
<div class="lose" (click)="close(item)">
忽略
</div>
<div class="text">
<span class="name">您有一条新的预警提醒!</span>
<span class="details">{{item.notification.data.properties.ViolationName}}</span>
</div>
</ng-template>
</div>
<div class="btnbox">
<div class="look" (click)="look(item)">
查看
</div>
<div class="lose" (click)="close(item)">
忽略
</div>
</div>
</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 { NavChangeService } from '../../service/navChange.service';
import { CacheTokenService } from '../../service/cache-token.service' //引入服务
import { CookieService } from 'ngx-cookie-service';
import { NzMessageService } from 'ng-zorro-antd/message';
import { SignalRAspNetCoreHelper } from '../../../shared/helpers/SignalRAspNetCoreHelper';
import { NzNotificationService } from 'ng-zorro-antd/notification';
import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component';
import { NzModalService } from 'ng-zorro-antd/modal';
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 { DisposeequipmentComponent } from '../warning-statistics-list/disposeequipment/disposeequipment.component';
declare var abp: any
import * as moment from 'moment';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
@ -22,8 +23,16 @@ import * as moment from 'moment';
})
export class HomeComponent implements OnInit {
@ViewChild('warning', { static: false }) template?: TemplateRef<{}>;
passwordValidateForm!: FormGroup;
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
isGasStation: boolean
@ -85,8 +94,49 @@ 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) => {
console.log('abp.notifications.received收到通知', userNotification);
if (this.router.url.indexOf('todaywarning') != -1) {
@ -111,7 +161,6 @@ export class HomeComponent implements OnInit {
}
this.messageId.push(obj)
}
isVisible = false
modalData
look(item) {
@ -151,10 +200,10 @@ export class HomeComponent implements OnInit {
isScrapped: true,
organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId,
name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD')
storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).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) => {
let body = {
@ -183,10 +232,10 @@ export class HomeComponent implements OnInit {
let body = {
id: copydata.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: copydata.violatedItemSnapshotObj.organizationUnitId
}
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.token.delete()
sessionStorage.clear()
// window.localStorage.clear()
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'])
}

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

@ -2,7 +2,7 @@
<div class="card">
<h1 class="cardheader">欢迎登录</h1>
<h1 class="cardheader">加油站智能安全管理系统</h1>
<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
<nz-form-item>
<nz-form-control nzErrorTip="请输入账号!">
@ -48,5 +48,3 @@
</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 { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from '../../service/cache-token.service'//引入服务
import { CookieService } from 'ngx-cookie-service';//cookie插件
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzMessageService } from 'ng-zorro-antd/message';
import { Base64 } from 'js-base64';
import { NzNotificationService } from 'ng-zorro-antd/notification';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
declare var abp: any
@Component({
@ -18,15 +18,24 @@ declare var abp: any
export class LoginComponent implements OnInit {
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) { }
ngOnInit() {
passwordValidateForm!: FormGroup;
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, private fb: FormBuilder, private message: NzMessageService, private notificationService: NzNotificationService) {
const { password } = MyValidators;
this.validateForm = this.fb.group({
userName: [null, [Validators.required]],
password: [null, [Validators.required]],
password: [null, [Validators.required, password]],
remember: [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 password = localStorage.getItem('password')
@ -47,14 +56,11 @@ export class LoginComponent implements OnInit {
errmsg: string = ''; //错误信息
//跳转注册页面
toRegister() {
this.router.navigate(['/register'])
}
//记住密码
rememberInfo() {
// 判断用户是否勾选记住密码,如果勾选,在本地储存中储存登录信息
@ -70,9 +76,6 @@ export class LoginComponent implements OnInit {
}
}
remember: any//记住密码
autologin: any//自动登录
isLoading = false;
@ -104,13 +107,14 @@ export class LoginComponent implements OnInit {
}).subscribe(
(data: any) => {
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);
console.log('token', data)
console.log('token', data.result)
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('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.rememberInfo()
@ -125,10 +129,12 @@ export class LoginComponent implements OnInit {
sessionStorage.setItem("isGasStation", 'true');
this.router.navigate(['/todaywarning/petrolStation'])
this.message.create('success', `登录成功`);
} else {
sessionStorage.setItem("isGasStation", 'false');
this.router.navigate(['/homepage'])
this.message.create('success', `登录成功`);
}
}
}, err => {
@ -145,15 +151,31 @@ export class LoginComponent implements OnInit {
)
}
roleList = [
'管理员', '职工'
]
selectedRole: string
selecteRole(role) {
this.selectedRole = role
}
forget() {
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);
}

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

@ -304,7 +304,90 @@
<tr *ngFor="let item of httpBody.licenses;let key = index">
<td class="head" [title]="item.name">{{item.name}}</td>
<td colspan="3" class="imgbox">
<div class="timeDiv">
<div class="timeDivflex">
<div class="itemname">
证件编号:<span style="color: red;">*</span>
</div>
<nz-form-item title="证件编号">
<nz-form-control>
<nz-input-group>
<input style="border: 1px solid #91CCFF" [ngModelOptions]="{standalone: true}"
placeholder="请输入证件编号" [(ngModel)]="item.code" nz-input type="text" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</div>
<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-control>
<nz-date-picker required [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'开始时间'"
[(ngModel)]="item.startTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<nz-form-item style="border: 1px solid #91CCFF" title="证照有效期结束时间" *ngIf="!item.isPerpetual">
<nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'结束时间'"
[(ngModel)]="item.endTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div class="timeDivflex">
<div class="itemname">
证照提醒时间:<span style="color: red;">*</span>
</div>
<nz-form-item style="border: 1px solid #91CCFF" title="证照到期第一次提醒时间">
<nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'一次提醒时间'"
[(ngModel)]="item.firstWarnTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<nz-form-item style="border: 1px solid #91CCFF" title="证照到期第二次提醒时间">
<nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'二次提醒时间'"
[(ngModel)]="item.secondWarnTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div class="timeDivflex">
<div class="itemname">
证照年检时间:<span style="color: red;">*</span>
</div>
<label style="color: white;" [ngModelOptions]="{standalone: true}" nz-checkbox
[(ngModel)]="item.hasAnnualInspection">是否年检</label>
<nz-form-item style="border: 1px solid #91CCFF" title="年检时间" *ngIf="item.hasAnnualInspection">
<nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'年检时间'"
[(ngModel)]="item.annualInspectionTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<nz-form-item style="border: 1px solid #91CCFF" title="年检提醒时间" *ngIf="item.hasAnnualInspection">
<nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'年检提醒时间'"
[(ngModel)]="item.annualInspectionWarnTime" (ngModelChange)="onChange($event)">
</nz-date-picker>
</nz-form-control>
</nz-form-item>
<nz-form-item title="年检机构" *ngIf="item.hasAnnualInspection">
<nz-form-control>
<nz-input-group>
<input style="border: 1px solid #91CCFF" [ngModelOptions]="{standalone: true}"
placeholder="年检机构" [(ngModel)]="item.annualInspectionOrganizationName" nz-input
type="text" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</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"
@ -316,82 +399,12 @@
<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 class="timeDiv" style="width: 500px;">
<div class="timeDivflex" style="margin-bottom: 6px;">
<nz-form-item title="证件编号">
<nz-form-control>
<nz-input-group>
<input style="border: 1px solid #91CCFF" [ngModelOptions]="{standalone: true}"
placeholder="证件编号" [(ngModel)]="item.code" nz-input
type="text" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</div>
<div class="timeDivflex">
<nz-form-item style="border: 1px solid #91CCFF" title="证照有效期开始时间">
<nz-form-control>
<nz-date-picker required [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'开始时间'"
[(ngModel)]="item.startTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<nz-form-item style="border: 1px solid #91CCFF" title="证照有效期结束时间">
<nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'结束时间'"
[(ngModel)]="item.endTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div class="timeDivflex" style="margin: 6px 0;">
<nz-form-item style="border: 1px solid #91CCFF" title="证照到期第一次提醒时间">
<nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'一次提醒时间'"
[(ngModel)]="item.firstWarnTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<nz-form-item style="border: 1px solid #91CCFF" title="证照到期第二次提醒时间">
<nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'二次提醒时间'"
[(ngModel)]="item.secondWarnTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div class="timeDivflex" style="margin-bottom: 6px;">
<label style="color: white;" [ngModelOptions]="{standalone: true}" nz-checkbox
[(ngModel)]="item.hasAnnualInspection">是否年检</label>
</div>
<div class="timeDivflex timeDivflex2" *ngIf="item.hasAnnualInspection">
<nz-form-item style="border: 1px solid #91CCFF" title="年检时间">
<nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'年检时间'"
[(ngModel)]="item.annualInspectionTime" (ngModelChange)="onChange($event)"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<nz-form-item style="border: 1px solid #91CCFF" title="年检提醒时间">
<nz-form-control>
<nz-date-picker [ngModelOptions]="{standalone: true}" [nzPlaceHolder]="'年检提醒时间'"
[(ngModel)]="item.annualInspectionWarnTime" (ngModelChange)="onChange($event)">
</nz-date-picker>
</nz-form-control>
</nz-form-item>
<nz-form-item title="年检机构">
<nz-form-control>
<nz-input-group>
<input style="border: 1px solid #91CCFF" [ngModelOptions]="{standalone: true}"
placeholder="年检机构" [(ngModel)]="item.annualInspectionOrganizationName" nz-input
type="text" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</div>
</div>
</div>
<a class="deleteTr" nz-popconfirm nzPopconfirmTitle="确定删除该证照吗?" nzPopconfirmPlacement="bottom"
(nzOnConfirm)="deleteTrConfirm(key)">
<i *ngIf="item.name != '营业执照' && item.name != '危险化学品' && item.name != '成品油零售'" nz-icon nzType="close"
nzTheme="outline"></i>
</a>
</td>
</tr>
<tr style="height: 50px;">

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

@ -89,91 +89,92 @@
}
.imgtable {
tr,
td {
height: 200px;
}
width: 100%;
text-align: center;
border-collapse: collapse;
.imgbox {
width: 100%;
height: 100%;
position: relative;
.deleteTr{
position: absolute;
right: 5px;
top: 5px;
cursor: pointer;
}
.uploadDivbox {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0 16px;
display: flex;
align-items: center;
position: relative;
}
.uploadDiv {
margin-left: 16px;
width: 120px;
height: 80px;
// border: 1px solid red;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.fileinput {
width: 114px;
height: 32px;
position: absolute;
z-index: 100;
opacity: 0;
top: 23px;
cursor: pointer;
}
button {
z-index: 99;
width: 114px;
height: 32px;
background: rgba(0, 129, 255, 0.3);
border: 1px solid #36A2FF;
opacity: 1;
border-radius: 0px;
color: #91CCFF;
}
}
display: flex;
flex-direction: column;
.timeDiv {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
width: 100%;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-around;
.timeDivflex {
width: 100%;
height: 34px;
display: flex;
align-items: center;
margin: 5px 0;
nz-form-item {
width: 45%;
width: 20%;
margin-right: 15px;
}
}
.timeDivflex2 {
}
.uploadDivbox {
width: 100%;
height: 80px;
display: flex;
align-items: center;
position: relative;
margin: 5px 0;
.uploadDiv {
width: 120px;
height: 80px;
display: flex;
align-items: center;
nz-form-item {
width: 30%;
margin-right: 9px;
justify-content: center;
position: relative;
.fileinput {
width: 114px;
height: 32px;
position: absolute;
z-index: 100;
opacity: 0;
top: 23px;
cursor: pointer;
}
button {
z-index: 99;
width: 114px;
height: 32px;
background: rgba(0, 129, 255, 0.3);
border: 1px solid #36A2FF;
opacity: 1;
border-radius: 0px;
color: #91CCFF;
}
}
}
.itemname {
width: 120px;
text-align: right;
box-sizing: border-box;
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) {
this.httpBody.licenses = [
{ name: '营业执照', code: '', 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: '', 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: 1, hasAnnualInspection: true },
{ name: '危险化学品', code: '', isPerpetual: false, 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: 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
setTimeout(() => {
@ -179,6 +188,13 @@ export class OilStationInfoComponent implements OnInit {
licenses: [
]
}
perpetualChange(item, $event) {
if ($event) {
item.endTime = '9999-01-01'
}
}
onChange($event) {
}
@ -204,7 +220,7 @@ export class OilStationInfoComponent implements OnInit {
}
addTr() {
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) {
@ -247,10 +263,15 @@ export class OilStationInfoComponent implements OnInit {
body.stationType
body.govUnitDetail = JSON.stringify(this.httpBody.govUnitDetail)
console.log(body)
body.licenses.forEach(item => {
delete item.isPerpetual
})
this.http.put('/api/services/app/GasStation/Update', body).subscribe((data: any) => {
this.isLoadingSave = false
this.message.create('success', '保存成功!');
this.httpBody.licenses = data.result.licenses
// this.httpBody.licenses = data.result.licenses
}, err => {
this.isLoadingSave = false
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">
<span style="margin-left: 15px;">序号</span>
</div>
<div nz-col nzSpan="2">
<div nz-col nzSpan="3">
<span>油站名称</span>
</div>
<div nz-col nzSpan="2">
公司名称
</div>
<div nz-col nzSpan="2">
<div nz-col nzSpan="4">
区域
</div>
<div nz-col nzSpan="3">
@ -124,9 +124,9 @@
<div nz-col nzSpan="3" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
操作中准备预警节点数量
</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>
@ -139,13 +139,13 @@
<div nz-col nzSpan="1">
<span style="margin-left: 15px;">{{key + 1}}</span>
</div>
<div nz-col nzSpan="2" [title]="item.gasStation.stationName">
<div nz-col nzSpan="3" [title]="item.gasStation.stationName">
<span>{{item.gasStation.stationName}}</span>
</div>
<div nz-col nzSpan="2" [title]="item.gasStation.companyName">
{{item.gasStation.companyName}}
</div>
<div nz-col nzSpan="2" [title]="item.gasStation.locationName">
<div nz-col nzSpan="4" [title]="item.gasStation.locationName">
{{item.gasStation.locationName}}
</div>
<div nz-col nzSpan="3">
@ -160,9 +160,9 @@
<div nz-col nzSpan="3">
{{item.proccessingCount}}
</div>
<div nz-col nzSpan="3">
<!-- <div nz-col nzSpan="3">
{{item.allProccessCount}}
</div>
</div> -->
<div nz-col nzSpan="1">
<ng-container
*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) {
// 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({
nzContent: OilUnloadingProcessComponent,
nzViewContainerRef: this.viewContainerRef,
@ -674,7 +696,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
'background': '#000D21',
},
nzComponentParams: {
data: item
data: arr
},
nzFooter: null,
nzOnOk: async () => {

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

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

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

@ -104,9 +104,14 @@
.content1 {
display: flex;
align-items: center;
justify-content: space-around;
justify-content: center;
box-sizing: border-box;
padding: 0 30px;
.rightArrow {
width: 40px;
height: 38px;
margin: 0 12px;
}
}
.content2 {
@ -158,12 +163,13 @@
.topbox {
width: 100%;
height: 184px;
height: 200px;
}
.bottombox {
width: 100%;
height: 384px;
// height: 384px;
height: 200px;
}
.bottomArrow {
@ -215,9 +221,9 @@
}
.selectedimg {
box-shadow: 0px 0px 8px #FF4B65;
border: 1px solid #FF4B65;
background: #3f213b;
// box-shadow: 0px 0px 8px #FF4B65;
// border: 1px solid #FF4B65;
// background: #3f213b;
img {
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) { }
ngOnInit(): void {
console.log(this.data)
// console.log(this.data)
}
lookImg(url) {
if (url) {
@ -32,8 +32,10 @@ export class OilUnloadingProcessComponent implements OnInit {
});
node.click();
}, 0);
}else{
} else {
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 = {
id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
@ -256,10 +256,10 @@ export class TodayWarningAdminComponent implements OnInit {
let body = {
id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
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 = {
id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
@ -203,10 +203,10 @@ export class TodayWarningComponent implements OnInit {
let body = {
id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
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>
</div>
<nz-radio-group *ngIf="!data2.handleTime" class="radiobox" [(ngModel)]="radioValue"
(ngModelChange)="ngModelChange($event)">
<label nz-radio nzValue="A">维保</label>
<label nz-radio nzValue="B">报废</label>
</nz-radio-group>
<p *ngIf="!data2.handleTime && !isScrap" style="color: green;text-align: center;margin-top: 12px;">维保<span
*ngIf="data2.numberOfTimes == 2">临期预警</span><span *ngIf="data2.numberOfTimes == 3">逾期预警</span>
</p>
<p *ngIf="!data2.handleTime && isScrap" style="color: red;text-align: center;margin-top: 12px;">报废<span
*ngIf="data2.numberOfTimes == 2">临期预警</span><span *ngIf="data2.numberOfTimes == 3">逾期预警</span>
</p>
<p *ngIf="data2.handleTime && (isScraped == '维保' || isScraped == '报废')" style="text-align: center;color: #91CCFF;">
<br>
<span *ngIf="isScraped == '维保'" style="color: green;">已处置<br></span>
<span *ngIf="isScraped == '报废'" style="color: red;">已处置<br></span>
<span>器材名称:{{newdata.name}}</span><br>
<span *ngIf="isScraped == '维保'" style="color: green;">处置方式:维保<br></span>
<span *ngIf="isScraped == '报废'" style="color: red;">处置方式:报废<br></span>
<span>处置时间:{{data2.handleTime | date:"yyyy-MM-dd HH:mm:ss"}}<br></span>
<span>规格:{{newdata.specification}}<br></span>
<span>购入时间:{{newdata.purchaseDate | date:"yyyy-MM-dd"}}<br></span>
<span>生产时间:{{newdata.productionDate | date:"yyyy-MM-dd"}}<br></span>
<span>存放地点:{{newdata.storageLocation}}<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>
</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">
<div *ngIf=" !data2.handleTime && !isScrap">
<p>消防器材名称</p>
@ -33,28 +43,28 @@
</nz-input-group>
</nz-form-control>
</nz-form-item>
<p>规格</p>
<p>存放地点</p>
<nz-form-item>
<nz-form-control>
<nz-input-group>
<input [(ngModel)]="data2.violatedItemSnapshotObj.specification" nz-input type="text"
formControlName="specification" placeholder="请输入规格" />
<input [(ngModel)]="data2.violatedItemSnapshotObj.storageLocation" nz-input type="text"
formControlName="storageLocation" placeholder="请输入存放地点" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<p>购入日期</p>
<p>生产日期</p>
<nz-form-item>
<nz-form-control>
<nz-date-picker [nzAllowClear]="false" [(ngModel)]="data2.violatedItemSnapshotObj.purchaseDate"
formControlName="buytime" nzPlaceHolder="请输入购入日期">
<nz-date-picker [nzAllowClear]="false" [(ngModel)]="data2.violatedItemSnapshotObj.productionDate"
formControlName="productionDate" nzPlaceHolder="请输入生产日期">
</nz-date-picker>
</nz-form-control>
</nz-form-item>
<p>生产日期</p>
<p>下次维保日期</p>
<nz-form-item>
<nz-form-control>
<nz-date-picker [nzAllowClear]="false" [(ngModel)]="data2.violatedItemSnapshotObj.productionDate"
formControlName="prodtime" nzPlaceHolder="请输入生产日期">
<nz-date-picker [nzAllowClear]="false" [(ngModel)]="data2.violatedItemSnapshotObj.maintenanceDate"
formControlName="maintenanceDate" nzPlaceHolder="请输入下次维保日期">
</nz-date-picker>
</nz-form-control>
</nz-form-item>
@ -62,12 +72,11 @@
<nz-form-item>
<nz-form-control>
<nz-date-picker [nzAllowClear]="false" [(ngModel)]="data2.violatedItemSnapshotObj.validityEndTime"
formControlName="validitytime" nzPlaceHolder="有效期至">
formControlName="validityEndTime" nzPlaceHolder="有效期至">
</nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div class="btnbox" *ngIf="!data2.handleTime">
<button nz-button type="submit" class="ok" (click)="ok()">确定</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"
data2
copydata2
isScrap
isScraped
newdata
ngOnInit(): void {
this.data2 = 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) {
let params = {
Id: this.data2.violatedItemSnapshotObj.id
@ -38,14 +41,20 @@ export class DisposeequipmentComponent implements OnInit {
this.isScraped = '维保'
}
})
}else{
if(this.data2.desc == '维保'){
this.isScrap = false
}else{
this.isScrap = true
}
}
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
specification: [null, [Validators.required]],
buytime: [null, [Validators.required]],
prodtime: [null, [Validators.required]],
validitytime: [null, [Validators.required]]
storageLocation: [null, [Validators.required]],
productionDate: [null, [Validators.required]],
maintenanceDate: [null, [Validators.required]],
validityEndTime: [null, [Validators.required]]
});
@ -57,13 +66,4 @@ export class DisposeequipmentComponent implements OnInit {
ok() {
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;
text-overflow:ellipsis;">序号</span>
</div>
<div nz-col nzSpan="3">
<div nz-col nzSpan="2">
预警类别
</div>
<div nz-col nzSpan="4">
<div nz-col nzSpan="3">
预警内容
</div>
<div nz-col nzSpan="3">
公司名称
</div>
<div nz-col nzSpan="3">
<div nz-col nzSpan="5">
区域名称
</div>
<div nz-col nzSpan="3">
@ -134,7 +134,7 @@
<div nz-col nzSpan="1">
<span style="margin-left: 20px;">{{key+1}}</span>
</div>
<div nz-col nzSpan="3">
<div nz-col nzSpan="2">
<ng-container *ngIf="item.numberOfTimes; else elseTemplate">
<span *ngIf="item.numberOfTimes == 1">办理提醒</span>
<span *ngIf="item.numberOfTimes == 2">临期提醒</span>
@ -144,7 +144,7 @@
逾期报警
</ng-template>
</div>
<div nz-col nzSpan="4">
<div nz-col nzSpan="3">
<ng-container *ngIf="item.numberOfTimes; else elseTemplate2">
<span *ngIf="item.numberOfTimes == 1">{{item.desc}}办理提醒</span>
<span *ngIf="item.numberOfTimes == 2">{{item.desc}}临期提醒</span>
@ -154,13 +154,13 @@
消防设备逾期报警
</ng-template>
</div>
<div nz-col nzSpan="3">
<div nz-col nzSpan="3" [title]="item.gasStation.companyName">
{{item.gasStation.companyName ? item.gasStation.companyName : '/'}}
</div>
<div nz-col nzSpan="3">
<div nz-col nzSpan="5" [title]="item.gasStation.locationName">
{{item.gasStation.locationName ? item.gasStation.locationName : '/'}}
</div>
<div nz-col nzSpan="3">
<div nz-col nzSpan="3" [title]="item.gasStation.stationName">
{{item.gasStation.stationName ? item.gasStation.stationName : '/'}}
</div>
<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) {
console.log('echarts信息', data)
// console.log('echarts信息', data)
//饼图
let totalCount = 0
data.violationList.forEach(element => {
@ -539,7 +539,7 @@ export class WarningStatisticsListComponent implements OnInit {
}
let ViolationIds = []
console.log(456, this.validateForm.value)
// console.log(456, this.validateForm.value)
if (this.validateForm.value.eventSystemName) {
ViolationIds.push(this.validateForm.value.eventSystemName)
} else {
@ -587,7 +587,7 @@ export class WarningStatisticsListComponent implements OnInit {
this.validateForm.controls[key].markAsPristine();
this.validateForm.controls[key].updateValueAndValidity();
}
console.log('赋值日期', [this.startdate, this.enddate])
// console.log('赋值日期', [this.startdate, this.enddate])
this.validateForm.patchValue({
datePicker: [this.startdate, this.enddate],
eventSystemName: null,
@ -629,7 +629,7 @@ export class WarningStatisticsListComponent implements OnInit {
},
nzFooter: null,
nzOnOk: async () => {
console.log(99999, instance.content)
// console.log(99999, instance.content)
}
});
const instance = modal.getContentComponent();
@ -663,10 +663,10 @@ export class WarningStatisticsListComponent implements OnInit {
let body = {
id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name,
specification: instance.copydata2.violatedItemSnapshotObj.specification,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.copydata2.violatedItemSnapshotObj.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation,
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'),
isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
@ -690,10 +690,10 @@ export class WarningStatisticsListComponent implements OnInit {
let body = {
id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: moment(instance.validateForm.value.prodtime).format('yyyy-MM-DD'),
purchaseDate: moment(instance.validateForm.value.buytime).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validitytime).format('yyyy-MM-DD'),
storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId
}
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {

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

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

14
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 { Router, ActivatedRoute } from '@angular/router'
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';
@ -15,7 +13,7 @@ import { NzMessageService } from 'ng-zorro-antd/message';
export class TabbarComponent implements OnInit {
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService,
private cookieService: CookieService, private message: NzMessageService) { }
private message: NzMessageService) { }
surname: string
userName: string
isGasStation: string
@ -24,15 +22,15 @@ export class TabbarComponent implements OnInit {
this.getTime()
}, 1000);
this.isGasStation = JSON.parse(sessionStorage.getItem('isGasStation'))
if(this.isGasStation == 'true'){
if (this.isGasStation == 'true') {
this.surname = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).name
this.userName = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).userName
}else{
} else {
this.surname = JSON.parse(sessionStorage.getItem('userdata')).name
this.userName = JSON.parse(sessionStorage.getItem('userdata')).userName
}
}
//获得时间
@ -69,8 +67,6 @@ export class TabbarComponent implements OnInit {
// window.localStorage.clear()
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'])
}

Loading…
Cancel
Save