From 48834be9d45c5f3c86daedffc16ad5301bd0d052 Mon Sep 17 00:00:00 2001 From: qq55341701 <55341701@qq.com> Date: Mon, 21 Mar 2022 15:14:28 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=BF=AE=E6=94=B9=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/http-interceptors/base-interceptor.ts | 11 ++++++----- src/app/pages/login/login.component.ts | 10 ++++++++-- src/app/service/cache-token.service.ts | 2 ++ .../analysis-of-the-host.component.html | 8 +++++--- .../analysis-of-the-host.component.scss | 3 +++ .../analysis-of-the-host.component.ts | 2 +- .../host-config/host-config.component.html | 5 ++++- .../host-config/host-config.component.ts | 7 +++++++ .../image-label2/image-label2.component.html | 13 +++++++++++++ .../image-label2/image-label2.component.scss | 18 ++++++++++++++++++ .../image-label2/image-label2.component.ts | 17 +++++++++++++++++ .../navigation/navigation.component.html | 3 ++- .../system-management-routing.module.ts | 2 ++ .../system-management.module.ts | 3 ++- 14 files changed, 90 insertions(+), 14 deletions(-) create mode 100644 src/app/system-management/image-label2/image-label2.component.html create mode 100644 src/app/system-management/image-label2/image-label2.component.scss create mode 100644 src/app/system-management/image-label2/image-label2.component.ts diff --git a/src/app/http-interceptors/base-interceptor.ts b/src/app/http-interceptors/base-interceptor.ts index 37d33a3..38024df 100644 --- a/src/app/http-interceptors/base-interceptor.ts +++ b/src/app/http-interceptors/base-interceptor.ts @@ -52,7 +52,7 @@ export class BaseInterceptor implements HttpInterceptor { private handleError(error: HttpErrorResponse) { console.log('http错误', error) // 用户认证失败返回登录页 - if (error.status === 401 || error.status === 614) { + if (error.status === 401) { this.token.delete() sessionStorage.clear() localStorage.removeItem("isautologin") @@ -73,11 +73,12 @@ export class BaseInterceptor implements HttpInterceptor { // 服务端返回http状态码 // 服务端返回错误信息 console.error( - `Backend returned code ${error.status}, ` + - `body was: ${error.error}`); + `状态码${error.status}, ` + + `错误内容:${error.error}`); } // 返回带有面向用户的错误信息 - return throwError( - error); + return throwError(() => { + new Error('error') + }); }; } diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index 2d77fd6..e9a9518 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -99,8 +99,9 @@ export class LoginComponent implements OnInit { this.http.post('/api/Accounts/SignIn', { username: this.validateForm.value.userName, password: this.validateForm.value.password - }).subscribe( - (data: any) => { + }).subscribe({ + next: (data: any) => { + // this.isLoading = false; console.log('登录信息', data) this.rememberInfo() this.autoLogin() @@ -111,7 +112,12 @@ export class LoginComponent implements OnInit { //调用服务中的function刷新token this.token.startUp() + }, + error: (err) => { + this.isLoading = false; } + } + ) } diff --git a/src/app/service/cache-token.service.ts b/src/app/service/cache-token.service.ts index fb466be..f910f6b 100644 --- a/src/app/service/cache-token.service.ts +++ b/src/app/service/cache-token.service.ts @@ -20,10 +20,12 @@ export class CacheTokenService { token: token, refreshToken: refreshToken }).subscribe((data: any) => { + console.log('定时刷新token成功') sessionStorage.setItem("token", data.token); sessionStorage.setItem("refreshToken", data.refreshToken); }) }, 18 * 60 * 1000) + console.log('启动定时刷新token') } diff --git a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html index 2aa0f99..f98d2a4 100644 --- a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html +++ b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html @@ -37,13 +37,13 @@
- {{selectedOilStation ? selectedOilStation.displayName : '加油站'}} 分析主机列表 + {{selectedOilStation ? selectedOilStation.displayName : '加油站'}} 边缘盒子列表 (请从左侧选择加油站)
+ nzTheme="outline">新增边缘盒子
@@ -51,16 +51,18 @@ ip + 配置状态 操作 {{data.hostIPAddress}} + !配置状态! 编辑 配置 - 删除 + 删除 diff --git a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.scss b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.scss index d7597fc..4a8ae75 100644 --- a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.scss +++ b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.scss @@ -95,3 +95,6 @@ margin-top: 16px; } +.red:hover{ + color: red; +} \ No newline at end of file diff --git a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts index a3e82fa..4e8ba17 100644 --- a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts +++ b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts @@ -85,7 +85,7 @@ export class AnalysisOfTheHostComponent implements OnInit { } - //新增分析主机 + //新增边缘盒子 addHost() { console.log(this.selectedOilStation) const modal = this.modal.create({ diff --git a/src/app/system-management/host-config/host-config.component.html b/src/app/system-management/host-config/host-config.component.html index d6d17c7..9147e54 100644 --- a/src/app/system-management/host-config/host-config.component.html +++ b/src/app/system-management/host-config/host-config.component.html @@ -14,6 +14,7 @@ 密码 地址 类型 + 标注情况 操作 @@ -24,15 +25,17 @@ {{ item.password }} {{ item.uri }} {{ item.type | cameraType}} + 标注情况 编辑 + 标注 删除
diff --git a/src/app/system-management/host-config/host-config.component.ts b/src/app/system-management/host-config/host-config.component.ts index 96fe572..61b577e 100644 --- a/src/app/system-management/host-config/host-config.component.ts +++ b/src/app/system-management/host-config/host-config.component.ts @@ -132,6 +132,11 @@ export class HostConfigComponent implements OnInit { }); } + label(item){ + this.router.navigate(['/system/host/camera/imageLabel']) + } + + connect() { let ids = [] this.listOfData.forEach((item: any) => { @@ -142,10 +147,12 @@ export class HostConfigComponent implements OnInit { }).subscribe({ next: (data) => { console.log('连接状态', data) + this.router.navigate(['/system/host/camera/imageList']) }, error: (err) => { console.log('连接失败', err) }, + // complete: () => console.log('complete!'), // not called }) diff --git a/src/app/system-management/image-label2/image-label2.component.html b/src/app/system-management/image-label2/image-label2.component.html new file mode 100644 index 0000000..2712564 --- /dev/null +++ b/src/app/system-management/image-label2/image-label2.component.html @@ -0,0 +1,13 @@ +
+ +
+ + + + + +
+
+ +
+
diff --git a/src/app/system-management/image-label2/image-label2.component.scss b/src/app/system-management/image-label2/image-label2.component.scss new file mode 100644 index 0000000..f963bf6 --- /dev/null +++ b/src/app/system-management/image-label2/image-label2.component.scss @@ -0,0 +1,18 @@ +.box { + width: 100%; + height: 100%; + background: #fff; + font-size: 15px; + color: black; + box-sizing: border-box; + display: flex; + flex-direction: column; + overflow-y: auto; +} +.btnbox{ + display: flex; + margin-bottom: 8px; + button{ + margin-right: 6px; + } +} \ No newline at end of file diff --git a/src/app/system-management/image-label2/image-label2.component.ts b/src/app/system-management/image-label2/image-label2.component.ts new file mode 100644 index 0000000..bbb3c99 --- /dev/null +++ b/src/app/system-management/image-label2/image-label2.component.ts @@ -0,0 +1,17 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-image-label2', + templateUrl: './image-label2.component.html', + styleUrls: ['./image-label2.component.scss'] +}) +export class ImageLabel2Component implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + goback() { + history.go(-1) + } +} diff --git a/src/app/system-management/navigation/navigation.component.html b/src/app/system-management/navigation/navigation.component.html index acd8789..910bb9e 100644 --- a/src/app/system-management/navigation/navigation.component.html +++ b/src/app/system-management/navigation/navigation.component.html @@ -14,7 +14,8 @@ diff --git a/src/app/system-management/system-management-routing.module.ts b/src/app/system-management/system-management-routing.module.ts index d409b8d..0456bd3 100644 --- a/src/app/system-management/system-management-routing.module.ts +++ b/src/app/system-management/system-management-routing.module.ts @@ -5,6 +5,7 @@ import { AnalysisOfTheHostComponent } from './analysis-of-the-host/analysis-of-t import { HostConfigComponent } from './host-config/host-config.component'; import { ImageListComponent } from './image-list/image-list.component'; import { PlottingImageComponent } from './plotting-image/plotting-image.component'; +import { ImageLabel2Component } from './image-label2/image-label2.component'; const routes: Routes = [ @@ -12,6 +13,7 @@ const routes: Routes = [ { path: 'host', component: AnalysisOfTheHostComponent }, { path: 'host/camera', component: HostConfigComponent }, { path: 'host/camera/imageList', component: ImageListComponent }, + { path: 'host/camera/imageLabel', component: ImageLabel2Component }, { path: 'plottingImage', component: PlottingImageComponent }, ]; diff --git a/src/app/system-management/system-management.module.ts b/src/app/system-management/system-management.module.ts index cfe2c66..599a8f2 100644 --- a/src/app/system-management/system-management.module.ts +++ b/src/app/system-management/system-management.module.ts @@ -32,9 +32,10 @@ import { PlottingImageComponent } from './plotting-image/plotting-image.componen import { cameraType } from '../pipe/cameraTypePipe'; import { ImageListComponent } from './image-list/image-list.component'; import { ImageLabelComponent } from './image-label/image-label.component'; +import { ImageLabel2Component } from './image-label2/image-label2.component'; @NgModule({ - declarations: [OrganizationComponent, NavigationComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, HostConfigComponent, ImageListComponent, ImageLabelComponent, PlottingImageComponent, cameraType], + declarations: [OrganizationComponent, NavigationComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, HostConfigComponent, ImageListComponent, ImageLabelComponent, PlottingImageComponent, cameraType, ImageLabel2Component], imports: [ CommonModule, SystemRoutingModule,