Compare commits

...

35 Commits

Author SHA1 Message Date
邵佳豪 35d3a8a67c [完善]证照资质预警过滤 1 month ago
邵佳豪 a6888a1b63 [完善]中台登录错误参数下载 4 months ago
邵佳豪 e3a63bdab9 [完善]预警处置后赋值处置人 5 months ago
邵佳豪 bc21575204 [新增]机构更改父组织 5 months ago
邵佳豪 2dd4ac1ff2 [完善]中台登录用户隐藏右上角按钮 5 months ago
邵佳豪 9df04beb8b [完善]综合统计页面 5 months ago
邵佳豪 e6969318e9 [完善]综合统计顶部菜单显示 5 months ago
邵佳豪 6d868d46d8 [完善]综合统计页面 5 months ago
邵佳豪 647cac21c2 [新增]综合统计 5 months ago
邵佳豪 8d0f3c1ed1 [完善]新增页面 6 months ago
邵佳豪 9070556c7c [新增]打包配置 6 months ago
邵佳豪 eca559d138 [完善]中台油站用户登录完善 6 months ago
邵佳豪 d5dd9ec2b5 [新增]识别类型 6 months ago
邵佳豪 15340ce75e [修改]预警声音修改 6 months ago
邵佳豪 9321f29ad1 [新增]resId增加 7 months ago
邵佳豪 697f701d5f [新增]多组织机构获取 7 months ago
邵佳豪 9747d866ea [完善]选择用户按钮 7 months ago
邵佳豪 0779b377a4 [新增]中台组织机构绑定 7 months ago
邵佳豪 c2237a44d6 [完善]中台对接 7 months ago
邵佳豪 ebc4346ef0 [完善]中台筛选条件 7 months ago
邵佳豪 82a47e7b52 [新增]中台用户绑定 7 months ago
邵佳豪 7500b9da8f [完善]反向代理 7 months ago
邵佳豪 462733e9ca [完善]%3D处理 7 months ago
邵佳豪 a599173713 [新增]中台跳转 7 months ago
邵佳豪 3734779800 [新增]中台对接 7 months ago
邵佳豪 4a41bfafc0 [新增]中台登录配合修改 7 months ago
邵佳豪 3bfc6a47cb [新增]延长壳牌工装 8 months ago
邵佳豪 eef70064e8 [完善]更新时间 9 months ago
邵佳豪 9ca4e6a7d8 [完善]更新预警播报声音 10 months ago
邵佳豪 cfb5c9c13a [完善]修改默认密码弹出逻辑+发送短信按钮bug 12 months ago
邵佳豪 065b41de17 [新增]预警图片查看大图 1 year ago
邵佳豪 1722ad6151 [完善]新增预警类型 1 year ago
邵佳豪 59df72222f [新增]判断是否singleSignOn决定查询日期区间 1 year ago
邵佳豪 f8cebca2c8 [新增]免登录设置 1 year ago
邵佳豪 b7a1357c9b [完善]密码最小长度12位 1 year ago
  1. 9
      angular.json
  2. 16787
      package-lock.json
  3. 10
      proxy.config.json
  4. 63
      src/app/app-routing.module.ts
  5. 2
      src/app/app.component.ts
  6. 107
      src/app/auth.guard.ts
  7. 100
      src/app/http-interceptors/base-interceptor.ts
  8. 14
      src/app/pages/audit/audit-ing/audit-ing.component.ts
  9. 494
      src/app/pages/audit/audit-record/audit-record.component.ts
  10. 4
      src/app/pages/change-password/change-password.component.ts
  11. 328
      src/app/pages/home-page-comprehensive/home-page-comprehensive.component.html
  12. 578
      src/app/pages/home-page-comprehensive/home-page-comprehensive.component.scss
  13. 1786
      src/app/pages/home-page-comprehensive/home-page-comprehensive.component.ts
  14. 10
      src/app/pages/home-page/home-page.component.html
  15. 14
      src/app/pages/home-page/home-page.component.ts
  16. 64
      src/app/pages/home/home.component.html
  17. 50
      src/app/pages/home/home.component.scss
  18. 215
      src/app/pages/home/home.component.ts
  19. 205
      src/app/pages/login/forget/forget.component.ts
  20. 43
      src/app/pages/login/login.component.html
  21. 453
      src/app/pages/login/login.component.ts
  22. 515
      src/app/pages/oil-station-info/oil-station-info.component.ts
  23. 10
      src/app/pages/oil-unloading-process/anxin-img-look/anxin-img-look.component.ts
  24. 109
      src/app/pages/pages-routing.module.ts
  25. 4
      src/app/pages/pages.module.ts
  26. 14
      src/app/pages/plan-admin/file-license-list/file-license-list.component.ts
  27. 226
      src/app/pages/plan-admin/plan-admin.component.ts
  28. 17
      src/app/pages/plan-admin/update-license-list/update-license-list.component.ts
  29. 1239
      src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts
  30. 1140
      src/app/pages/records/criminal-records/criminal-records.component.ts
  31. 37
      src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts
  32. 109
      src/app/pages/records/records-nav/records-nav.component.ts
  33. 1013
      src/app/pages/records/warning-statistics-list/warning-statistics-list.component.ts
  34. 0
      src/app/pages/singlelogin/singlelogin.component.html
  35. 0
      src/app/pages/singlelogin/singlelogin.component.scss
  36. 405
      src/app/pages/singlelogin/singlelogin.component.ts
  37. 583
      src/app/pages/today-warning-admin/today-warning-admin.component.ts
  38. 7
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html
  39. 52
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts
  40. 7
      src/app/pages/today-warning/today-warning.component.ts
  41. 9
      src/app/service/pattern.service.ts
  42. 7
      src/app/service/tree.service.ts
  43. 21
      src/app/system-management/algorithm-config/algorithm-config.component.ts
  44. 384
      src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts
  45. 2
      src/app/system-management/navigation/navigation.component.html
  46. 2
      src/app/system-management/navigation/navigation.component.scss
  47. 16
      src/app/system-management/navigation/navigation.component.ts
  48. 35
      src/app/system-management/or-binding/or-binding-model/or-binding-model.component.html
  49. 76
      src/app/system-management/or-binding/or-binding-model/or-binding-model.component.scss
  50. 128
      src/app/system-management/or-binding/or-binding-model/or-binding-model.component.ts
  51. 56
      src/app/system-management/or-binding/or-binding.component.html
  52. 168
      src/app/system-management/or-binding/or-binding.component.scss
  53. 156
      src/app/system-management/or-binding/or-binding.component.ts
  54. 4
      src/app/system-management/organization/change-or/change-or.component.html
  55. 5
      src/app/system-management/organization/change-or/change-or.component.scss
  56. 55
      src/app/system-management/organization/change-or/change-or.component.ts
  57. 9
      src/app/system-management/organization/organization.component.html
  58. 84
      src/app/system-management/organization/organization.component.ts
  59. 4
      src/app/system-management/system-management-routing.module.ts
  60. 15
      src/app/system-management/system-management.module.ts
  61. 113
      src/app/system-management/user-binding/binding/binding.component.html
  62. 223
      src/app/system-management/user-binding/binding/binding.component.scss
  63. 208
      src/app/system-management/user-binding/binding/binding.component.ts
  64. 101
      src/app/system-management/user-binding/user-binding.component.html
  65. 173
      src/app/system-management/user-binding/user-binding.component.scss
  66. 106
      src/app/system-management/user-binding/user-binding.component.ts
  67. 122
      src/app/system-management/user/adduser/adduser.component.ts
  68. 276
      src/app/system-management/user/edituser/edituser.component.ts
  69. 16
      src/app/system-management/user/user.component.html
  70. 38
      src/app/system-management/user/user.component.ts
  71. BIN
      src/assets/sound/chouyan.mp3
  72. BIN
      src/assets/sound/chuangru.mp3
  73. BIN
      src/assets/sound/dadianhua.mp3
  74. BIN
      src/assets/sound/gongzhuang.mp3
  75. BIN
      src/assets/sound/jinchukou.mp3
  76. BIN
      src/assets/sound/minghuo.mp3
  77. BIN
      src/assets/sound/xychaichuxyguan.mp3
  78. BIN
      src/assets/sound/xygeli.mp3
  79. BIN
      src/assets/sound/xyjianxie.mp3
  80. BIN
      src/assets/sound/xyjiedi.mp3
  81. BIN
      src/assets/sound/xymiehuoqi.mp3
  82. BIN
      src/assets/sound/xywuren.mp3
  83. BIN
      src/assets/sound/xyxianchang.mp3
  84. BIN
      src/assets/sound/xyxieyouguan.mp3
  85. BIN
      src/assets/sound/yanwu.mp3
  86. 61
      src/styles.scss
  87. 18
      src/theme.less

9
angular.json

@ -18,6 +18,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"baseHref": "/",
"outputPath": "dist/anxin119",
"index": "src/index.html",
"main": "src/main.ts",
@ -130,9 +131,7 @@
"output": "/assets/abp"
}
],
"styles": [
"src/styles.scss"
],
"styles": ["src/styles.scss"],
"scripts": [
"node_modules/@aspnet/signalr/dist/browser/signalr.min.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/abp.js"
@ -147,9 +146,7 @@
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
"exclude": ["**/node_modules/**"]
}
},
"e2e": {

16787
package-lock.json generated

File diff suppressed because it is too large Load Diff

10
proxy.config.json

@ -1,16 +1,22 @@
{
"/api": {
"target": "http://121.36.37.70:8906/",
"target": "https://znaq.sinochemoilmarketing.com/",
"测试1": "http://121.36.37.70:8906/",
"测试2": "https://znaq.sinochemoilmarketing.com/",
"测试3": "https://gas.anxincloud.cn/",
"中台": "http://10.156.134.54:8906/",
"secure": false,
"changeOrigin": true
},
"/signalr": {
"target": "http://121.36.37.70:8906/",
"target": "https://znaq.sinochemoilmarketing.com/",
"secure": false,
"ws": true,
"logLevel": "debug"
},
"/sagframe-portal": {
"target": "https://uat-uomsp.sinochemoilmarketing.com/",
"secure": false,
"changeOrigin": true
}
}

63
src/app/app-routing.module.ts

@ -1,35 +1,52 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './pages/login/login.component';
import { RegisterComponent } from './pages/register/register.component';
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { LoginComponent } from "./pages/login/login.component";
import { RegisterComponent } from "./pages/register/register.component";
//路由守卫
import { AuthGuard } from './auth.guard'
import { HomeComponent } from './pages/home/home.component';
import { NavigationComponent } from './system-management/navigation/navigation.component';
import { HomePageNologinComponent } from './pages/home-page-nologin/home-page-nologin.component';
import { AuthGuard } from "./auth.guard";
import { HomeComponent } from "./pages/home/home.component";
import { NavigationComponent } from "./system-management/navigation/navigation.component";
import { HomePageNologinComponent } from "./pages/home-page-nologin/home-page-nologin.component";
import { SingleloginComponent } from "./pages/singlelogin/singlelogin.component";
const routes: Routes = [
{ path: '', redirectTo: 'login', pathMatch: 'full' },
{ path: 'login', component: LoginComponent }, //登录页
{ path: 'register', component: RegisterComponent }, //注册页
{ path: '', redirectTo: 'singlelogin', pathMatch: 'full' },
{ path: "singlelogin", component: SingleloginComponent }, //单点登录页
{ path: "login", component: LoginComponent }, //登录页
{ path: "register", component: RegisterComponent }, //注册页
// { path: 'homepagenologin', component: HomePageNologinComponent }, //注册页
{
path: '', component: HomeComponent, canActivate: [AuthGuard], children: [
{ path: '', loadChildren: () => import('./pages/pages.module').then(m => m.PagesModule) }
]
path: "",
component: HomeComponent,
canActivate: [AuthGuard],
children: [
{
path: "",
loadChildren: () =>
import("./pages/pages.module").then((m) => m.PagesModule),
},
],
}, //首页
{
path: '', component: NavigationComponent, canActivate: [AuthGuard], children: [
{ path: 'system', loadChildren: () => import('./system-management/system-management.module').then(m => m.SystemManagementModule) }
]
}//系统管理
path: "",
component: NavigationComponent,
canActivate: [AuthGuard],
children: [
{
path: "system",
loadChildren: () =>
import("./system-management/system-management.module").then(
(m) => m.SystemManagementModule
),
},
],
}, //系统管理
];
@NgModule({
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
exports: [RouterModule]
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: "legacy" })],
exports: [RouterModule],
})
export class AppRoutingModule { }
export class AppRoutingModule {}

2
src/app/app.component.ts

@ -19,7 +19,7 @@ export class AppComponent {
public token: CacheTokenService,
private notificationService: NzNotificationService
) {}
VERSION = 20230807;
VERSION = 20240822;
ngOnInit(): void {
this.sayHello();
}

107
src/app/auth.guard.ts

@ -1,35 +1,100 @@
import { Component, OnInit, Inject } from '@angular/core';
import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
import { HttpClient } from "@angular/common/http";
import { Component, OnInit, Inject } from "@angular/core";
import { Injectable } from "@angular/core";
import {
CanActivate,
ActivatedRouteSnapshot,
RouterStateSnapshot,
Router,
} from "@angular/router";
@Injectable({
providedIn: 'root'
providedIn: "root",
})
export class AuthGuard implements CanActivate {
constructor(private http: HttpClient, private router: Router) {}
constructor(private router: Router) {
// 路由守卫
async canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot
): Promise<boolean> {
console.log("路由守卫", next);
if (
next.queryParams.singleSignOn &&
next.queryParams.singleSignOn === "true"
) {
sessionStorage.setItem("singleSignOn", "true");
await this.autoLogin();
}
return this.checkLogin();
}
// 路由守卫
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
// console.log('路由守卫',next.data)
// if(next.data.permission == 'xxxx'){
// return true;
// }
return this.checkLogin();
checkLogin(): boolean {
// 判断本地有没有token
const token = sessionStorage.getItem("token");
// 如果有token,允许访问
if (token) {
return true;
}
checkLogin(): boolean {
// 判断本地有没有token
const token = sessionStorage.getItem('token');
//如果没有token,跳转登录页
// this.router.navigate(["/login"]);
// 如果有token,允许访问
if (token) { return true; }
return false;
}
autoLogin() {
return new Promise<void>((resolve, reject) => {
this.http
.post("/api/TokenAuth/Authenticate", {
userNameOrEmailAddress: "admin",
password: "Admin119119119",
})
.subscribe(
(data: any) => {
sessionStorage.setItem("token", data.result.accessToken);
sessionStorage.setItem(
"encryptedAccessToken",
data.result.encryptedAccessToken
);
this.http
.get("/api/services/app/Session/GetCurrentLoginInformations")
.subscribe(
async (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)
);
sessionStorage.setItem("isGasStation", "false");
resolve();
},
(err) => {
reject();
}
);
},
(err) => {
reject();
}
);
});
}
//如果没有token,跳转登录页
this.router.navigate(['/login']);
return false;
}
}

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

@ -1,24 +1,27 @@
import { Injectable } from '@angular/core';
import { Injectable } from "@angular/core";
import {
HttpClient, HttpInterceptor, HttpHandler, HttpRequest,
HttpClient,
HttpInterceptor,
HttpHandler,
HttpRequest,
HttpErrorResponse,
HttpResponse
} from '@angular/common/http';
HttpResponse,
} from "@angular/common/http";
import { throwError } from 'rxjs'
import { catchError, tap, finalize } from 'rxjs/operators';
import { Router } from '@angular/router'
import { NzMessageService } from 'ng-zorro-antd/message';
import { throwError } from "rxjs";
import { catchError, tap, finalize } from "rxjs/operators";
import { Router } from "@angular/router";
import { NzMessageService } from "ng-zorro-antd/message";
//baseurl
// const baseurl = 'http://39.106.78.171:8008';
@Injectable()
export class BaseInterceptor implements HttpInterceptor {
constructor(private router: Router, private message: NzMessageService) { }
constructor(private router: Router, private message: NzMessageService) {}
intercept(req, next: HttpHandler) {
// req.url = "/youzhan" + req.url;
// req.urlWithParams = "/youzhan" + req.urlWithParams;
let params = req.params;
for (const key of req.params.keys()) {
if (params.get(key) === undefined || params.get(key) === null) {
@ -33,36 +36,43 @@ export class BaseInterceptor implements HttpInterceptor {
});
if (!req.cancelToken) {
/*获取token*/
let token = sessionStorage.getItem("token")
let token = sessionStorage.getItem("token");
/*此处设置额外请求头,token令牌*/
if (!!token) {
newReq.headers = newReq.headers.set('Authorization', `Bearer ${token}`)
newReq.headers = newReq.headers.set("Authorization", `Bearer ${token}`);
}
}
// 携带请求头发送下一次请求
return next.handle(newReq)
.pipe(
tap(event => {
return next.handle(newReq).pipe(
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'))
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 => {
},
(error) => {
// 失败
console.log('请求http失败', error)
this.handleError(error)
}),
finalize(() => {
// 请求完成
// console.log('complete')
})
)
console.log("请求http失败", error);
this.handleError(error);
}
),
finalize(() => {
// 请求完成
// console.log('complete')
})
);
}
// 捕获错误
@ -71,39 +81,41 @@ export class BaseInterceptor implements HttpInterceptor {
private handleError(error: HttpErrorResponse) {
// 用户认证失败返回登录页
if (error.status === 401 || error.status === 614) {
sessionStorage.clear()
localStorage.removeItem("isautologin")
this.message.create('error', `用户认证信息过期,请重新登录!`);
this.router.navigate(['/login'])
sessionStorage.clear();
localStorage.removeItem("isautologin");
this.message.create("error", `用户认证信息过期,请重新登录!`);
this.router.navigate(["/singlelogin"]);
}
if (error.status === 403) {
this.message.create('error', `对不起,您无此权限!`);
this.message.create("error", `对不起,您无此权限!`);
}
if (error.status === 400) {
this.message.create('error', `请核对您的输入信息或格式是否正确!`);
this.message.create("error", `请核对您的输入信息或格式是否正确!`);
}
if (error.status === 500) {
if (error.error.error.message) {
this.message.create('error', `${error.error.error.details || error.error.error.message}`);
this.message.create(
"error",
`${error.error.error.details || error.error.error.message}`
);
} else {
this.message.create('error', `状态500`);
this.message.create("error", `状态500`);
}
}
if (error.status === 404) {
this.message.create('error', `${error.error.error.message}`);
this.message.create("error", `${error.error.error.message}`);
}
if (error.error instanceof ErrorEvent) {
// 发生客户端或网络错误。相应处理。
console.error('An error occurred:', error.error.error.message);
console.error("An error occurred:", error.error.error.message);
} else {
// 服务端返回http状态码
// 服务端返回错误信息
console.error(
`Backend returned code ${error.status}, ` +
`body was: ${error.error}`);
`Backend returned code ${error.status}, ` + `body was: ${error.error}`
);
}
// 返回带有面向用户的错误信息
return throwError(
error);
};
return throwError(error);
}
}

14
src/app/pages/audit/audit-ing/audit-ing.component.ts

@ -438,8 +438,10 @@ export class AuditIngComponent implements OnInit {
async getAllOrganization() {
let OrganizationUnitId = JSON.parse(sessionStorage.getItem("userdata"))
.organization.id;
let OrganizationUnitIds = JSON.parse(
sessionStorage.getItem("userdata")
).organizations.map((v) => v.id);
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true",
};
await new Promise((resolve, reject) => {
@ -449,8 +451,14 @@ export class AuditIngComponent implements OnInit {
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (element.id == OrganizationUnitId) {
element.parentId = null;
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(element.id)) {
element.parentId = null;
}
} else {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
}
element.key = element.id;
element.title = element.displayName;

494
src/app/pages/audit/audit-record/audit-record.component.ts

@ -1,42 +1,60 @@
import { HttpClient } from '@angular/common/http';
import { Component, ElementRef, OnInit, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { NzModalService } from 'ng-zorro-antd/modal';
import { Observable, fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { TreeService } from 'src/app/service/tree.service';
import { DetailsFileCategoryComponent } from '../../license/file-category/details-file-category/details-file-category.component';
import { DetailsUpdateCategoryComponent } from '../../license/update-category/details-update-category/details-update-category.component';
import { AuditDetailsInformTimeComponent } from '../audit-inform-time/audit-details-inform-time/audit-details-inform-time.component';
import { AppealDetailsComponent } from '../audit-ing/appeal-details/appeal-details.component';
import { UserDetailsComponent } from '../audit-ing/user-details/user-details.component';
import { GasBaseInfoComponent } from '../gas-base-info/gas-base-info.component';
import { HttpClient } from "@angular/common/http";
import { Component, ElementRef, OnInit, ViewContainerRef } from "@angular/core";
import { FormBuilder, FormGroup } from "@angular/forms";
import { NzModalService } from "ng-zorro-antd/modal";
import { Observable, fromEvent } from "rxjs";
import { debounceTime } from "rxjs/operators";
import { TreeService } from "src/app/service/tree.service";
import { DetailsFileCategoryComponent } from "../../license/file-category/details-file-category/details-file-category.component";
import { DetailsUpdateCategoryComponent } from "../../license/update-category/details-update-category/details-update-category.component";
import { AuditDetailsInformTimeComponent } from "../audit-inform-time/audit-details-inform-time/audit-details-inform-time.component";
import { AppealDetailsComponent } from "../audit-ing/appeal-details/appeal-details.component";
import { UserDetailsComponent } from "../audit-ing/user-details/user-details.component";
import { GasBaseInfoComponent } from "../gas-base-info/gas-base-info.component";
@Component({
selector: 'app-audit-record',
templateUrl: './audit-record.component.html',
styleUrls: ['./audit-record.component.scss']
selector: "app-audit-record",
templateUrl: "./audit-record.component.html",
styleUrls: ["./audit-record.component.scss"],
})
export class AuditRecordComponent implements OnInit {
validateForm!: FormGroup;
constructor(private element: ElementRef, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private toTree: TreeService, private http: HttpClient, private fb: FormBuilder) { }
constructor(
private element: ElementRef,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private toTree: TreeService,
private http: HttpClient,
private fb: FormBuilder
) {}
list = []
level = false
tableScrollHeight
resizeListener
startdate
enddate
list = [];
level = false;
tableScrollHeight;
resizeListener;
startdate;
enddate;
async ngOnInit(): Promise<void> {
if (JSON.parse(sessionStorage.getItem('userdata')).organization.level == 1) {
this.level = true
if (
JSON.parse(sessionStorage.getItem("userdata")).organization.level == 1
) {
this.level = true;
}
this.tableScrollHeight = '100px'
this.tableScrollHeight = "100px";
// 页面监听
this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => {
let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px'
});
this.resizeListener = fromEvent(window, "resize")
.pipe(debounceTime(100))
.subscribe((event) => {
let tableHeader =
this.element.nativeElement.querySelector(
`.ant-table-header`
).clientHeight;
this.tableScrollHeight =
document.getElementById("tablebox").clientHeight -
tableHeader -
10 +
"px";
});
this.validateForm = this.fb.group({
type: [null],
info: [null],
@ -50,172 +68,214 @@ export class AuditRecordComponent implements OnInit {
let nowY = myDate.getFullYear();
let nowM = myDate.getMonth() + 1;
let nowD = myDate.getDate();
this.enddate = nowY + "-" + (nowM < 10 ? "0" + nowM : nowM) + "-" + (nowD < 10 ? "0" + nowD : nowD);//当前日期
this.enddate =
nowY +
"-" +
(nowM < 10 ? "0" + nowM : nowM) +
"-" +
(nowD < 10 ? "0" + nowD : nowD); //当前日期
//获取三十天前日期
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 29);//最后一个数字30可改,30天的意思
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 29); //最后一个数字30可改,30天的意思
let lastY = lw.getFullYear();
let lastM = lw.getMonth() + 1;
let lastD = lw.getDate();
this.startdate = lastY + "-" + (lastM < 10 ? "0" + lastM : lastM) + "-" + (lastD < 10 ? "0" + lastD : lastD);//三十天之前日期
this.getTypeList()
await this.getAllOrganization()
this.getRecordList()
this.startdate =
lastY +
"-" +
(lastM < 10 ? "0" + lastM : lastM) +
"-" +
(lastD < 10 ? "0" + lastD : lastD); //三十天之前日期
this.getTypeList();
await this.getAllOrganization();
this.getRecordList();
this.warningType()
this.warningType();
}
ngOnDestroy(): void {
this.resizeListener.unsubscribe()
this.resizeListener.unsubscribe();
}
submitForm(): void {
if (this.validateForm.value.datePicker[0].toLocaleDateString) {
this.validateForm.value.datePicker[0] = this.validateForm.value.datePicker[0].toLocaleDateString()
this.validateForm.value.datePicker[0] =
this.validateForm.value.datePicker[0].toLocaleDateString();
}
if (this.validateForm.value.datePicker[1].toLocaleDateString) {
this.validateForm.value.datePicker[1] = this.validateForm.value.datePicker[1].toLocaleDateString()
this.validateForm.value.datePicker[1] =
this.validateForm.value.datePicker[1].toLocaleDateString();
}
this.list = []
this.SkipCount = '0'
this.getRecordList()
this.list = [];
this.SkipCount = "0";
this.getRecordList();
}
resetForm(e: MouseEvent): void {
e.preventDefault();
this.validateForm.reset();
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
organization: JSON.parse(sessionStorage.getItem("userdata")).organization
.id,
datePicker: [this.startdate, this.enddate],
});
this.list = []
this.SkipCount = '0'
this.getRecordList()
this.list = [];
this.SkipCount = "0";
this.getRecordList();
}
//获取所有组织机构
nodes: any = []
nodes: any = [];
async getAllOrganization() {
let OrganizationUnitId = JSON.parse(sessionStorage.getItem('userdata')).organization.id
let OrganizationUnitId = JSON.parse(sessionStorage.getItem("userdata"))
.organization.id;
let OrganizationUnitIds = JSON.parse(
sessionStorage.getItem("userdata")
).organizations?.map((v) => v.id);
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true"
}
IsContainsChildren: "true",
};
await new Promise((resolve, reject) => {
this.http.get('/api/services/app/Organization/GetAll', {
params: params
}).subscribe((data: any) => {
data.result.items.forEach(element => {
if (element.id == OrganizationUnitId) {
element.parentId = null
}
element.key = element.id
element.title = element.displayName
});
this.nodes = [...this.toTree.toTree(data.result.items)]
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
datePicker: [this.startdate, this.enddate],
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(element.id)) {
element.parentId = null;
}
} else {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
}
element.key = element.id;
element.title = element.displayName;
});
this.nodes = [...this.toTree.toTree(data.result.items)];
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem("userdata"))
.organization.id,
datePicker: [this.startdate, this.enddate],
});
resolve(data);
});
resolve(data)
})
})
});
}
//证照类型
typeLoading
typeList
typeLoading;
typeList;
typeListOfUsers
typeListOfStationData
typeListOfUpdate
typeListOfFile
typeListOfUsers;
typeListOfStationData;
typeListOfUpdate;
typeListOfFile;
getTypeList() {
this.typeLoading = true
let promiseArr = []
let api = ['/api/services/app/ValidityLicenseType/GetAll', '/api/services/app/FileLicenseType/GetAll']
api.forEach(element => {
this.typeLoading = true;
let promiseArr = [];
let api = [
"/api/services/app/ValidityLicenseType/GetAll",
"/api/services/app/FileLicenseType/GetAll",
];
api.forEach((element) => {
promiseArr.push(
new Promise((resolve, reject) => {
this.http.get(element, {
params: {
SkipCount: '0',
MaxResultCount: '999'
}
}).subscribe({
next: (data) => {
resolve(data)
},
error: err => {
reject(err)
}
})
this.http
.get(element, {
params: {
SkipCount: "0",
MaxResultCount: "999",
},
})
.subscribe({
next: (data) => {
resolve(data);
},
error: (err) => {
reject(err);
},
});
})
)
);
});
Promise.all(promiseArr).then((result) => {
// console.log('审批类型', result)
this.typeListOfUsers = [{ licenseName: '用户信息' }]
this.typeListOfStationData = [{ licenseName: '油站信息' }]
this.typeListOfUpdate = result[0].result.items
this.typeListOfFile = result[1].result.items
this.typeList = [...this.typeListOfUsers, ...this.typeListOfStationData, ...this.typeListOfUpdate, ...this.typeListOfFile]
this.typeLoading = false
}).catch((error) => {
})
Promise.all(promiseArr)
.then((result) => {
// console.log('审批类型', result)
this.typeListOfUsers = [{ licenseName: "用户信息" }];
this.typeListOfStationData = [{ licenseName: "油站信息" }];
this.typeListOfUpdate = result[0].result.items;
this.typeListOfFile = result[1].result.items;
this.typeList = [
...this.typeListOfUsers,
...this.typeListOfStationData,
...this.typeListOfUpdate,
...this.typeListOfFile,
];
this.typeLoading = false;
})
.catch((error) => {});
}
warningTypesDetails
warningTypesDetailsCopy
warningTypesDetails;
warningTypesDetailsCopy;
//获得所有预警事件
warningType() {
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => {
data.result = data.result.filter((item) => {
return item.eventSystemName != '设备报废临期提醒' && item.eventSystemName != '设备维保临期提醒' && item.eventSystemName != '证照有效期办理提醒' && item.eventSystemName != '证照有效期临期提醒' && item.eventSystemName != '证照年检办理提醒' && item.eventSystemName != '证照年检临期提醒'
})
this.http
.get("/api/services/app/Violation/GetAllList")
.subscribe((data: any) => {
data.result = data.result.filter((item) => {
return (
item.eventSystemName != "设备报废临期提醒" &&
item.eventSystemName != "设备维保临期提醒" &&
item.eventSystemName != "证照有效期办理提醒" &&
item.eventSystemName != "证照有效期临期提醒" &&
item.eventSystemName != "证照年检办理提醒" &&
item.eventSystemName != "证照年检临期提醒"
);
});
this.warningTypesDetails = JSON.parse(JSON.stringify(data.result))
this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)) //原始数据备份
// console.log('所有预警事件', this.warningTypesDetailsCopy)
})
this.warningTypesDetails = JSON.parse(JSON.stringify(data.result));
this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)); //原始数据备份
// console.log('所有预警事件', this.warningTypesDetailsCopy)
});
}
infoChange(e) {
if (e == '0') {
this.typeList = this.typeListOfStationData
} else if (e == '1') {
this.typeList = this.typeListOfUpdate
} else if (e == '2') {
this.typeList = this.typeListOfUpdate
} else if (e == '3') {
this.typeList = this.typeListOfFile
} else if (e == '4') {
this.typeList = this.typeListOfUsers
} else if (e == '5') {
this.typeList = [...this.warningTypesDetailsCopy]
if (e == "0") {
this.typeList = this.typeListOfStationData;
} else if (e == "1") {
this.typeList = this.typeListOfUpdate;
} else if (e == "2") {
this.typeList = this.typeListOfUpdate;
} else if (e == "3") {
this.typeList = this.typeListOfFile;
} else if (e == "4") {
this.typeList = this.typeListOfUsers;
} else if (e == "5") {
this.typeList = [...this.warningTypesDetailsCopy];
} else {
this.typeList = [...this.typeListOfStationData, ...this.typeListOfUpdate, ...this.typeListOfFile]
this.typeList = [
...this.typeListOfStationData,
...this.typeListOfUpdate,
...this.typeListOfFile,
];
}
}
//历史记录列表
totalCount//列表总数
tableSpin = true
SkipCount: string = '0'
MaxResultCount: string = '50'
totalCount; //列表总数
tableSpin = true;
SkipCount: string = "0";
MaxResultCount: string = "50";
getRecordList() {
this.tableSpin = true
let endTime = this.validateForm.value.datePicker[1] + ' 23:59:59'
console.log('结束时间', endTime)
this.tableSpin = true;
let endTime = this.validateForm.value.datePicker[1] + " 23:59:59";
console.log("结束时间", endTime);
let params = {
IsContainsChildren: 'true',
IsContainsChildren: "true",
OrganizationUnitId: this.validateForm.value.organization,
AuditTitle: this.validateForm.value.type,
AuditType: this.validateForm.value.info,
@ -226,119 +286,145 @@ export class AuditRecordComponent implements OnInit {
Sorting: null,
SkipCount: this.SkipCount,
MaxResultCount: this.MaxResultCount,
}
this.http.get('/api/services/app/ContentAuditLog/GetHistory', { params }).subscribe((data: any) => {
data.result.items.forEach(element => {
element.itemData = JSON.parse(element.itemData)
};
this.http
.get("/api/services/app/ContentAuditLog/GetHistory", { params })
.subscribe((data: any) => {
data.result.items.forEach((element) => {
element.itemData = JSON.parse(element.itemData);
});
this.list = this.list.concat(data.result.items);
this.list = [...this.list];
this.totalCount = data.result.totalCount;
this.tableSpin = false;
console.log("审核历史纪录", this.list);
setTimeout(() => {
let tableHeader =
this.element.nativeElement.querySelector(
`.ant-table-header`
).clientHeight;
this.tableScrollHeight =
document.getElementById("tablebox").clientHeight -
tableHeader -
10 +
"px";
}, 0);
});
this.list = this.list.concat(data.result.items);
this.list = [...this.list]
this.totalCount = data.result.totalCount
this.tableSpin = false
console.log('审核历史纪录', this.list)
setTimeout(() => {
let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px'
}, 0);
})
}
details(item) {
console.log('点击的item', item)
let component
console.log("点击的item", item);
let component;
if (item.auditType == 0) {
component = GasBaseInfoComponent
component = GasBaseInfoComponent;
} else if (item.auditType == 1) {
component = AuditDetailsInformTimeComponent
component = AuditDetailsInformTimeComponent;
} else if (item.auditType == 2) {
component = DetailsUpdateCategoryComponent
component = DetailsUpdateCategoryComponent;
} else if (item.auditType == 4) {
component = UserDetailsComponent
component = UserDetailsComponent;
} else if (item.auditType == 5) {
component = AppealDetailsComponent
component = AppealDetailsComponent;
} else if (item.auditType) {
component = DetailsFileCategoryComponent
component = DetailsFileCategoryComponent;
}
this.getData(item).then(res => {
item.getData = res
this.getData(item).then((res) => {
item.getData = res;
if (item.auditType == 1) {
item.getData.organization = item.organization
item.getData.organization = item.organization;
}
const modal = this.modal.create({
nzContent: component,
nzViewContainerRef: this.viewContainerRef,
nzWidth: item.auditType == 0 ? 700 : 450,
nzBodyStyle: {
'border': '1px solid #91CCFF',
'border-radius': '0px',
'padding': '7px',
'box-shadow': '0 0 8px 0 #fff',
'background-image': 'linear-gradient(#003665, #000f25)'
border: "1px solid #91CCFF",
"border-radius": "0px",
padding: "7px",
"box-shadow": "0 0 8px 0 #fff",
"background-image": "linear-gradient(#003665, #000f25)",
},
nzStyle: {
'top': '50px',
top: "50px",
},
nzComponentParams: {
data: item.getData,
},
nzKeyboard:false,
nzKeyboard: false,
nzFooter: null,
nzClosable: false,
});
})
});
}
//获取证照类data
getData(item) {
let url
if (item.auditType == 0) { //油站基本信息
let url;
if (item.auditType == 0) {
//油站基本信息
return new Promise((resolve, reject) => {
let organization = { organizationId: item.organizationId }
resolve(organization)
})
let organization = { organizationId: item.organizationId };
resolve(organization);
});
} else if (item.auditType == 1) {
url = '/api/services/app/OrganizationValidityLicenseRule/Get'
url = "/api/services/app/OrganizationValidityLicenseRule/Get";
} else if (item.auditType == 2) {
url = '/api/services/app/StationValidityLicense/Get'
url = "/api/services/app/StationValidityLicense/Get";
} else if (item.auditType == 4) {
url = '/api/services/app/EdittingUser/Get'
url = "/api/services/app/EdittingUser/Get";
} else if (item.auditType == 5) {
return new Promise((resolve, reject) => {
resolve(item)
})
resolve(item);
});
} else if (item.auditType) {
url = '/api/services/app/StationFileLicense/Get'
url = "/api/services/app/StationFileLicense/Get";
}
return new Promise((resolve, reject) => {
let params = { id: item.itemId }
let params = { id: item.itemId };
this.http.get(url, { params }).subscribe((data: any) => {
let auditLog = { rejectReason: item.rejectReason }
let organization = { displayName: item.organization ? item.organization.displayName : "" }
let auditLog = { rejectReason: item.rejectReason };
let organization = {
displayName: item.organization ? item.organization.displayName : "",
};
if (item.auditType == 1) {
data.result.auditLog = auditLog
data.result.organization = organization
data.result.handleRemindDaysDefault = data.result.licenseType.handleRemindDays
data.result.closingRemindDaysDefault = data.result.licenseType.closingRemindDays
data.result.auditLog = auditLog;
data.result.organization = organization;
data.result.handleRemindDaysDefault =
data.result.licenseType.handleRemindDays;
data.result.closingRemindDaysDefault =
data.result.licenseType.closingRemindDays;
}
if (item.auditType == 2 || item.auditType == 3) {
data.result.auditLogId = item.id
data.result.auditLogId = item.id;
}
if (item.auditType == 4) {
data.result.auditLog = auditLog
data.result.auditLog = auditLog;
}
resolve(data.result)
})
})
resolve(data.result);
});
});
}
ngAfterViewInit(): void {
fromEvent(this.element.nativeElement.querySelector(`.ant-table-body`) as HTMLCanvasElement, 'scroll').pipe(debounceTime(100)).subscribe((event: any) => { //监听 DOM 滚动事件
if (event.target.scrollHeight - (event.target.scrollTop + event.target.clientHeight) <= 10) {
if (this.totalCount > this.list.length) {
this.SkipCount = String(Number(this.SkipCount) + 50)
this.getRecordList()
fromEvent(
this.element.nativeElement.querySelector(
`.ant-table-body`
) as HTMLCanvasElement,
"scroll"
)
.pipe(debounceTime(100))
.subscribe((event: any) => {
//监听 DOM 滚动事件
if (
event.target.scrollHeight -
(event.target.scrollTop + event.target.clientHeight) <=
10
) {
if (this.totalCount > this.list.length) {
this.SkipCount = String(Number(this.SkipCount) + 50);
this.getRecordList();
}
}
}
});
});
}
}

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

@ -34,7 +34,7 @@ export class MyValidators extends Validators {
return null;
}
return isPassword(value) ? null : { mobile: { 'zh-cn': PatternService.isProd ? `长度至少 8 位,必须包含大写字母、小写字母、数字、符号四种中的三种,且口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符` : '长度至少 8 位,必须包含大写字母、小写字母、数字、符号四种中的三种', en: `Password phone number is not valid` } };
return isPassword(value) ? null : { mobile: { 'zh-cn': PatternService.isProd ? `长度至少 12 位,必须包含大写字母、小写字母、数字、符号四种中的三种,且口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符` : '长度至少 12 位,必须包含大写字母、小写字母、数字、符号四种中的三种', en: `Password phone number is not valid` } };
}
}
@ -42,5 +42,5 @@ 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_!@#$%^&*`~()-+=]+$)(?!.*[sS][iI][nN][oO].*)(?!.*[zZ][hH][oO][nN][gG][hH][uU][aA].*)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{8,99}$/.test(value);
return typeof value === 'string' && /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)(?!.*[sS][iI][nN][oO].*)(?!.*[zZ][hH][oO][nN][gG][hH][uU][aA].*)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{12,99}$/.test(value);
}

328
src/app/pages/home-page-comprehensive/home-page-comprehensive.component.html

@ -0,0 +1,328 @@
<div class="homepagebox">
<div class="informbox">
<div class="warningnumber">
<img src="../../../assets/images/warningnum.png" alt="">
<span class="num">{{totalCount}}</span>
<span class="today" (click)="getUnreadNotification()">今日预警</span>
</div>
<div class="inform">
<div class="infologo">
<img src="../../../assets/images/inform.png" alt="">
通知
</div>
<!-- 循环轮播信息 -->
<div id="container" (mouseenter)="mouseEnter()" (mouseleave)="mouseleave()">
<div id="list-wrapper" style="top: 0">
<ul class="notice-list" id="notice-list">
<li class="info" *ngFor="let item of unreadMessageList;let key = index">
<div class="infoitem">
<img src="../../../assets/images/warning1.png" alt="">
您有一条新的预警信息!{{item.notification.data.violationName}}
</div>
<div class="btn">
<span (click)="look(item)">查看</span>
<span (click)="ignore(key)">忽略</span>
</div>
</li>
</ul>
<ul class="notice-list" id="notice-list-2">
</ul>
</div>
</div>
</div>
</div>
<div class="centerbox">
<div class="title">
<app-title [name]="'统计分析'"></app-title>
</div>
<div class="content_box">
<div class="leftitem leftitemlimit">
<div class="eventechartpieAll" id="eventechartpieAll">
</div>
<nz-spin *ngIf="isSpin" nzSimple class="nzspin"></nz-spin>
</div>
<div class="leftitem ranking">
<span class="itemname">油站近30天事件排名</span>
<div class="box eventbox">
<div class="eventboxitem" *ngFor="let item of HomeAggregatioData.violationNameAgg;let key = index">
<div class="eventname" [title]="item.eventSystemName">
<div class="block" [ngClass]="{'yellow': key < 3,'blue': key > 2}">
<ng-container *ngIf="key != 9; else elseTemplate">
{{'0' + (key + 1)}}
</ng-container>
<ng-template #elseTemplate>
{{key + 1}}
</ng-template>
</div>
{{item.eventSystemName}}
</div>
<div class="progressbox">
<div class="progress">
<div class="colorbar"
[ngStyle]="width(item.count,HomeAggregatioData.violationNameAgg[0].count)"
[ngClass]="{'yellow': key < 3,'blue': key > 2}">
</div>
</div>
</div>
<div style="margin-left: 6px;">
{{item.count}}
</div>
</div>
</div>
<nz-spin *ngIf="isSpin" nzSimple class="nzspin"></nz-spin>
</div>
<div class="leftitem ranking" style="margin-left: 50px;">
<span class="itemname">近30天油站排名</span>
<div class="box eventbox">
<div class="eventboxitem" *ngFor="let item of HomeAggregatioData.stationAgg;let key = index">
<div class="eventname" [title]="item.companyName + item.stationName">
<div class="block" [ngClass]="{'yellow': key < 3,'blue': key > 2}">
<ng-container *ngIf="key != 9; else elseTemplate">
{{'0' + (key + 1)}}
</ng-container>
<ng-template #elseTemplate>
{{key + 1}}
</ng-template>
</div>
{{item.companyName}} {{item.stationName}}
</div>
<div class="progressbox">
<div class="progress">
<div class="colorbar"
[ngStyle]="width(item.count,HomeAggregatioData.stationAgg[0].count)"
[ngClass]="{'yellow': key < 3,'blue': key > 2}">
</div>
</div>
</div>
<div style="margin-left: 6px;">
{{item.count}}
</div>
</div>
</div>
<nz-spin *ngIf="isSpin" nzSimple class="nzspin"></nz-spin>
</div>
<div class="rightitem">
<div class="numlistbox">
<img src="../../../assets/images/stationNum.png" alt="">
<div class="content">
<span class="lightspan lightspan1">{{HomeAggregatioData.dev.stationCount}}</span>
<span>接入油站(个)</span>
</div>
</div>
<div class="numlistbox">
<img src="../../../assets/images/modelNum.png" alt="">
<div class="content">
<span class="lightspan lightspan2">{{HomeAggregatioData.dev.violationCount}}</span>
<span>预警分析模型(个)</span>
</div>
</div>
<div class="numlistbox">
<img src="../../../assets/images/cameraNum.png" alt="">
<div class="content">
<span class="lightspan lightspan3">{{HomeAggregatioData.dev.cameraCount}}</span>
<span>摄像头(个)</span>
</div>
</div>
</div>
<div class="angle-border left-top-border"></div>
<div class="angle-border right-top-border"></div>
<div class="angle-border left-bottom-border"></div>
<div class="angle-border right-bottom-border"></div>
</div>
<div class="content_box">
<div class="leftitem leftitemlimit">
<div class="eventechartpieAll" id="eventechartpieAll_YK">
</div>
<nz-spin *ngIf="isSpin_YK" nzSimple class="nzspin"></nz-spin>
</div>
<div class="leftitem ranking">
<span class="itemname">油库近30天事件排名</span>
<div class="box eventbox">
<div class="eventboxitem"
*ngFor="let item of HomeAggregatioData_YK.violationNameAgg;let key = index">
<div class="eventname" [title]="item.eventSystemName">
<div class="block" [ngClass]="{'yellow': key < 3,'blue': key > 2}">
<ng-container *ngIf="key != 9; else elseTemplate">
{{'0' + (key + 1)}}
</ng-container>
<ng-template #elseTemplate>
{{key + 1}}
</ng-template>
</div>
{{item.eventSystemName}}
</div>
<div class="progressbox">
<div class="progress">
<div class="colorbar"
[ngStyle]="width(item.count,HomeAggregatioData_YK.violationNameAgg[0].count)"
[ngClass]="{'yellow': key < 3,'blue': key > 2}">
</div>
</div>
</div>
<div style="margin-left: 6px;">
{{item.count}}
</div>
</div>
</div>
<nz-spin *ngIf="isSpin_YK" nzSimple class="nzspin"></nz-spin>
</div>
<div class="leftitem ranking" style="margin-left: 50px;">
<span class="itemname">近30天油库排名</span>
<div class="box eventbox">
<div class="eventboxitem" *ngFor="let item of HomeAggregatioData_YK.stationAgg;let key = index">
<div class="eventname" [title]="item.companyName + item.stationName">
<div class="block" [ngClass]="{'yellow': key < 3,'blue': key > 2}">
<ng-container *ngIf="key != 9; else elseTemplate">
{{'0' + (key + 1)}}
</ng-container>
<ng-template #elseTemplate>
{{key + 1}}
</ng-template>
</div>
{{item.companyName}} {{item.stationName}}
</div>
<div class="progressbox">
<div class="progress">
<div class="colorbar"
[ngStyle]="width(item.count,HomeAggregatioData_YK.stationAgg[0].count)"
[ngClass]="{'yellow': key < 3,'blue': key > 2}">
</div>
</div>
</div>
<div style="margin-left: 6px;">
{{item.count}}
</div>
</div>
</div>
<nz-spin *ngIf="isSpin_YK" nzSimple class="nzspin"></nz-spin>
</div>
<div class="rightitem">
<div class="numlistbox">
<img src="../../../assets/images/stationNum.png" alt="">
<div class="content">
<span class="lightspan lightspan1">{{HomeAggregatioData_YK.dev.stationCount}}</span>
<span>接入油库(个)</span>
</div>
</div>
<div class="numlistbox">
<img src="../../../assets/images/modelNum.png" alt="">
<div class="content">
<span class="lightspan lightspan2">{{HomeAggregatioData_YK.dev.violationCount}}</span>
<span>预警分析模型(个)</span>
</div>
</div>
<div class="numlistbox">
<img src="../../../assets/images/cameraNum.png" alt="">
<div class="content">
<span class="lightspan lightspan3">{{HomeAggregatioData_YK.dev.cameraCount}}</span>
<span>摄像头(个)</span>
</div>
</div>
</div>
<div class="angle-border left-top-border"></div>
<div class="angle-border right-top-border"></div>
<div class="angle-border left-bottom-border"></div>
<div class="angle-border right-bottom-border"></div>
</div>
</div>
<div class="bottombox">
<div class="bottomitem">
<div class="title" style="padding-left: 20px;">
<app-title [name]="'预警走势'"></app-title>
</div>
<div class="bottomitemcontent bottomitemcontent1">
<div class="bottomitemchartboxspecial">
<span class="bartitle">油站近30天预警事件统计</span>
<div class="eventechartpie" id="eventechartpie"></div>
<div class="eventechartline" id="eventechartline"></div>
<div class="angle-border left-top-border"></div>
<div class="angle-border right-top-border"></div>
<div class="angle-border left-bottom-border"></div>
<div class="angle-border right-bottom-border"></div>
<nz-spin *ngIf="isSpinOfEventWarning" nzSimple class="nzspin"></nz-spin>
</div>
</div>
<div class="bottomitemcontent bottomitemcontent2">
<div class="bottomitemchartboxspecial">
<span class="bartitle">油库近30天预警事件统计</span>
<div class="eventechartpie" id="eventechartpie_YK"></div>
<div class="eventechartline" id="eventechartline_YK"></div>
<div class="angle-border left-top-border"></div>
<div class="angle-border right-top-border"></div>
<div class="angle-border left-bottom-border"></div>
<div class="angle-border right-bottom-border"></div>
<nz-spin *ngIf="isSpinOfEventWarning_YK" nzSimple class="nzspin"></nz-spin>
</div>
</div>
</div>
<div class="bottomitem">
<div class="title">
<app-title [name]="'事件监督'"></app-title>
</div>
<div class="bottomitemcontent bottomitemcontent3">
<div class="bottomitemchartboxspecial">
<span class="bartitle">油站近30天卸油预警走势</span>
<div class="eventechartpie" id="oilechartpie"></div>
<div style="height: 80%;" class="eventechartline" id="oilechartline"></div>
<div class="angle-border left-top-border"></div>
<div class="angle-border right-top-border"></div>
<div class="angle-border left-bottom-border"></div>
<div class="angle-border right-bottom-border"></div>
<nz-spin *ngIf="isSpinOfOilDischarge" nzSimple class="nzspin"></nz-spin>
<div class="oilNum">
<div class="oilNumItem">
<div class="pointbox">
<div class="point"></div>
<span>累计卸油总车次</span>
</div>
{{HomeAggregatioData.ouViolationType.ouTotalCount}}
</div>
<div class="oilNumItem">
<div class="pointbox">
<div class="point"></div>
<span>累计卸油预警车次</span>
</div>
{{HomeAggregatioData.ouViolationType.ouNotCorrectCount}}
</div>
</div>
</div>
</div>
<div class="bottomitemcontent bottomitemcontent4">
<div class="bottomitemchartboxspecial">
<span class="bartitle">油库近30天发油预警走势</span>
<div class="eventechartpie" id="oilechartpie_YK"></div>
<div style="height: 80%;" class="eventechartline" id="oilechartline_YK"></div>
<div class="angle-border left-top-border"></div>
<div class="angle-border right-top-border"></div>
<div class="angle-border left-bottom-border"></div>
<div class="angle-border right-bottom-border"></div>
<nz-spin *ngIf="isSpinOfOilDischarge_YK" nzSimple class="nzspin"></nz-spin>
<div class="oilNum">
<div class="oilNumItem">
<div class="pointbox">
<div class="point"></div>
<span>累计发油总车次</span>
</div>
{{HomeAggregatioData_YK.ouViolationType.ouTotalCount}}
</div>
<div class="oilNumItem">
<div class="pointbox">
<div class="point"></div>
<span>累计发油预警车次</span>
</div>
{{HomeAggregatioData_YK.ouViolationType.ouNotCorrectCount}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>

578
src/app/pages/home-page-comprehensive/home-page-comprehensive.component.scss

@ -0,0 +1,578 @@
.homepagebox {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.informbox {
width: 100%;
height: 45px;
margin: 10px 0;
display: flex;
box-sizing: border-box;
padding: 0 22px;
align-items: center;
justify-content: space-between;
.warningnumber {
width: 250px;
display: flex;
align-items: center;
img {
width: 60px;
}
.num {
font-size: 32px;
text-shadow: 0px 0px 6px #8df;
color: white;
font-weight: 600;
margin: 0 8px;
}
.today {
font-size: 18px;
font-family: titlefont;
color: #d0eaff;
margin-bottom: 13px;
margin-left: 4px;
}
}
.inform {
flex: 1;
border: 1px solid rgba(54, 162, 255, 0.4);
height: 45px;
display: flex;
align-items: center;
justify-content: space-between;
.infologo {
img {
width: 32px;
}
height: 32px;
line-height: 32px;
color: #91ccff;
font-size: 14px;
margin-left: 16px;
margin-right: 40px;
}
#container {
flex: 1;
position: relative;
height: 46px;
overflow: hidden;
}
#list-wrapper {
position: relative;
}
ul {
list-style: none;
}
.info {
flex: 1;
display: flex;
height: 46px;
line-height: 46px;
color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
.infoitem {
flex: 1;
display: flex;
align-items: center;
img {
width: 40px;
}
color: #fff;
}
.btn {
color: #36a2ff;
span {
cursor: pointer;
}
span:nth-child(1) {
margin-right: 24px;
}
span:nth-child(2) {
margin-right: 40px;
}
}
}
}
}
.centerbox {
height: 45%;
width: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
box-sizing: border-box;
.title {
box-sizing: border-box;
padding: 0 20px;
width: 100%;
height: 40px;
}
.content_box {
position: relative;
flex: 1;
display: flex;
box-sizing: border-box;
margin: 5px 30px;
border: 1px solid rgba(54, 162, 255, 0.3);
.leftitem {
position: relative;
flex: 1;
box-sizing: border-box;
display: flex;
flex-direction: column;
.eventechartpieAll {
width: 100%;
height: 100%;
}
.progress {
height: 4px;
width: 100%;
background: rgba(54, 162, 255, 0.2);
position: relative;
.colorbar {
height: 4px;
left: 0;
top: 0;
}
.red {
color: #ff4b65;
background: linear-gradient(
90deg,
rgba(255, 75, 101, 0) 0%,
#ff4b65 100%
);
}
.yellow {
color: #ff9963;
background: linear-gradient(
90deg,
rgba(255, 153, 99, 0) 0%,
#ff9963 100%
);
}
.blue {
color: #36a2ff;
background: linear-gradient(
90deg,
rgba(54, 162, 255, 0) 0%,
#36a2ff 100%
);
}
}
.itemname {
color: #fff;
font-size: 13px;
}
.box {
flex: 1;
width: 100%;
}
.areabox {
display: flex;
flex-direction: column;
justify-content: space-around;
.areaboxitemtop {
display: flex;
justify-content: space-between;
align-items: center;
color: #ffffff;
font-size: 14px;
margin-bottom: 12px;
.red {
color: #ff4b65;
}
.yellow {
color: #ff9963;
}
.blue {
color: #36a2ff;
}
}
}
.eventbox {
display: flex;
flex-direction: column;
justify-content: space-around;
.eventboxitem {
display: flex;
align-items: center;
color: #fff;
font-size: 12px;
.eventname {
display: inline-block;
width: 30%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.block {
display: inline-block;
width: 14px;
height: 14px;
line-height: 12px;
font-size: 8px;
color: #fff;
}
.yellow {
background-color: #ff9963;
}
.blue {
background-color: #36a2ff;
}
}
.progressbox {
flex: 1;
}
}
}
.stationbox {
display: flex;
flex-direction: column;
justify-content: space-around;
.stationboxitem {
display: flex;
align-items: center;
color: #fff;
font-size: 12px;
.stationname {
display: inline-block;
width: 50%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.block {
display: inline-block;
width: 14px;
height: 14px;
line-height: 12px;
font-size: 8px;
color: #fff;
}
.yellow {
background-color: #ff9963;
}
.blue {
background-color: #36a2ff;
}
}
.area {
flex: 1;
.yellow {
color: #ff9963;
}
.blue {
color: #36a2ff;
}
}
}
}
}
.leftitemlimit {
max-width: 280px;
}
.ranking {
flex: 1;
padding: 5px 0;
}
.rightitem {
width: 400px;
position: relative;
height: 100%;
display: flex;
flex-wrap: wrap;
box-sizing: border-box;
padding: 12px 0;
padding-top: 20px;
margin-left: 30px;
.numlistbox {
height: 64px;
width: 50%;
display: flex;
align-items: center;
img {
width: 45px;
height: 45px;
margin-right: 18px;
}
.content {
display: flex;
flex-direction: column;
justify-content: flex-start;
span {
color: white;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.lightspan {
font-size: 22px;
font-weight: 600;
line-height: 28px;
}
.lightspan1 {
text-shadow: 0px 0px 16px #3a9aff;
}
.lightspan2 {
text-shadow: 0px 0px 16px #23d9ff;
}
.lightspan3 {
text-shadow: 0px 0px 16px #ffb791;
}
}
}
}
}
}
.bottombox {
flex: 1;
display: flex;
.title {
box-sizing: border-box;
width: 100%;
height: 40px;
}
.bottomitem {
flex: 1;
height: 100%;
display: flex;
flex-direction: column;
.bottomitemcontent {
flex: 1;
box-sizing: border-box;
.bottomitemchartbox {
position: relative;
height: 100%;
border: 1px solid rgba(54, 162, 255, 0.3);
display: flex;
.numlistbox {
position: absolute;
left: 5%;
bottom: 6%;
display: flex;
flex-direction: column;
.numlistboxitem {
display: flex;
color: #fff;
align-items: center;
margin: 3px 0;
span {
font-size: 12px;
}
.top {
display: inline-block;
width: 15px;
height: 15px;
line-height: 15px;
text-align: center;
font-size: 8px;
border-radius: 2px;
}
.top1 {
background: #ff4b65;
}
.top2 {
background: #ff9963;
}
.top3 {
background: #36a2ff;
}
.name {
margin: 0 16px;
}
}
}
.eventechartpie,
.oilechartpie {
height: 100%;
width: 23%;
position: relative;
}
.eventechartline,
.oilechartline {
height: 100%;
flex: 1;
}
}
.bottomitemchartboxspecial {
position: relative;
height: 100%;
width: 100%;
border: 1px solid rgba(54, 162, 255, 0.3);
display: flex;
.bartitle {
position: absolute;
top: 5px;
left: 20px;
color: #ffffff;
font-size: 13px;
}
.eventechartpie {
height: 100%;
width: 100%;
position: relative;
}
.eventechartline {
position: absolute;
right: 0;
bottom: 0;
height: 83%;
width: 76%;
}
.oilNum {
position: absolute;
left:40px;
bottom: 5px;
display: flex;
flex-direction: column;
.oilNumItem {
display: flex;
align-items: center;
justify-content: space-between;
color: white;
font-size: 12px;
span {
margin: 0 4px;
}
.pointbox {
display: flex;
align-items: center;
}
.point {
width: 6px;
height: 6px;
background-color: #91ccff;
}
}
}
}
}
.bottomitemcontent1 {
padding: 5px 0 10px 30px;
}
.bottomitemcontent2 {
padding: 0px 0 10px 30px;
}
.bottomitemcontent3 {
padding: 5px 30px 10px 20px;
}
.bottomitemcontent4 {
padding: 0px 30px 10px 20px;
}
}
}
.angle-border {
position: absolute;
width: 8px;
height: 8px;
}
.left-top-border {
top: 0;
left: 0;
border-left: 2px solid #ffffff;
border-top: 2px solid #ffffff;
}
.right-top-border {
top: 0;
right: -2px;
border-right: 2px solid #ffffff;
border-top: 2px solid #ffffff;
}
.left-bottom-border {
bottom: 0;
left: 0;
border-bottom: 2px solid #ffffff;
border-left: 2px solid #ffffff;
}
.right-bottom-border {
bottom: 0;
right: -2px;
border-right: 2px solid #ffffff;
border-bottom: 2px solid #ffffff;
}

1786
src/app/pages/home-page-comprehensive/home-page-comprehensive.component.ts

File diff suppressed because it is too large Load Diff

10
src/app/pages/home-page/home-page.component.html

@ -46,7 +46,7 @@
</div>
<img class="bucket" src="../../../assets/images/bucket.png" alt="">
<img class="circle" src="../../../assets/images/circle.png" alt=""> -->
<div class="eventechartpieAll" id="eventechartpieAll">
<div class="eventechartpieAll" id="eventechartpieAll_YZ">
</div>
@ -233,11 +233,11 @@
<div class="bottomitemcontent bottomitemcontent1">
<div class="bottomitemchartboxspecial">
<span class="bartitle">近30天预警事件统计</span>
<div class="eventechartpie" id="eventechartpie">
<div class="eventechartpie" id="eventechartpie_YZ">
</div>
<div class="eventechartline" id="eventechartline">
<div class="eventechartline" id="eventechartline_YZ">
</div>
<div class="angle-border left-top-border"></div>
@ -255,10 +255,10 @@
<div class="bottomitemcontent bottomitemcontent1">
<div class="bottomitemchartboxspecial">
<span class="bartitle">近30天卸油预警走势</span>
<div class="eventechartpie" id="oilechartpie">
<div class="eventechartpie" id="oilechartpie_YZ">
</div>
<div style="height: 80%;" class="eventechartline" id="oilechartline">
<div style="height: 80%;" class="eventechartline" id="oilechartline_YZ">
</div>
<div class="angle-border left-top-border"></div>

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

@ -533,14 +533,14 @@ export class HomePageComponent implements OnInit {
// 饼图
this.warningechartpieAll = echarts.init(
document.getElementById("eventechartpieAll"),
document.getElementById("eventechartpieAll_YZ"),
null,
{ devicePixelRatio: 2 }
);
// this.equipmentechart = echarts.init(document.getElementById('equipmentechart'));
// 预警饼图
this.warningechartpie = echarts.init(
document.getElementById("eventechartpie"),
document.getElementById("eventechartpie_YZ"),
null,
{ devicePixelRatio: 2 }
);
@ -556,12 +556,12 @@ export class HomePageComponent implements OnInit {
});
// 预警线图
this.warningechartbar = echarts.init(
document.getElementById("eventechartline")
document.getElementById("eventechartline_YZ")
);
// 卸油饼图
this.oilchartpie = echarts.init(
document.getElementById("oilechartpie"),
document.getElementById("oilechartpie_YZ"),
null,
{ devicePixelRatio: 2 }
);
@ -576,7 +576,7 @@ export class HomePageComponent implements OnInit {
this.get30daysViolate(false, arr);
});
// 卸油线图
this.oilchartbar = echarts.init(document.getElementById("oilechartline"));
this.oilchartbar = echarts.init(document.getElementById("oilechartline_YZ"));
window.onresize = () => {
setTimeout(() => {
@ -614,6 +614,8 @@ export class HomePageComponent implements OnInit {
this.warningechartbar.dispose();
this.oilchartpie.dispose();
this.oilchartbar.dispose();
this.mouseEnter();
}
resolutionRatio() {
@ -799,7 +801,7 @@ export class HomePageComponent implements OnInit {
? (this.isSpinOfEventWarning = true)
: (this.isSpinOfOilDischarge = true);
let params = {
OrganizationUnitId: this.organizationUnitId,
// OrganizationUnitId: this.organizationUnitId,
IsContainsChildren: true,
ViolationTypes: type ? data : null,
EventSystemNames: type ? null : data,

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

@ -3,20 +3,32 @@
<div class="boxleft">
<img *ngIf="isProd" src="../../../assets/images/logo2.png" alt="">
</div>
<div class="libox" *ngIf="!isGasStationNav">
<div class="libox" *ngIf="!isGasStationNav && isComprehensive">
<li class="router-link-active">
AI视频预警统计
</li>
</div>
<div class="libox" *ngIf="!isGasStationNav && !isComprehensive">
<li *ngFor="let item of menuList1" (click)="routerChange(item)"
[ngClass]="{'router-link-active': item.name == selectedItem}">
{{item.name}}
</li>
</div>
<div class="libox" *ngIf="isGasStationNav">
<div class="libox" *ngIf="isGasStationNav && isComprehensive">
<li class="router-link-active">
AI视频预警统计
</li>
</div>
<div class="libox" *ngIf="isGasStationNav && !isComprehensive">
<ng-container *ngIf="isGasStationBack; else elseTemplate">
<li [routerLink]="['/plan/petrolStation']" routerLinkActive="router-link-active">
数字油站
</li>
</ng-container>
<ng-template #elseTemplate>
<li *ngFor="let item of menuList1" (click)="routerChange(item)"
<li *ngFor="let item of menuList1" (click)="routerChange(item)"
[ngClass]="{'router-link-active': item.name == selectedItem}">
{{item.name}}
</li>
@ -58,11 +70,12 @@
<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>
<ul nz-menu nzSelectable *ngIf="isZT ==='false'">
<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>
@ -70,9 +83,11 @@
<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>
@ -118,44 +133,3 @@
</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>

50
src/app/pages/home/home.component.scss

@ -1,10 +1,10 @@
.blue {
color: #36A2FF;
color: #36a2ff;
cursor: pointer;
}
.grey {
color: #FFFFFF;
color: #ffffff;
opacity: 0.6;
}
@ -13,39 +13,41 @@
height: 100%;
overflow: hidden;
// background-image: radial-gradient(closest-side at 50% 55%,#03447c, #02325c, #002046);
background: radial-gradient(closest-side at 50% 55%, #004988 0%, #00122D 100%);
background: radial-gradient(
closest-side at 50% 55%,
#004988 0%,
#00122d 100%
);
display: flex;
flex-direction: column;
}
.menu {
height: 56px;
width: 100%;
display: flex;
justify-content: center;
font-size: 17px;
background: url('../../../assets/images/navbg.png') no-repeat;
background: url("../../../assets/images/navbg.png") no-repeat;
background-size: 100% 115%;
position: relative;
.libox {
width: 33%;
width: 35%;
display: flex;
justify-content: center;
li {
flex: 1;
// flex: 1;
box-sizing: border-box;
padding: 0 20px;
height: 52px;
line-height: 52px;
text-align: center;
cursor: pointer;
font-family: sybold;
color: #EBFAFF;
color: #ebfaff;
}
}
}
.boxleft {
@ -67,7 +69,7 @@
span {
font-size: 16px;
color: #FFFFFF;
color: #ffffff;
opacity: 0.6;
}
@ -77,7 +79,6 @@
}
}
.backbtn {
position: absolute;
left: 205px;
@ -87,9 +88,9 @@
width: 64px;
height: 32px;
background: rgba(0, 129, 255, 0.3);
border: 1px solid #36A2FF;
border: 1px solid #36a2ff;
border-radius: 0px;
color: #91CCFF;
color: #91ccff;
}
}
@ -115,7 +116,7 @@
.today {
font-size: 19px;
font-family: titlefont;
color: #D0EAFF;
color: #d0eaff;
margin-top: 11px;
margin-left: 10px;
}
@ -124,13 +125,17 @@
.content {
flex: 1;
overflow: hidden;
}
.router-link-active {
// background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, #1c8199 50%, rgba(35, 153, 255, 0) 100%);
background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, #36A2FF 50%, rgba(35, 153, 255, 0) 100%);
background: linear-gradient(
270deg,
rgba(35, 153, 255, 0) 0%,
#36a2ff 50%,
rgba(35, 153, 255, 0) 100%
);
}
// 适配125%
@ -140,8 +145,6 @@
font-size: 14px;
.libox {
width: 33%;
li {
height: 42px;
line-height: 42px;
@ -190,13 +193,11 @@
// 适配150%
@media screen and (max-height: 600px) {
.menu {
height: 32px;
font-size: 8px;
.libox {
width: 33%;
li {
height: 32px;
@ -229,7 +230,6 @@
}
}
.backbtn {
left: 156px;
bottom: 0px;
@ -243,6 +243,4 @@
padding: 0;
}
}
}

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

@ -71,6 +71,7 @@ export class HomeComponent implements OnInit {
//菜单
menu1 = [
{ name: "AI视频预警统计", url: "/comprehensive" },
{ name: "首页", url: "/homepage" },
{ name: "数字油站", url: "/plan" },
{ name: "今日预警", url: "/todaywarning" },
@ -99,8 +100,14 @@ export class HomeComponent implements OnInit {
menuList1 = [];
menuList2 = [];
selectedItem;
isZT = sessionStorage.getItem("isZT") || "false";
isComprehensive = false;
routerChange(item) {
if (JSON.parse(sessionStorage.getItem("isGasStation"))) {
if (
JSON.parse(sessionStorage.getItem("isGasStation")) &&
this.isZT !== "true"
) {
let a = JSON.parse(sessionStorage.getItem("3dSceneData"));
if (!a.hasBuildingInfo && item.url == "/plan/petrolStation") {
this.message.info("当前油站未开通!");
@ -117,36 +124,22 @@ export class HomeComponent implements OnInit {
}
isProd: boolean;
ngOnInit(): void {
if (this.isZT == "true") {
this.menu2 = [
{ name: "数字油站", url: "/plan" },
{ name: "今日预警", url: "/todaywarning" },
{ name: "预警记录", url: "/records_nav" },
{ name: "证照管理", url: "/audit" },
];
}
//油站人员进入油站
if (this.router.url.indexOf("comprehensive") != -1) {
//控制返回按钮显示
this.isComprehensive = true;
}
this.isProd = this.patternService.isProd;
this.location.subscribe((event) => {
if (event.url == "/homepage") {
sessionStorage.setItem("selectedMenu", "首页");
this.selectedItem = "首页";
} else if (event.url == "/plan" || event.url == "/plan/petrolStation") {
sessionStorage.setItem("selectedMenu", "数字油站");
this.selectedItem = "数字油站";
} else if (
event.url == "/todaywarning" ||
event.url == "/todaywarning/petrolStation"
) {
sessionStorage.setItem("selectedMenu", "今日预警");
this.selectedItem = "今日预警";
} else if (event.url.indexOf("/records_nav") != -1) {
if (event.url == "/records_nav") {
this.router.navigate(["/records_nav/all"]);
} else if (event.url == "/records_nav/petrolStation") {
this.router.navigate(["/records_nav/petrolStation/all"]);
}
sessionStorage.setItem("selectedMenu", "预警记录");
this.selectedItem = "预警记录";
} else if (
event.url == "/license" ||
event.url == "/license/petrolStation"
) {
sessionStorage.setItem("selectedMenu", "证照管理");
this.selectedItem = "证照管理";
}
});
this.initSelectedItem(this.router);
let a = sessionStorage.getItem("userdata");
this.userMenu = JSON.parse(a).menus;
@ -232,17 +225,30 @@ export class HomeComponent implements OnInit {
this.userName = JSON.parse(sessionStorage.getItem("userdata")).userName;
}
if (
(sessionStorage.getItem("isDefaultPassword") == "true" ||
sessionStorage.getItem("isPasswordExpired") == "true") &&
JSON.parse(sessionStorage.getItem("userdata")).userName != "admin"
) {
this.changePasswordPopup();
}
// if (
// (sessionStorage.getItem("isDefaultPassword") == "true" ||
// sessionStorage.getItem("isPasswordExpired") == "true") &&
// JSON.parse(sessionStorage.getItem("userdata")).userName != "admin"
// ) {
// this.changePasswordPopup();
// }
this.getWarningSwitch();
}
switchUsers() {}
initSelectedItem(event) {
// console.log(666, event);
if (event.url.indexOf("/homepage") !== -1) {
sessionStorage.setItem("selectedMenu", "首页");
this.selectedItem = "首页";
} else if (event.url.indexOf("/todaywarning") !== -1) {
sessionStorage.setItem("selectedMenu", "今日预警");
this.selectedItem = "今日预警";
} else if (event.url.indexOf("/records_nav") != -1) {
this.selectedItem = "预警记录";
}
}
isWarningVoice = true; //预警声音
isWarningWindow = true; //预警弹窗
/**
@ -300,49 +306,6 @@ export class HomeComponent implements OnInit {
SignalRAspNetCoreHelper.initSignalR();
abp.event.on("abp.notifications.received", this.reloadPage);
}
//初次登陆修改密码弹窗
isVisible = false;
isConfirmLoading = false;
changePasswordPopup() {
this.isVisible = true;
}
handleOk(): void {
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");
sessionStorage.removeItem("isPasswordExpired");
},
(err) => {
this.message.create("warning", err.error.error.message);
this.isConfirmLoading = false;
}
);
}
}
}
reloadPage = (userNotification) => {
console.log("abp.notifications.received收到通知", userNotification);
@ -363,18 +326,7 @@ export class HomeComponent implements OnInit {
messageId = [];
receiptOfNotification(userNotification) {
if (this.isWarningVoice) {
// if (!window.speechSynthesis) {
// this.message.create("warning", `该游览器不支持语音播报`);
// } else {
// let speakMsg = new SpeechSynthesisUtterance(
// "请注意,收到一条新的预警信息,请及时处理!"
// );
// speakMsg.lang = "zh-CN";
// speakMsg.rate = 1;
// speakMsg.pitch = 1.5;
// window.speechSynthesis.speak(speakMsg);
// }
this.Sound();
this.Sound(userNotification);
}
if (this.isWarningWindow) {
let obj = {
@ -389,11 +341,82 @@ export class HomeComponent implements OnInit {
this.messageId.push(obj);
}
}
Sound() {
var mp3Url = "../../../assets/sound/warning.mp3";
var player = new Audio(mp3Url);
player.play(); //播放 mp3这个音频对象
msg = new SpeechSynthesisUtterance();
playingViolationName = "";
Sound(userNotification) {
let violationName =
userNotification.notification.data.properties.ViolationName;
let CameraNo = userNotification.notification.data.properties.CameraNo;
const soundMap = {
: `请注意,${CameraNo}有非工作人员闯入,请及时处理`,
: `请注意,${CameraNo}有长时间停放车辆,请及时处理`,
: `请注意,${CameraNo}有顾客疑似抽烟,请及时处理`,
: `请注意,${CameraNo}有顾客接打电话,请及时处理`,
: "请注意,卸油前未按规定设置隔离,请及时处理",
: "请注意,卸油后未按规定拆除卸油管,请及时处理",
:
"请注意,卸油前未按规定连接静电接地,请及时处理",
: "请注意,卸油前未按规定放置灭火器,请及时处理",
: "请注意,卸油后长时间未清理现场,请及时处理",
: "请注意,油罐车长时间无人卸油,请及时处理",
: "请注意,卸油前未按规定连接卸油管,请及时处理",
: "请注意,卸油中未按规定全程监卸,请及时处理",
: `请注意,${CameraNo}疑似出现烟雾,请及时处理`,
: `请注意,${CameraNo}疑似出现明火,请及时处理`,
"收银员未穿工装/非工作人员闯入收银区":
"请注意,收银员未穿工装或非工作人员闯入收银区,请及时处理",
};
if (violationName == "前庭有顾客疑似抽烟") {
window.speechSynthesis.cancel();
}
if (
violationName == "前庭有顾客接打电话" &&
this.playingViolationName !== "前庭有顾客疑似抽烟"
) {
window.speechSynthesis.cancel();
}
// 如果你想控制语速、音量或声音等
this.msg.text =
soundMap[violationName] || "请注意,收到一条新的预警信息,请及时处理";
this.msg.rate = 0.8; // 语速,默认值为1
this.msg.volume = 1; // 音量,0到1之间
this.msg.lang = "zh-CN"; // 语言,支持多种语言
this.playingViolationName = violationName;
window.speechSynthesis.speak(this.msg);
// 监听语音结束事件
this.msg.onend = () => {
this.playingViolationName = "";
};
// let violationName =
// userNotification.notification.data.properties.ViolationName;
// const soundMap = {
// 油罐区非工作人员闯入: "../../../assets/sound/chuangru.mp3",
// 进出口长时间停放车辆: "../../../assets/sound/jinchukou.mp3",
// 前庭有顾客疑似抽烟: "../../../assets/sound/chouyan.mp3",
// 前庭有顾客接打电话: "../../../assets/sound/dadianhua.mp3",
// 卸油前未按规定设置隔离: "../../../assets/sound/xygeli.mp3",
// 卸油后未按规定拆除卸油管: "../../../assets/sound/xychaichuxyguan.mp3",
// 卸油前未按规定连接静电接地: "../../../assets/sound/xyjiedi.mp3",
// 卸油前未按规定放置灭火器: "../../../assets/sound/xymiehuoqi.mp3",
// 卸油后长时间未清理现场: "../../../assets/sound/xyxianchang.mp3",
// 油罐车长时间无人卸油: "../../../assets/sound/xywuren.mp3",
// 卸油前未按规定连接卸油管: "../../../assets/sound/xyxieyouguan.mp3",
// 卸油中未按规定全程监卸: "../../../assets/sound/xyjianxie.mp3",
// 疑似烟雾: "../../../assets/sound/yanwu.mp3",
// 疑似明火: "../../../assets/sound/minghuo.mp3",
// "收银员未穿工装/非工作人员闯入收银区":
// "../../../assets/sound/gongzhuang.mp3",
// default: "../../../assets/sound/warning.mp3",
// };
// const audioUrl = soundMap[violationName] || soundMap.default;
// var player = new Audio(audioUrl);
// player.play(); //播放 mp3这个音频对象
}
modalData;
look(item) {
console.log("推送信息", item);

205
src/app/pages/login/forget/forget.component.ts

@ -1,129 +1,163 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators, AbstractControl } from '@angular/forms';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
import { HttpClient } from '@angular/common/http';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { Component, OnInit } from "@angular/core";
import {
FormBuilder,
FormGroup,
Validators,
AbstractControl,
} from "@angular/forms";
import { NzMessageService } from "ng-zorro-antd/message";
import { NzSafeAny } from "ng-zorro-antd/core/types";
import { HttpClient } from "@angular/common/http";
import { NzModalRef } from "ng-zorro-antd/modal";
@Component({
selector: 'app-forget',
templateUrl: './forget.component.html',
styleUrls: ['./forget.component.scss']
selector: "app-forget",
templateUrl: "./forget.component.html",
styleUrls: ["./forget.component.scss"],
})
export class ForgetComponent implements OnInit {
validateForm!: FormGroup;
validateForm2!: FormGroup;
validateForm3!: FormGroup;
constructor(private fb: FormBuilder, private message: NzMessageService, private http: HttpClient, private modal: NzModalRef, private patternService: PatternService) { }
isProd: boolean
constructor(
private fb: FormBuilder,
private message: NzMessageService,
private http: HttpClient,
private modal: NzModalRef,
private patternService: PatternService
) {}
isProd: boolean;
ngOnInit(): void {
this.isProd = this.patternService.isProd
this.isProd = this.patternService.isProd;
this.validateForm = this.fb.group({
account: [null, [Validators.required]]
account: [null, [Validators.required]],
});
this.validateForm2 = this.fb.group({
code: [null, [Validators.required]]
code: [null, [Validators.required]],
});
const { password } = MyValidators;
this.validateForm3 = this.fb.group({
newpassword: [null, [Validators.required, password]],
affirmpassword: [null, [Validators.required, password]]
affirmpassword: [null, [Validators.required, password]],
});
}
currentStep = 1
phoneNum: string
currentStep = 1;
phoneNum: string;
step1() {
console.log(this.validateForm)
console.log(this.validateForm);
if (this.validateForm.invalid) {
this.message.create('warning', '请填写完整');
this.message.create("warning", "请填写完整");
} else {
this.http.get('/api/services/app/User/GetPhoneNumber', {
params: {
userName: this.validateForm.value.account
}
}).subscribe({
next: (data: any) => {
this.phoneNum = data.result
this.currentStep = 2
}
})
this.http
.get("/api/services/app/User/GetPhoneNumber", {
params: {
userName: this.validateForm.value.account,
},
})
.subscribe({
next: (data: any) => {
this.phoneNum = data.result;
this.currentStep = 2;
},
});
}
}
//发送验证码
codeCountDown = 0
codeCountDown = 0;
code() {
this.codeCountDown = 30;
let params = {
userName: this.validateForm.value.account,
}
this.http.post('/api/services/app/User/SendVerificationCode', null, { params: params }).subscribe({
next: (data: any) => {
this.message.create('success', '已发送');
//按钮倒计时
this.codeCountDown = 30
let codesetInterval = setInterval(() => {
this.codeCountDown = this.codeCountDown - 1
if (this.codeCountDown == 0) {
clearInterval(codesetInterval)
}
}, 1000);
}
})
};
this.http
.post("/api/services/app/User/SendVerificationCode", null, {
params: params,
})
.subscribe({
next: (data: any) => {
this.message.create("success", "已发送");
//按钮倒计时
let codesetInterval = setInterval(() => {
this.codeCountDown = this.codeCountDown - 1;
if (this.codeCountDown == 0) {
clearInterval(codesetInterval);
}
}, 1000);
},
});
}
step2() {
if (this.validateForm2.invalid) {
this.message.create('warning', '请填写完整');
this.message.create("warning", "请填写完整");
} else {
console.log(this.validateForm.value.account)
console.log(this.validateForm.value.account);
let params = {
userName: this.validateForm.value.account,
code: this.validateForm2.value.code
}
this.http.get('/api/services/app/User/VerifyVerificationCode', { params: params }).subscribe({
next: (data: any) => {
this.currentStep = 3
}
})
code: this.validateForm2.value.code,
};
this.http
.get("/api/services/app/User/VerifyVerificationCode", {
params: params,
})
.subscribe({
next: (data: any) => {
this.currentStep = 3;
},
});
}
}
step3() {
if (this.validateForm3.valid) {
let word = JSON.parse(JSON.stringify(this.validateForm3.value.newpassword)).toLowerCase()
if (this.validateForm3.value.newpassword != this.validateForm3.value.affirmpassword) {
this.message.create('warning', '两次密码输入不一致!');
return false
} if (word.indexOf('sino') != -1 || word.indexOf('zhonghua') != -1) {
this.message.create('warning', '口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符');
return false
let word = JSON.parse(
JSON.stringify(this.validateForm3.value.newpassword)
).toLowerCase();
if (
this.validateForm3.value.newpassword !=
this.validateForm3.value.affirmpassword
) {
this.message.create("warning", "两次密码输入不一致!");
return false;
}
if (word.indexOf("sino") != -1 || word.indexOf("zhonghua") != -1) {
this.message.create(
"warning",
"口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符"
);
return false;
} else {
let body = {
userName: this.validateForm.value.account,
code: this.validateForm2.value.code,
newPassword: this.validateForm3.value.newpassword,
}
this.http.post('/api/services/app/User/ChangePasswordBySms', body).subscribe(data => {
this.message.create('success', '修改成功!');
this.modal.close()
return true
}, err => {
return false
})
};
this.http
.post("/api/services/app/User/ChangePasswordBySms", body)
.subscribe(
(data) => {
this.message.create("success", "修改成功!");
this.modal.close();
return true;
},
(err) => {
return false;
}
);
}
} else {
this.message.create('warning', '请填写完整!');
return false
this.message.create("warning", "请填写完整!");
return false;
}
}
}
import { PatternService } from 'src/app/service/pattern.service';
import { PatternService } from "src/app/service/pattern.service";
export type MyErrorsOptions = { 'zh-cn': string; en: string } & Record<string, NzSafeAny>;
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 {
@ -133,13 +167,26 @@ export class MyValidators extends Validators {
return null;
}
return isPassword(value) ? null : { mobile: { 'zh-cn': PatternService.isProd ? `长度至少 8 位,必须包含大写字母、小写字母、数字、符号四种中的三种,且口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符` : '长度至少 8 位,必须包含大写字母、小写字母、数字、符号四种中的三种', en: `Password phone number is not valid` } };
return isPassword(value)
? null
: {
mobile: {
"zh-cn": PatternService.isProd
? `长度至少 12 位,必须包含大写字母、小写字母、数字、符号四种中的三种,且口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符`
: "长度至少 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_!@#$%^&*`~()-+=]+$)(?!.*[sS][iI][nN][oO].*)(?!.*[zZ][hH][oO][nN][gG][hH][uU][aA].*)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{8,99}$/.test(value);
return (
typeof value === "string" &&
/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)(?!.*[sS][iI][nN][oO].*)(?!.*[zZ][hH][oO][nN][gG][hH][uU][aA].*)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{12,99}$/.test(
value
)
);
}

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

@ -43,7 +43,48 @@
<div class="name">
<img *ngIf="isProd" src="../../../assets/images/logo2.png" alt="">
<img *ngIf="isProd" src="assets/images/logo2.png" alt="">
</div>
</div>
<!-- 修改密码 -->
<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>

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

@ -1,29 +1,43 @@
import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from '../../service/cache-token.service'//引入服务
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';
import { SelectedMenu } from 'src/app/service/selectedMenu.service';
import { NzModalService } from 'ng-zorro-antd/modal';
import { ForgetComponent } from './forget/forget.component';
import { PatternService } from 'src/app/service/pattern.service';
// import { THIS_EXPR } from '@angular/compiler/src/output/output_ast';
import { Component, OnInit, ViewContainerRef } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { Router, ActivatedRoute } from "@angular/router";
import { CacheTokenService } from "../../service/cache-token.service"; //引入服务
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";
import { SelectedMenu } from "src/app/service/selectedMenu.service";
import { NzModalService } from "ng-zorro-antd/modal";
import { ForgetComponent } from "./forget/forget.component";
import { PatternService } from "src/app/service/pattern.service";
declare var abp: any
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss']
selector: "app-login",
templateUrl: "./login.component.html",
styleUrls: ["./login.component.scss"],
})
export class LoginComponent implements OnInit {
validateForm!: FormGroup;
passwordValidateForm!: FormGroup;
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, private fb: FormBuilder, private message: NzMessageService, private notificationService: NzNotificationService, private selectedMenu: SelectedMenu, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private patternService: PatternService) {
constructor(
private http: HttpClient,
private router: Router,
private route: ActivatedRoute,
public token: CacheTokenService,
private fb: FormBuilder,
private message: NzMessageService,
private notificationService: NzNotificationService,
private selectedMenu: SelectedMenu,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private patternService: PatternService
) {
const { password } = MyValidators;
this.validateForm = this.fb.group({
userName: [null, [Validators.required]],
@ -34,224 +48,325 @@ export class LoginComponent implements OnInit {
this.passwordValidateForm = this.fb.group({
oldpassword: [null, [Validators.required]],
newpassword: [null, [Validators.required, password]],
affirmpassword: [null, [Validators.required, password]]
affirmpassword: [null, [Validators.required, password]],
});
}
isProd: boolean
isProd: boolean;
ngOnInit() {
this.isProd = this.patternService.isProd
this.isProd = this.patternService.isProd;
//如果本地储存了账号密码信息,那就回显在输入框
let account = localStorage.getItem('account')
let password = localStorage.getItem('password')
let account = localStorage.getItem("account");
let password = localStorage.getItem("password");
if (account && password) {
this.validateForm.patchValue({
userName: Base64.decode(localStorage.getItem('account')),
password: Base64.decode(localStorage.getItem('password'))
userName: Base64.decode(localStorage.getItem("account")),
password: Base64.decode(localStorage.getItem("password")),
});
this.remember = true //这一步是回显后让勾选框为选中状态
this.remember = true; //这一步是回显后让勾选框为选中状态
}
//自动登录
if (localStorage.getItem('isautologin') == 'true') {
this.submitForm()
this.autologin = true //这一步是回显后让勾选框为选中状态
if (localStorage.getItem("isautologin") == "true") {
this.submitForm();
this.autologin = true; //这一步是回显后让勾选框为选中状态
}
}
errmsg: string = ''; //错误信息
errmsg: string = ""; //错误信息
//跳转注册页面
toRegister() {
this.router.navigate(['/register'])
this.router.navigate(["/register"]);
}
//记住密码
rememberInfo() {
// 判断用户是否勾选记住密码,如果勾选,在本地储存中储存登录信息
if (this.remember) {
localStorage.setItem("account", Base64.encode(this.validateForm.value.userName))
localStorage.setItem("password", Base64.encode(this.validateForm.value.password))
localStorage.setItem(
"account",
Base64.encode(this.validateForm.value.userName)
);
localStorage.setItem(
"password",
Base64.encode(this.validateForm.value.password)
);
}
}
//自动登录
autoLogin() {
if (this.autologin) {
localStorage.setItem("isautologin", 'true')
localStorage.setItem("isautologin", "true");
}
}
remember: any//记住密码
autologin: any//自动登录
remember: any; //记住密码
autologin: any; //自动登录
isLoading = false;
messages
encryptedAccessToken
messages;
encryptedAccessToken;
menu1 = [
{ name: '首页', url: '/homepage' },
{ name: '数字油站', url: '/plan' },
{ name: '今日预警', url: '/todaywarning' },
{ name: '预警记录', url: '/records_nav' },
{ name: '证照管理', url: '/audit' },
]
{ name: "首页", url: "/homepage" },
{ name: "数字油站", url: "/plan" },
{ name: "今日预警", url: "/todaywarning" },
{ name: "预警记录", url: "/records_nav" },
{ name: "证照管理", url: "/audit" },
];
menu2 = [
{ name: '数字油站', url: '/plan/petrolStation' },
{ name: '今日预警', url: '/todaywarning/petrolStation' },
{ name: '预警记录', url: '/records_nav/petrolStation' },
{ name: '证照管理', url: '/license/petrolStation' },
]
init3D
{ name: "数字油站", url: "/plan/petrolStation" },
{ name: "今日预警", url: "/todaywarning/petrolStation" },
{ name: "预警记录", url: "/records_nav/petrolStation" },
{ name: "证照管理", url: "/license/petrolStation" },
];
init3D;
async getGasStationBaseInfo() {
await new Promise((resolve, reject) => {
let params = { organizationUnitId: (JSON.parse(sessionStorage.getItem('userdataOfgasstation'))).organization.id }
this.http.get('/api/services/app/GasStation/Get', { params: params }).subscribe((data: any) => {
resolve(data.result)
let params = {
organizationUnitId: JSON.parse(
sessionStorage.getItem("userdataOfgasstation")
).organization.id,
};
this.http
.get("/api/services/app/GasStation/Get", { params: params })
.subscribe((data: any) => {
resolve(data.result);
sessionStorage.setItem("3dSceneData", JSON.stringify(data.result))
this.init3D = data.result.hasBuildingInfo
})
})
sessionStorage.setItem("3dSceneData", JSON.stringify(data.result));
this.init3D = data.result.hasBuildingInfo;
});
});
}
submitForm(): void {
submitData;
submitForm(): void {
if (!this.remember) {
localStorage.removeItem("account")
localStorage.removeItem("password")
localStorage.removeItem("account");
localStorage.removeItem("password");
}
if (!this.autologin) {
localStorage.removeItem("isautologin")
localStorage.removeItem("isautologin");
}
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
if (!this.validateForm.valid) {
this.message.create('error', `请输入账号密码`);
return
this.message.create("error", `请输入账号密码`);
return;
}
this.isLoading = true;
this.http.post('/api/TokenAuth/Authenticate', {
userNameOrEmailAddress: this.validateForm.value.userName,
password: this.validateForm.value.password
}).subscribe(
(data: any) => {
sessionStorage.setItem("token", data.result.accessToken);
sessionStorage.setItem("encryptedAccessToken", data.result.encryptedAccessToken);
this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe(async (data: any) => {
console.log('GetCurrentLoginInformations', data.result)
if (data.result.user.menus.length == 0) {
this.message.create('error', `当前用户未分配菜单`);
this.isLoading = false
return
}
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;
if (!data.result.user.organization) {
this.message.create('error', `当前用户没有组织机构信息`);
return
}
if (data.result.user.organization.isGasStation) {
await this.getGasStationBaseInfo()
if (data.result.user.menus[0].name == "数字油站" && data.result.user.menus.length == 1 && !this.init3D) {
this.message.create('error', `当前用户油站未开通3D且仅分配油站菜单`);
return
}
}
//记住密码
this.rememberInfo()
//自动登录
this.autoLogin()
this.http
.post("/api/TokenAuth/Authenticate", {
userNameOrEmailAddress: this.validateForm.value.userName,
password: this.validateForm.value.password,
})
.subscribe(
(data: any) => {
sessionStorage.setItem("token", data.result.accessToken);
sessionStorage.setItem(
"encryptedAccessToken",
data.result.encryptedAccessToken
);
this.http
.get("/api/services/app/Session/GetCurrentLoginInformations")
.subscribe(
async (data: any) => {
this.submitData = data;
console.log("GetCurrentLoginInformations", data.result);
if (data.result.user.menus.length == 0) {
this.message.create("error", `当前用户未分配菜单`);
this.isLoading = false;
return;
}
if (data.result.user.organization.isGasStation) {
sessionStorage.setItem("isGasStation", 'true');
let a = sessionStorage.getItem('userdataOfgasstation')
let menuList = this.returnLastMenus(a, this.menu2)
let isTrue = menuList.find((item) => {
return item.name == "今日预警"
});
if (isTrue) {
this.router.navigate(['/todaywarning/petrolStation'])
sessionStorage.setItem('selectedMenu', '今日预警')
} else if (data.result.user.menus[0].name == "数字油站" && !this.init3D) {
this.router.navigate([menuList[1].url])
sessionStorage.setItem('selectedMenu', menuList[1].name)
} else if (menuList.length == 0) {
return this.message.create('warning', `当前用户未分配菜单`);
} else {
this.router.navigate([menuList[0].url])
sessionStorage.setItem('selectedMenu', menuList[0].name)
}
} else {
sessionStorage.setItem("isGasStation", 'false');
let a = sessionStorage.getItem('userdata')
let menuList = this.returnLastMenus(a, this.menu1)
let isTrue = menuList.find((item) => {
return item.name == "首页"
});
if (menuList.length == 0) {
sessionStorage.setItem(
"userdata",
JSON.stringify(data.result.user)
);
sessionStorage.setItem(
"userdataOfgasstation",
JSON.stringify(data.result.user)
);
return this.message.create('warning', `当前用户未分配菜单`);
this.isLoading = false;
if (!data.result.user.organization) {
this.message.create("error", `当前用户没有组织机构信息`);
return;
}
if (data.result.user.organization.isGasStation) {
await this.getGasStationBaseInfo();
if (
data.result.user.menus[0].name == "数字油站" &&
data.result.user.menus.length == 1 &&
!this.init3D
) {
this.message.create(
"error",
`当前用户油站未开通3D且仅分配油站菜单`
);
return;
}
}
//记住密码
this.rememberInfo();
//自动登录
this.autoLogin();
if (
data.result.user.isDefaultPassword ||
data.result.user.isPasswordExpired
) {
this.isLoading = false;
this.changePasswordPopup();
return;
}
}
if (isTrue) {
this.router.navigate(['/homepage'])
sessionStorage.setItem('selectedMenu', '首页')
} else {
this.router.navigate([menuList[0].url])
sessionStorage.setItem('selectedMenu', menuList[0].name)
}
//
//跳转页面
this.toPage(data);
}
this.message.create('success', `登录成功`);
}, err => {
this.message.create("success", `登录成功`);
},
(err) => {
this.isLoading = false;
}
);
},
(err) => {
this.isLoading = false;
})
},
(err) => {
this.isLoading = false;
// this.message.create('error', err.error.error.details);
}
);
}
toPage(data) {
if (data.result.user.organization.isGasStation) {
sessionStorage.setItem("isGasStation", "true");
let a = sessionStorage.getItem("userdataOfgasstation");
let menuList = this.returnLastMenus(a, this.menu2);
let isTrue = menuList.find((item) => {
return item.name == "今日预警";
});
if (isTrue) {
this.router.navigate(["/todaywarning/petrolStation"]);
sessionStorage.setItem("selectedMenu", "今日预警");
} else if (data.result.user.menus[0].name == "数字油站" && !this.init3D) {
this.router.navigate([menuList[1].url]);
sessionStorage.setItem("selectedMenu", menuList[1].name);
} else if (menuList.length == 0) {
return this.message.create("warning", `当前用户未分配菜单`);
} else {
this.router.navigate([menuList[0].url]);
sessionStorage.setItem("selectedMenu", menuList[0].name);
}
)
} else {
sessionStorage.setItem("isGasStation", "false");
let a = sessionStorage.getItem("userdata");
let menuList = this.returnLastMenus(a, this.menu1);
let isTrue = menuList.find((item) => {
return item.name == "首页";
});
if (menuList.length == 0) {
return this.message.create("warning", `当前用户未分配菜单`);
}
if (isTrue) {
this.router.navigate(["/homepage"]);
sessionStorage.setItem("selectedMenu", "首页");
} else {
this.router.navigate([menuList[0].url]);
sessionStorage.setItem("selectedMenu", menuList[0].name);
}
//
}
}
returnLastMenus(data, originalMenus) {
let userMenu = JSON.parse(data).menus
let tap = []
let menuList = []
let userMenu = JSON.parse(data).menus;
let tap = [];
let menuList = [];
for (let index = 0; index < userMenu.length; index++) {
let a = userMenu[index].name
tap.push(a)
let a = userMenu[index].name;
tap.push(a);
}
for (let index = 0; index < originalMenus.length; index++) {
for (let k = 0; k < tap.length; k++) {
if (tap[k] == originalMenus[index].name) {
menuList.push(originalMenus[index])
menuList.push(originalMenus[index]);
}
}
}
return menuList
return menuList;
}
forget() {
// this.message.create('warning', `请联系管理员`);
this.modal.create({
nzTitle: '忘记密码',
nzTitle: "忘记密码",
nzContent: ForgetComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 288,
nzComponentParams: {},
nzFooter: null
nzFooter: null,
});
}
//初次登陆修改密码弹窗
isVisible = false;
isConfirmLoading = false;
changePasswordPopup() {
this.isVisible = true;
}
handleOk(): void {
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) => {
//记住密码
if (this.remember) {
localStorage.setItem(
"account",
Base64.encode(this.validateForm.value.userName)
);
localStorage.setItem(
"password",
Base64.encode(this.passwordValidateForm.value.newpassword)
);
}
//自动登录
this.autoLogin();
this.message.create("success", "修改成功!");
this.isConfirmLoading = false;
this.isVisible = false;
this.toPage(this.submitData);
},
(err) => {
this.message.create("warning", err.error.error.message);
this.isConfirmLoading = false;
}
);
}
}
}
}
export type MyErrorsOptions = { 'zh-cn': string; en: string } & Record<string, NzSafeAny>;
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 {
@ -261,14 +376,24 @@ export class MyValidators extends Validators {
return null;
}
return isPassword(value) ? null : { mobile: { 'zh-cn': `长度至少 8 位,必须包含大写字母、小写字母、数字、符号四种中的三种`, en: `Password phone number is not valid` } };
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_!@#$%^&*`~()-+=]{8,99}$/.test(value);
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
)
);
}

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

@ -1,25 +1,31 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service';
import { NzMessageService } from 'ng-zorro-antd/message';
import * as moment from 'moment';
import Viewer from 'viewerjs';
import { Router, ActivatedRoute } from '@angular/router'
import { HttpClient } from "@angular/common/http";
import { Component, OnInit } from "@angular/core";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { ObjectsSimpleService } from "src/app/service/objectsSimple.service";
import { NzMessageService } from "ng-zorro-antd/message";
import * as moment from "moment";
import Viewer from "viewerjs";
import { Router, ActivatedRoute } from "@angular/router";
@Component({
selector: 'app-oil-station-info',
templateUrl: './oil-station-info.component.html',
styleUrls: ['./oil-station-info.component.scss']
selector: "app-oil-station-info",
templateUrl: "./oil-station-info.component.html",
styleUrls: ["./oil-station-info.component.scss"],
})
export class OilStationInfoComponent implements OnInit {
validateForm!: FormGroup;
constructor(private router: Router, private fb: FormBuilder, private objectsSrv: ObjectsSimpleService, private http: HttpClient, private message: NzMessageService, public route: ActivatedRoute) { }
userdata: any
dateFormat = 'yyyy-MM-dd';
constructor(
private router: Router,
private fb: FormBuilder,
private objectsSrv: ObjectsSimpleService,
private http: HttpClient,
private message: NzMessageService,
public route: ActivatedRoute
) {}
userdata: any;
dateFormat = "yyyy-MM-dd";
ngOnInit(): void {
this.userdata = JSON.parse(sessionStorage.getItem('userdata'))
this.userdata = JSON.parse(sessionStorage.getItem("userdata"));
this.validateForm = this.fb.group({
oilStation: this.fb.group({
organization: [],
@ -40,243 +46,306 @@ export class OilStationInfoComponent implements OnInit {
name: [null],
address: [null],
distance: [null],
contactInformation: [null]
contactInformation: [null],
}),
hospital: this.fb.group({
name: [null],
address: [null],
distance: [null],
contactInformation: [null]
contactInformation: [null],
}),
fireBrigade: this.fb.group({
name: [null],
address: [null],
distance: [null],
contactInformation: [null]
})
contactInformation: [null],
}),
});
this.getInfo()
this.getInfo();
}
//获取油站信息
// gallery
getInfo() {
this.http.get('/api/services/app/GasStation/Get', {
params: {
organizationUnitId: this.route.snapshot.queryParams.id
}
}).subscribe((data: any) => {
this.httpBody.locationName ? null : this.httpBody.locationName = this.httpBody.proposalAreaName
this.httpBody.companyName ? null : this.httpBody.companyName = this.httpBody.proposalCompanyName
if (new Date(data.result.openTime).getTime() == -62135625943000) {
data.result.openTime = null
}
this.httpBody = data.result
if (!this.httpBody.govUnitDetail) {
this.httpBody.govUnitDetail = {
policeStation: {},
hospital: {},
fireBrigade: {}
this.http
.get("/api/services/app/GasStation/Get", {
params: {
organizationUnitId: this.route.snapshot.queryParams.id,
},
})
.subscribe(
(data: any) => {
this.httpBody.locationName
? null
: (this.httpBody.locationName = this.httpBody.proposalAreaName);
this.httpBody.companyName
? null
: (this.httpBody.companyName = this.httpBody.proposalCompanyName);
if (new Date(data.result.openTime).getTime() == -62135625943000) {
data.result.openTime = null;
}
this.httpBody = data.result;
if (!this.httpBody.govUnitDetail) {
this.httpBody.govUnitDetail = {
policeStation: {},
hospital: {},
fireBrigade: {},
};
} else {
this.httpBody.govUnitDetail = JSON.parse(data.result.govUnitDetail);
this.policeStation = data.result.govUnitDetail.policeStation;
this.hospital = data.result.govUnitDetail.hospital;
this.fireBrigade = data.result.govUnitDetail.fireBrigade;
}
if (this.httpBody.otherData) {
this.otherInfoData = JSON.parse(this.httpBody.otherData);
}
console.log("油站信息", this.httpBody);
},
(err) => {
console.log("油站错误信息", err.error.error.message);
}
} else {
this.httpBody.govUnitDetail = JSON.parse(data.result.govUnitDetail)
this.policeStation = data.result.govUnitDetail.policeStation
this.hospital = data.result.govUnitDetail.hospital
this.fireBrigade = data.result.govUnitDetail.fireBrigade
}
if (this.httpBody.otherData) {
this.otherInfoData = JSON.parse(this.httpBody.otherData)
}
console.log('油站信息', this.httpBody)
}, err => {
console.log('油站错误信息', err.error.error.message)
})
);
}
exportExcel() {
const httpOptions = {
responseType: 'blob' as 'json'
responseType: "blob" as "json",
};
this.http.get(`/api/services/app/GasStation/ExportExcelFile?gasStationId=${this.httpBody.id}`, httpOptions).subscribe((data: any) => {
// console.log('导出成功')
// 文件名中有中文 则对文件名进行转码
const link = document.createElement('a');
const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
link.setAttribute('href', window.URL.createObjectURL(blob));
link.setAttribute('download', this.httpBody.stationName + '基本信息' + '.xls');
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create('success', '导出成功!');
}, err => {
this.message.create('error', '导出失败!');
})
this.http
.get(
`/api/services/app/GasStation/ExportExcelFile?gasStationId=${this.httpBody.id}`,
httpOptions
)
.subscribe(
(data: any) => {
// console.log('导出成功')
// 文件名中有中文 则对文件名进行转码
const link = document.createElement("a");
const blob = new Blob([data], { type: "application/vnd.ms-excel" });
link.setAttribute("href", window.URL.createObjectURL(blob));
link.setAttribute(
"download",
this.httpBody.stationName + "基本信息" + ".xls"
);
link.style.visibility = "hidden";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create("success", "导出成功!");
},
(err) => {
this.message.create("error", "导出失败!");
}
);
}
policeStation = {
name: '',
address: '',
distance: '',
contactInformation: ''
}
name: "",
address: "",
distance: "",
contactInformation: "",
};
hospital = {
name: '',
address: '',
distance: '',
contactInformation: ''
}
name: "",
address: "",
distance: "",
contactInformation: "",
};
fireBrigade = {
name: '',
address: '',
distance: '',
contactInformation: ''
}
name: "",
address: "",
distance: "",
contactInformation: "",
};
httpBody = {
id: null,
stationName: JSON.parse(sessionStorage.getItem('userdata')).organization.displayName,
organizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
stationName: JSON.parse(sessionStorage.getItem("userdata")).organization
.displayName,
organizationUnitId: JSON.parse(sessionStorage.getItem("userdata"))
.organization.id,
auditLog: {
auditStatusDesc: null,
rejectReason: null
rejectReason: null,
},
auditStatus: null,
openTime: '',
stationType: '',
laneCount: '',
address: '',
locationName: '',
companyName: '',
leaderName: '',
proposalAreaName: '',
proposalCompanyName: '',
leaderContact: '',
stationLevel: '',
sellVariety: '',
gasStationCount: '',
tankVolume: '',
openTime: "",
stationType: "",
laneCount: "",
address: "",
locationName: "",
companyName: "",
leaderName: "",
proposalAreaName: "",
proposalCompanyName: "",
leaderContact: "",
stationLevel: "",
sellVariety: "",
gasStationCount: "",
tankVolume: "",
govUnitDetail: {
policeStation: {},
hospital: {},
fireBrigade: {}
fireBrigade: {},
},
hasBuildingInfo: true,
businessLicenseImage: '',
dangerousChemicalLicenseImage: '',
gasSellLicenseImage: '',
licenses: [
],
otherData: null
}
businessLicenseImage: "",
dangerousChemicalLicenseImage: "",
gasSellLicenseImage: "",
licenses: [],
otherData: null,
};
otherInfoData = {
oilingMachine: [
{ name: '', brand: '', oilGunNum: '', oilsArticleNum: '', oilGunSerialNum: '' }
{
name: "",
brand: "",
oilGunNum: "",
oilsArticleNum: "",
oilGunSerialNum: "",
},
],
tankEquipment: [
{ name: '', oilsArticleNum: '', oilGunSerialNum: '', oilOmeterVolume: '', safetyVolume: '', oilOmeterType: 0, oilPumpType: 0 }
{
name: "",
oilsArticleNum: "",
oilGunSerialNum: "",
oilOmeterVolume: "",
safetyVolume: "",
oilOmeterType: 0,
oilPumpType: 0,
},
],
oilDeliveryPipe: [
{ name: '', connectTanker: '', connectOilTank: '', designPaper: '' }
{ name: "", connectTanker: "", connectOilTank: "", designPaper: "" },
],
oilVaporRecovery: [
{ name: '油气回收管线', onceSystemType: '将卸油时产生的油气进行回收', twiceSystemType: 1, twicePumpType: 'mini9000', thriceProcessingUnit: '冷凝+吸附', monitoringDevice: '监测气液比、密闭性,出现异常可及时预警', designPaper: '' }
{
name: "油气回收管线",
onceSystemType: "将卸油时产生的油气进行回收",
twiceSystemType: 1,
twicePumpType: "mini9000",
thriceProcessingUnit: "冷凝+吸附",
monitoringDevice: "监测气液比、密闭性,出现异常可及时预警",
designPaper: "",
},
],
valve: [
{ name: 'P/V阀(机械呼吸阀)', description: '阀内设计双向开启功能,阀门处于常闭状态,当油罐压力/真空达到阀门预设压力/真空值时,阀门自行打开进行排气/吸气,以维持油罐内压力与大气压保持平衡。' }
]
}
{
name: "P/V阀(机械呼吸阀)",
description:
"阀内设计双向开启功能,阀门处于常闭状态,当油罐压力/真空达到阀门预设压力/真空值时,阀门自行打开进行排气/吸气,以维持油罐内压力与大气压保持平衡。",
},
],
};
addTable(tableData, type) {
if (type == 'oilingMachine') {
tableData.push({ name: '', brand: '', oilGunNum: '', oilsArticleNum: '', oilGunSerialNum: '' })
if (type == "oilingMachine") {
tableData.push({
name: "",
brand: "",
oilGunNum: "",
oilsArticleNum: "",
oilGunSerialNum: "",
});
}
if (type == 'tankEquipment') {
tableData.push({ name: '', oilsArticleNum: '', oilGunSerialNum: '', oilOmeterVolume: '', safetyVolume: '', oilOmeterType: 0, oilPumpType: 0 })
if (type == "tankEquipment") {
tableData.push({
name: "",
oilsArticleNum: "",
oilGunSerialNum: "",
oilOmeterVolume: "",
safetyVolume: "",
oilOmeterType: 0,
oilPumpType: 0,
});
}
if (type == 'oilDeliveryPipe') {
tableData.push({ name: '', connectTanker: '', connectOilTank: '', designPaper: '' })
if (type == "oilDeliveryPipe") {
tableData.push({
name: "",
connectTanker: "",
connectOilTank: "",
designPaper: "",
});
}
}
deleteTable(tableData, key) {
tableData.splice(key, 1)
tableData.splice(key, 1);
}
uploadType: string
isUploadLoading = false
uploadType: string;
isUploadLoading = false;
filechange(e, type, item) {
this.isUploadLoading = true
let file = e.target.files[0] || null //获取上传的文件
this.uploadType = type
this.openFileSelect(file, `stationPhotos/${this.route.snapshot.queryParams.id}/`, item)
this.isUploadLoading = true;
let file = e.target.files[0] || null; //获取上传的文件
this.uploadType = type;
this.openFileSelect(
file,
`stationPhotos/${this.route.snapshot.queryParams.id}/`,
item
);
}
//设置文件路径并上传
postFilePath
postFilePath;
async openFileSelect(file: File, extensionPath: string, item) {
this.postFilePath = extensionPath;
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB 超过5MB要分块上传
if (fileSize >= shardSize) // 超过5MB要分块上传
{
let fileSize = file.size || null; //上传文件的总大小
let shardSize = 5 * 1024 * 1024; //5MB 超过5MB要分块上传
if (fileSize >= shardSize) {
// 超过5MB要分块上传
await this.postFileByMul(file, item);
}
else //普通上传
{
} //普通上传
else {
await this.postFile(file, item);
}
}
//上传文件
async postFile(file: File, item) {
await new Promise((resolve, reject) => {
this.objectsSrv.postFile(this.postFilePath, file).subscribe(data => {
this.objectsSrv.postFile(this.postFilePath, file).subscribe((data) => {
let dataObj = data as any;
let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName;
item.designPaper = filePath
this.isUploadLoading = false
resolve('success')
let filePath: string =
ObjectsSimpleService.baseUrl + dataObj.objectName;
item.designPaper = filePath;
this.isUploadLoading = false;
resolve("success");
});
})
});
}
/**
*
* @param file
*/
postFileByMul(file: File, item) {
this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => {
let dataObj = value as any;
item.designPaper = dataObj.filePath
this.isUploadLoading = false
});
this.objectsSrv
.postFile_MultipartUpload(this.postFilePath, file)
.then((value) => {
let dataObj = value as any;
item.designPaper = dataObj.filePath;
this.isUploadLoading = false;
});
}
//查看图片
viewImg(url) {
let dom = document.getElementById(`viewerjs`)
let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes;
let node = document.createElement("img")
let node = document.createElement("img");
node.style.display = "none";
node.src = url;
node.id = 'img'
dom.appendChild(node)
node.id = "img";
dom.appendChild(node);
setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => {
dom.removeChild(pObjs[0]);
viewer.destroy();
}
},
});
node.click();
}, 0);
@ -286,78 +355,92 @@ export class OilStationInfoComponent implements OnInit {
history.go(-1);
}
isLoadingSave: boolean = false
isLoadingSave: boolean = false;
async submitForm() {
if (this.validateForm.valid) {
this.isLoadingSave = true
this.httpBody.openTime = moment(this.httpBody.openTime).format('YYYY-MM-DD')//开业时间格式化
this.httpBody.govUnitDetail.policeStation = this.validateForm.value.policeStation
this.httpBody.govUnitDetail.hospital = this.validateForm.value.hospital
this.httpBody.govUnitDetail.fireBrigade = this.validateForm.value.fireBrigade
let body = JSON.parse(JSON.stringify(this.httpBody))
body.stationType
body.govUnitDetail = JSON.stringify(this.httpBody.govUnitDetail)
this.isLoadingSave = true;
this.httpBody.openTime = moment(this.httpBody.openTime).format(
"YYYY-MM-DD"
); //开业时间格式化
this.httpBody.govUnitDetail.policeStation =
this.validateForm.value.policeStation;
this.httpBody.govUnitDetail.hospital = this.validateForm.value.hospital;
this.httpBody.govUnitDetail.fireBrigade =
this.validateForm.value.fireBrigade;
let body = JSON.parse(JSON.stringify(this.httpBody));
body.stationType;
body.govUnitDetail = JSON.stringify(this.httpBody.govUnitDetail);
if (!body.hasBuildingInfo) {
body.otherData = JSON.stringify(this.otherInfoData)
body.otherData = JSON.stringify(this.otherInfoData);
}
body.licenses.forEach(item => {
delete item.isPerpetual
})
body.licenses.forEach((item) => {
delete item.isPerpetual;
});
// body.stationName = "太原东服务区东区加油站";
await new Promise<void>((resolve, reject) => {
this.http.put('/api/services/app/GasStation/Update', body).subscribe((data: any) => {
resolve(data)
this.isLoadingSave = false
this.message.create('success', '保存成功!');
}, err => {
reject(err)
this.isLoadingSave = false
this.message.create('error', '保存失败!');
})
})
this.http.put("/api/services/app/GasStation/Update", body).subscribe(
(data: any) => {
resolve(data);
this.isLoadingSave = false;
this.message.create("success", "保存成功!");
},
(err) => {
reject(err);
this.isLoadingSave = false;
this.message.create("error", "保存失败!");
}
);
});
} else {
this.message.create('warning', '请填写完整!');
return false
this.message.create("warning", "请填写完整!");
return false;
}
}
isSubmitAuditLoading: boolean = false
isSubmitAuditLoading: boolean = false;
async submitAudit() {
await this.submitForm()
await this.submitForm();
if (this.validateForm.valid) {
let params = {
id: this.httpBody.id
}
this.http.post('/api/services/app/GasStation/Commit', null, { params: params }).subscribe((data: any) => {
this.isSubmitAuditLoading = false
this.getInfo()
this.message.create('success', '提交审核成功!');
}, err => {
this.isSubmitAuditLoading = false
this.message.create('error', '提交审核失败!');
})
id: this.httpBody.id,
};
this.http
.post("/api/services/app/GasStation/Commit", null, { params: params })
.subscribe(
(data: any) => {
this.isSubmitAuditLoading = false;
this.getInfo();
this.message.create("success", "提交审核成功!");
},
(err) => {
this.isSubmitAuditLoading = false;
this.message.create("error", "提交审核失败!");
}
);
}
}
isRevocationAuditLoading: boolean = false
isRevocationAuditLoading: boolean = false;
revocationAudit() {
let params = {
id: this.httpBody.id
}
this.http.post('/api/services/app/GasStation/Uncommit', null, { params: params }).subscribe((data: any) => {
this.isRevocationAuditLoading = false
this.getInfo()
this.message.create('success', '撤销审核成功!');
}, err => {
this.isRevocationAuditLoading = false
this.message.create('error', '撤销审核失败!');
})
id: this.httpBody.id,
};
this.http
.post("/api/services/app/GasStation/Uncommit", null, { params: params })
.subscribe(
(data: any) => {
this.isRevocationAuditLoading = false;
this.getInfo();
this.message.create("success", "撤销审核成功!");
},
(err) => {
this.isRevocationAuditLoading = false;
this.message.create("error", "撤销审核失败!");
}
);
}
}

10
src/app/pages/oil-unloading-process/anxin-img-look/anxin-img-look.component.ts

@ -40,7 +40,7 @@ export class AnxinImgLookComponent implements OnInit {
legendList: any = [];
typeArr = [
{ id: 0, name: "工装", color: "#91CCFF" },
{ id: 2, name: "便装", color: "#46DFFF" },
{ id: 1, name: "便装", color: "#46DFFF" },
{ id: 2, name: "抽烟", color: "#36A2FF" },
{ id: 3, name: "打电话", color: "#FF6181" },
{ id: 4, name: "隔离锥", color: "#000000" },
@ -54,6 +54,14 @@ export class AnxinImgLookComponent implements OnInit {
{ id: 12, name: "卸油车", color: "yellow" },
{ id: 13, name: "私家车", color: "black" },
{ id: 14, name: "断开的卸油管", color: "blue" },
{ id: 15, name: "烟雾预警", color: "#B4C3FF" },
{ id: 16, name: "火灾报警", color: "red" },
{ id: 17, name: "延长工装", color: "blue" },
{ id: 18, name: "江苏工装", color: "blue" },
{ id: 19, name: "经理工装", color: "yellow" },
{ id: 20, name: "江苏道达尔工装", color: "yellow" },
{ id: 21, name: "延长壳牌工装", color: "red" },
{ id: 22, name: "山西高速工装", color: "red" },
];
userName; //登录账号的用户名

109
src/app/pages/pages-routing.module.ts

@ -1,54 +1,69 @@
import { Routes, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { PlanComponent } from './plan/plan.component';
import { TodayWarningComponent } from './today-warning/today-warning.component';
import { CriminalRecordsComponent } from './records/criminal-records/criminal-records.component';
import { AuthGuard } from '../auth.guard'
import { TodayWarningAdminComponent } from './today-warning-admin/today-warning-admin.component';
import { CriminalRecordsAdminComponent } from './records/criminal-records-admin/criminal-records-admin.component';
import { OilStationInfoComponent } from './oil-station-info/oil-station-info.component';
import { EquipmentInfoComponent } from './equipment-info/equipment-info.component';
import { PlanAdminComponent } from './plan-admin/plan-admin.component';
import { HomePageComponent } from './home-page/home-page.component';
import { OilUnloadingProcessListComponent } from './records/oil-unloading-process-list/oil-unloading-process-list.component';
import { init3DGuard } from './init3D.guard';
import { Routes, RouterModule } from "@angular/router";
import { NgModule } from "@angular/core";
import { PlanComponent } from "./plan/plan.component";
import { TodayWarningComponent } from "./today-warning/today-warning.component";
import { CriminalRecordsComponent } from "./records/criminal-records/criminal-records.component";
import { AuthGuard } from "../auth.guard";
import { TodayWarningAdminComponent } from "./today-warning-admin/today-warning-admin.component";
import { CriminalRecordsAdminComponent } from "./records/criminal-records-admin/criminal-records-admin.component";
import { OilStationInfoComponent } from "./oil-station-info/oil-station-info.component";
import { EquipmentInfoComponent } from "./equipment-info/equipment-info.component";
import { PlanAdminComponent } from "./plan-admin/plan-admin.component";
import { HomePageComponent } from "./home-page/home-page.component";
import { OilUnloadingProcessListComponent } from "./records/oil-unloading-process-list/oil-unloading-process-list.component";
import { init3DGuard } from "./init3D.guard";
import { NavBarComponent } from './license/nav-bar/nav-bar.component';
import { AuditNavComponent } from './audit/audit-nav/audit-nav.component';
import { WarningStatisticsListComponent } from './records/warning-statistics-list/warning-statistics-list.component';
import { RecordsNavComponent } from './records/records-nav/records-nav.component';
import { DownImageComponent } from './down-image/down-image.component'
import { NavBarComponent } from "./license/nav-bar/nav-bar.component";
import { AuditNavComponent } from "./audit/audit-nav/audit-nav.component";
import { WarningStatisticsListComponent } from "./records/warning-statistics-list/warning-statistics-list.component";
import { RecordsNavComponent } from "./records/records-nav/records-nav.component";
import { DownImageComponent } from "./down-image/down-image.component";
import { HomePageComprehensiveComponent } from "./home-page-comprehensive/home-page-comprehensive.component";
const routes: Routes = [
{ path: 'homepage', component: HomePageComponent },
{ path: 'plan', component: PlanAdminComponent },
{ path: 'plan/petrolStation', component: PlanComponent, canActivate: [init3DGuard], },
{ path: 'todaywarning', component: TodayWarningAdminComponent },
{ path: 'todaywarning/petrolStation', component: TodayWarningComponent },
{
path: 'records_nav', component: RecordsNavComponent, children: [
{ path: 'all', component: CriminalRecordsAdminComponent },
{ path: 'oliunloadinglist', component: OilUnloadingProcessListComponent },
{ path: 'warningstatisticslist', component: WarningStatisticsListComponent },
]
},
{
path: 'records_nav/petrolStation', component: RecordsNavComponent, children: [
{ path: 'all', component: CriminalRecordsComponent },
{ path: 'oliunloadinglist', component: OilUnloadingProcessListComponent },
{ path: 'warningstatisticslist', component: WarningStatisticsListComponent }
]
},
{ path: 'equipmentInfo', component: EquipmentInfoComponent },
{ path: 'oliStationInfo', component: OilStationInfoComponent },
{ path: 'license/petrolStation', component: NavBarComponent },
{ path: 'audit', component: AuditNavComponent },
{ path: 'downImage', component: DownImageComponent }
{ path: "homepage", component: HomePageComponent },
{ path: "comprehensive", component: HomePageComprehensiveComponent },
{ path: "plan", component: PlanAdminComponent },
{
path: "plan/petrolStation",
component: PlanComponent,
canActivate: [init3DGuard],
},
{ path: "todaywarning", component: TodayWarningAdminComponent },
{ path: "todaywarning/petrolStation", component: TodayWarningComponent },
{
path: "records_nav",
component: RecordsNavComponent,
children: [
{ path: "all", component: CriminalRecordsAdminComponent },
{ path: "oliunloadinglist", component: OilUnloadingProcessListComponent },
{
path: "warningstatisticslist",
component: WarningStatisticsListComponent,
},
],
},
{
path: "records_nav/petrolStation",
component: RecordsNavComponent,
children: [
{ path: "all", component: CriminalRecordsComponent },
{ path: "oliunloadinglist", component: OilUnloadingProcessListComponent },
{
path: "warningstatisticslist",
component: WarningStatisticsListComponent,
},
],
},
{ path: "equipmentInfo", component: EquipmentInfoComponent },
{ path: "oliStationInfo", component: OilStationInfoComponent },
{ path: "license/petrolStation", component: NavBarComponent },
{ path: "audit", component: AuditNavComponent },
{ path: "downImage", component: DownImageComponent },
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class PagesRoutingModule { }
export class PagesRoutingModule {}

4
src/app/pages/pages.module.ts

@ -94,10 +94,12 @@ import { HomePageNologinComponent } from './home-page-nologin/home-page-nologin.
import { DownImageComponent } from './down-image/down-image.component';
import { ImgLookComponent } from './audit/img-look/img-look.component';
import { AnxinImgLookComponent } from './oil-unloading-process/anxin-img-look/anxin-img-look.component';
import { SingleloginComponent } from './singlelogin/singlelogin.component';
import { HomePageComprehensiveComponent } from './home-page-comprehensive/home-page-comprehensive.component';
@NgModule({
declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent,
TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent,
AddequipmentComponent, EditequipmentComponent, PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent, ChangePasswordComponent, FacilitySortPipe, WarningStatisticsListComponent, DisposeequipmentComponent, NavBarComponent, InformComponent, UpdateCategoryComponent, FileCategoryComponent, HistoriesComponent, EditUpdateCategoryComponent, DetailsUpdateCategoryComponent, EditFileCategoryComponent, DetailsFileCategoryComponent, PdfWordLookComponent, OilStationListComponent, UpdateLicenseListComponent, FileLicenseListComponent, AuditNavComponent, AuditIngComponent, AuditRecordComponent, AuditInformTimeComponent, AuditDisposeComponent, EditInformTimeComponent, AuditDetailsInformTimeComponent, auditStatusPipe, GasBaseInfoComponent, notificationContent, licenseViolationType, handleState, AnnualInspectionComponent, EditAnnualInspectionComponent, RecordsNavComponent, UserDetailsComponent, AppealDetailsComponent, fileName, SystemModelComponent, ForgetComponent, HomePageNologinComponent, DownImageComponent, ImgLookComponent, AnxinImgLookComponent],
AddequipmentComponent, EditequipmentComponent, PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent, ChangePasswordComponent, FacilitySortPipe, WarningStatisticsListComponent, DisposeequipmentComponent, NavBarComponent, InformComponent, UpdateCategoryComponent, FileCategoryComponent, HistoriesComponent, EditUpdateCategoryComponent, DetailsUpdateCategoryComponent, EditFileCategoryComponent, DetailsFileCategoryComponent, PdfWordLookComponent, OilStationListComponent, UpdateLicenseListComponent, FileLicenseListComponent, AuditNavComponent, AuditIngComponent, AuditRecordComponent, AuditInformTimeComponent, AuditDisposeComponent, EditInformTimeComponent, AuditDetailsInformTimeComponent, auditStatusPipe, GasBaseInfoComponent, notificationContent, licenseViolationType, handleState, AnnualInspectionComponent, EditAnnualInspectionComponent, RecordsNavComponent, UserDetailsComponent, AppealDetailsComponent, fileName, SystemModelComponent, ForgetComponent, HomePageNologinComponent, DownImageComponent, ImgLookComponent, AnxinImgLookComponent, SingleloginComponent, HomePageComprehensiveComponent],
imports: [

14
src/app/pages/plan-admin/file-license-list/file-license-list.component.ts

@ -88,8 +88,10 @@ export class FileLicenseListComponent implements OnInit {
async getAllOrganization() {
let OrganizationUnitId = JSON.parse(sessionStorage.getItem("userdata"))
.organization.id;
let OrganizationUnitIds = JSON.parse(
sessionStorage.getItem("userdata")
).organizations?.map((v) => v.id);
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true",
};
await new Promise((resolve, reject) => {
@ -99,8 +101,14 @@ export class FileLicenseListComponent implements OnInit {
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (element.id == OrganizationUnitId) {
element.parentId = null;
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(element.id)) {
element.parentId = null;
}
} else {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
}
element.key = element.id;
element.title = element.displayName;

226
src/app/pages/plan-admin/plan-admin.component.ts

@ -1,161 +1,175 @@
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzContextMenuService, NzDropdownMenuComponent } from 'ng-zorro-antd/dropdown';
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNode } from 'ng-zorro-antd/tree';
import { Router } from '@angular/router';
import { NavChangeService } from 'src/app/service/navChange.service';
import { fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { OilStationListComponent } from './oil-station-list/oil-station-list.component';
import { UpdateLicenseListComponent } from './update-license-list/update-license-list.component';
import { FileLicenseListComponent } from './file-license-list/file-license-list.component';
import { Component, OnInit, ViewChild, ElementRef } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { TreeService } from "src/app/service/tree.service";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import {
NzContextMenuService,
NzDropdownMenuComponent,
} from "ng-zorro-antd/dropdown";
import {
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNode,
} from "ng-zorro-antd/tree";
import { Router } from "@angular/router";
import { NavChangeService } from "src/app/service/navChange.service";
import { fromEvent } from "rxjs";
import { debounceTime } from "rxjs/operators";
import { OilStationListComponent } from "./oil-station-list/oil-station-list.component";
import { UpdateLicenseListComponent } from "./update-license-list/update-license-list.component";
import { FileLicenseListComponent } from "./file-license-list/file-license-list.component";
@Component({
selector: 'app-plan-admin',
templateUrl: './plan-admin.component.html',
styleUrls: ['./plan-admin.component.scss']
selector: "app-plan-admin",
templateUrl: "./plan-admin.component.html",
styleUrls: ["./plan-admin.component.scss"],
})
export class PlanAdminComponent implements OnInit {
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
@ViewChild('child') oilStationListComponent!: OilStationListComponent;;
@ViewChild('child2') updateLicenseListComponent!: UpdateLicenseListComponent;;
@ViewChild('child3') fileLicenseListComponent!: FileLicenseListComponent;;
constructor(private element: ElementRef, private navChangeService: NavChangeService, private http: HttpClient, private toTree: TreeService, private fb: FormBuilder, private nzContextMenuService: NzContextMenuService, private router: Router) { }
@ViewChild("nzTreeComponent", { static: false })
nzTreeComponent!: NzTreeComponent;
@ViewChild("child") oilStationListComponent!: OilStationListComponent;
@ViewChild("child2") updateLicenseListComponent!: UpdateLicenseListComponent;
@ViewChild("child3") fileLicenseListComponent!: FileLicenseListComponent;
constructor(
private element: ElementRef,
private navChangeService: NavChangeService,
private http: HttpClient,
private toTree: TreeService,
private fb: FormBuilder,
private nzContextMenuService: NzContextMenuService,
private router: Router
) {}
ngOnInit(): void {
this.getAllOrganization()
this.getAllOrganization();
}
//选择右侧tab页
selectedTab = 0
selectedTab = 0;
selectTab(index) {
this.selectedTab = index
this.selectedTab = index;
if (this.selectedTab == 0) {
setTimeout(() => {
this.oilStationListComponent.list = []
this.oilStationListComponent.SkipCount = '0'
this.oilStationListComponent.onChildMethod()
this.oilStationListComponent.list = [];
this.oilStationListComponent.SkipCount = "0";
this.oilStationListComponent.onChildMethod();
}, 0);
}
if (this.selectedTab == 1) {
setTimeout(() => {
this.updateLicenseListComponent.list = []
this.updateLicenseListComponent.SkipCount = '0'
this.updateLicenseListComponent.onChildMethod()
this.updateLicenseListComponent.list = [];
this.updateLicenseListComponent.SkipCount = "0";
this.updateLicenseListComponent.onChildMethod();
}, 0);
}
if (this.selectedTab == 2) {
setTimeout(() => {
this.fileLicenseListComponent.list = []
this.fileLicenseListComponent.SkipCount = '0'
this.fileLicenseListComponent.onChildMethod()
this.fileLicenseListComponent.list = [];
this.fileLicenseListComponent.SkipCount = "0";
this.fileLicenseListComponent.onChildMethod();
}, 0);
}
}
//获取所有组织机构
nodes: any = []
nzExpandAll = false
nzSelectedKeys: any = []
orSpin: boolean = false
organization: any
nodes: any = [];
nzExpandAll = false;
nzSelectedKeys: any = [];
orSpin: boolean = false;
organization: any;
getAllOrganization() {
this.orSpin = true
let OrganizationUnitId = JSON.parse(sessionStorage.getItem('userdata')).organization.id
this.orSpin = true;
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true"
}
this.http.get('/api/services/app/Organization/GetAll', {
params: params
}).subscribe((data: any) => {
data.result.items = data.result.items.filter((item, i) => {
return !item.isGasStation
IsContainsChildren: "true",
};
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
this.organization = data.result.items
this.getStationsNum(data.result.items)
})
.subscribe((data: any) => {
this.organization = data.result.items;
this.getStationsNum(data.result.items);
});
}
//获得组织机构下有多少油站
stationsList
getStationsNum(e) {
let OrganizationUnitId = JSON.parse(sessionStorage.getItem('userdata')).organization.id
this.http.get('/api/services/app/GasStation/GetCountsByOrganizations?IsContainsChildren=true').subscribe((data: any) => {
this.stationsList = data.result
const arrs = e.map(item => {
const data = this.stationsList.find(i => item.id == i.organizationId)
return {
...item,
products: data ? data : false
}
})
for (let index = 0; index < arrs.length; index++) {
if (arrs[index].id == OrganizationUnitId) {
arrs[index].parentId = null
stationsList;
getStationsNum(currentOrList) {
console.log("e", currentOrList);
let OrganizationUnitId = JSON.parse(sessionStorage.getItem("userdata"))
.organization.id;
let OrganizationUnitIds = JSON.parse(
sessionStorage.getItem("userdata")
).organizations.map((v) => v.id);
this.http
.get(
"/api/services/app/GasStation/GetCountsByOrganizations?IsContainsChildren=true"
)
.subscribe((data: any) => {
this.stationsList = data.result;
const arrs = currentOrList.map((item) => {
const data = this.stationsList.find(
(i) => item.id == i.organizationId
);
return {
...item,
products: data ? data : false,
};
});
for (let index = 0; index < arrs.length; index++) {
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(arrs[index].id)) {
arrs[index].parentId = null;
}
} else {
if (arrs[index].id == OrganizationUnitId) {
arrs[index].parentId = null;
}
}
arrs[index].title = arrs[index].displayName;
arrs[index].key = arrs[index].id;
}
arrs[index].title = arrs[index].displayName
arrs[index].key = arrs[index].id
}
this.orSpin = false
this.nodes = [...this.toTree.toTree(arrs)]
this.nzExpandedKeys = [OrganizationUnitId]
this.nzSelectedKeys = [OrganizationUnitId]
sessionStorage.setItem('planAdminOrid', OrganizationUnitId)
this.oilStationListComponent.onChildMethod()
})
this.orSpin = false;
this.nodes = [...this.toTree.toTree(arrs)];
this.nzExpandedKeys = [this.nodes[0].id];
this.nzSelectedKeys = [this.nodes[0].id];
sessionStorage.setItem("planAdminOrid", this.nodes[0].id);
this.oilStationListComponent.onChildMethod();
});
}
nzExpandedKeys: any = []
nzExpandedKeys: any = [];
activatedNode?: NzTreeNode;
//点击tree节点
activeNode(data: NzFormatEmitEvent): void {
this.activatedNode = data.node!;
sessionStorage.setItem('planAdminOrid', data.node.origin.id)
sessionStorage.setItem("planAdminOrid", data.node.origin.id);
if (this.selectedTab == 0) {
setTimeout(() => {
this.oilStationListComponent.list = []
this.oilStationListComponent.SkipCount = '0'
this.oilStationListComponent.onChildMethod()
this.oilStationListComponent.list = [];
this.oilStationListComponent.SkipCount = "0";
this.oilStationListComponent.onChildMethod();
}, 0);
}
if (this.selectedTab == 1) {
setTimeout(() => {
this.updateLicenseListComponent.list = []
this.updateLicenseListComponent.SkipCount = '0'
this.updateLicenseListComponent.onChildMethod()
this.updateLicenseListComponent.list = [];
this.updateLicenseListComponent.SkipCount = "0";
this.updateLicenseListComponent.onChildMethod();
}, 0);
}
if (this.selectedTab == 2) {
setTimeout(() => {
this.fileLicenseListComponent.list = []
this.fileLicenseListComponent.SkipCount = '0'
this.fileLicenseListComponent.onChildMethod()
this.fileLicenseListComponent.list = [];
this.fileLicenseListComponent.SkipCount = "0";
this.fileLicenseListComponent.onChildMethod();
}, 0);
}
}
expand(e, node) {
e.stopPropagation()
node.isExpanded = !node.isExpanded
e.stopPropagation();
node.isExpanded = !node.isExpanded;
}
}

17
src/app/pages/plan-admin/update-license-list/update-license-list.component.ts

@ -84,8 +84,11 @@ export class UpdateLicenseListComponent implements OnInit {
async getAllOrganization() {
let OrganizationUnitId = JSON.parse(sessionStorage.getItem("userdata"))
.organization.id;
let OrganizationUnitIds = JSON.parse(
sessionStorage.getItem("userdata")
).organizations?.map((v) => v.id);
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true",
};
await new Promise((resolve, reject) => {
@ -95,8 +98,14 @@ export class UpdateLicenseListComponent implements OnInit {
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (element.id == OrganizationUnitId) {
element.parentId = null;
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(element.id)) {
element.parentId = null;
}
} else {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
}
element.key = element.id;
element.title = element.displayName;
@ -287,7 +296,7 @@ export class UpdateLicenseListComponent implements OnInit {
},
nzFooter: null,
nzClosable: false,
nzKeyboard:false,
nzKeyboard: false,
nzOnOk: async () => {},
});
const instance = modal.getContentComponent();

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

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

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

@ -47,6 +47,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
//获取三十天前日期
var lw = new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 30); //最后一个数字30可改,30天的意思
console.log("le", lw);
var lastY = lw.getFullYear();
var lastM = lw.getMonth() + 1;
var lastD = lw.getDate();
@ -142,6 +143,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
let nowY = myDate.getFullYear();
let nowM = myDate.getMonth() + 1;
let nowD = myDate.getDate();
this.enddate =
nowY +
"-" +
@ -149,7 +151,16 @@ export class OilUnloadingProcessListComponent implements OnInit {
"-" +
(nowD < 10 ? "0" + nowD : nowD); //当前日期
//获取三十天前日期
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 29); //最后一个数字30可改,30天的意思
let lw;
if (
sessionStorage.getItem("singleSignOn") &&
sessionStorage.getItem("singleSignOn") === "true"
) {
lw = new Date(myDate - 1000 * 60 * 60 * 24 * 180); //最后一个数字30可改,30天的意思
} else {
lw = new Date(myDate - 1000 * 60 * 60 * 24 * 29); //最后一个数字30可改,30天的意思
}
let lastY = lw.getFullYear();
let lastM = lw.getMonth() + 1;
let lastD = lw.getDate();
@ -687,13 +698,15 @@ export class OilUnloadingProcessListComponent implements OnInit {
//获取所有组织机构
nodes: any = [];
getAllOrganization() {
let OrganizationUnitId =
sessionStorage.getItem("isGasStation") == "true"
? JSON.parse(sessionStorage.getItem("userdataOfgasstation"))
.organization.id
: JSON.parse(sessionStorage.getItem("userdata")).organization.id;
let userData = null;
if (sessionStorage.getItem("isGasStation") == "true") {
userData = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
} else {
userData = JSON.parse(sessionStorage.getItem("userdata"));
}
let OrganizationUnitId = userData.organization.id;
let OrganizationUnitIds = userData.organizations?.map((v) => v.id);
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true",
};
this.http
@ -702,8 +715,14 @@ export class OilUnloadingProcessListComponent implements OnInit {
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (element.id == OrganizationUnitId) {
element.parentId = null;
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(element.id)) {
element.parentId = null;
}
} else {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
}
element.key = element.id;
element.title = element.displayName;

109
src/app/pages/records/records-nav/records-nav.component.ts

@ -1,80 +1,85 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { IsShowEchartsService } from 'src/app/service/isShowEcharts.service';
import {Location} from "@angular/common";
import { Component, OnInit } from "@angular/core";
import { Router } from "@angular/router";
import { IsShowEchartsService } from "src/app/service/isShowEcharts.service";
import { Location } from "@angular/common";
@Component({
selector: 'app-records-nav',
templateUrl: './records-nav.component.html',
styleUrls: ['./records-nav.component.scss']
selector: "app-records-nav",
templateUrl: "./records-nav.component.html",
styleUrls: ["./records-nav.component.scss"],
})
export class RecordsNavComponent implements OnInit {
constructor(
private router: Router,
private isShowEcharts: IsShowEchartsService,
private location: Location
) {}
constructor(private router: Router, private isShowEcharts: IsShowEchartsService,private location: Location) { }
isEcharts = true
menuList = ['预警类型统计', '卸油统计', '证照预警统计']
tap=[]
userMenu = []
menu=[]
selectedMenu
isEcharts = true;
menuList = ["预警类型统计", "卸油统计", "证照预警统计"];
tap = [];
userMenu = [];
menu = [];
selectedMenu;
ngOnInit(): void {
let a= sessionStorage.getItem('userdata')
this.userMenu=JSON.parse(a).menus
console.log(this.userMenu);
let a = sessionStorage.getItem("userdata");
this.userMenu = JSON.parse(a).menus;
for (let index = 0; index < this.userMenu.length; index++) {
let a=this.userMenu[index].name
this.tap.push(a)
let a = this.userMenu[index].name;
this.tap.push(a);
}
console.log(this.tap);
if (this.userMenu.length==0) {
this.menu=this.menuList
}else{
if (this.userMenu.length == 0) {
this.menu = this.menuList;
} else {
for (let index = 0; index < this.menuList.length; index++) {
for (let k = 0; k < this.tap.length; k++) {
if (this.tap[k]==this.menuList[index]) {
this.menu.push(this.tap[k])
console.log( this.menu);
if (this.tap[k] == this.menuList[index]) {
this.menu.push(this.tap[k]);
console.log(this.menu);
}
}
}
}
this.selectedMenu = this.menu[0]
this.routerChange()
if (this.router.url.indexOf("oliunloadinglist") !== -1) {
this.selectedMenu = "卸油统计";
} else {
this.selectedMenu = this.menu[0];
}
// this.selectedMenu = this.menu[0];
this.routerChange();
}
selectMenu(item) {
if (this.selectedMenu == item) {
return
return;
}
this.isEcharts = true
this.selectedMenu = item
this.routerChange()
this.isEcharts = true;
this.selectedMenu = item;
this.routerChange();
}
routerChange() {
if (sessionStorage.getItem('isGasStation') == 'false') {
if (this.selectedMenu == '预警类型统计') {
this.router.navigate(['/records_nav/all'])
} else if (this.selectedMenu == '卸油统计') {
this.router.navigate(['/records_nav/oliunloadinglist'])
} else if (this.selectedMenu == '证照预警统计') {
this.router.navigate(['/records_nav/warningstatisticslist'])
if (
sessionStorage.getItem("isGasStation") == "false" ||
sessionStorage.getItem("isZT") == "true"
) {
if (this.selectedMenu == "预警类型统计") {
this.router.navigate(["/records_nav/all"]);
} else if (this.selectedMenu == "卸油统计") {
this.router.navigate(["/records_nav/oliunloadinglist"]);
} else if (this.selectedMenu == "证照预警统计") {
this.router.navigate(["/records_nav/warningstatisticslist"]);
}
} else {
if (this.selectedMenu == '预警类型统计') {
this.router.navigate(['/records_nav/petrolStation/all'])
} else if (this.selectedMenu == '卸油统计') {
this.router.navigate(['/records_nav/petrolStation/oliunloadinglist'])
} else if (this.selectedMenu == '证照预警统计') {
this.router.navigate(['/records_nav/petrolStation/warningstatisticslist'])
if (this.selectedMenu == "预警类型统计") {
this.router.navigate(["/records_nav/petrolStation/all"]);
} else if (this.selectedMenu == "卸油统计") {
this.router.navigate(["/records_nav/petrolStation/oliunloadinglist"]);
} else if (this.selectedMenu == "证照预警统计") {
this.router.navigate([
"/records_nav/petrolStation/warningstatisticslist",
]);
}
}
}
}

1013
src/app/pages/records/warning-statistics-list/warning-statistics-list.component.ts

File diff suppressed because it is too large Load Diff

0
src/app/pages/singlelogin/singlelogin.component.html

0
src/app/pages/singlelogin/singlelogin.component.scss

405
src/app/pages/singlelogin/singlelogin.component.ts

@ -0,0 +1,405 @@
import { HttpClient } from "@angular/common/http";
import { ActivatedRoute, Router } from "@angular/router";
import { Component, OnInit, TemplateRef, ViewChild } from "@angular/core";
import { FormBuilder, FormGroup } from "@angular/forms";
import { NzFormatEmitEvent } from "ng-zorro-antd/tree";
import { TreeService } from "src/app/service/tree.service";
import { NzMessageService } from "ng-zorro-antd/message";
@Component({
selector: "app-singlelogin",
templateUrl: "./singlelogin.component.html",
styleUrls: ["./singlelogin.component.scss"],
})
export class SingleloginComponent implements OnInit {
constructor(
public route: ActivatedRoute,
private fb: FormBuilder,
private http: HttpClient,
private toTree: TreeService,
private router: Router,
private message: NzMessageService
) {}
sinToken;
pageType;
async ngOnInit(): Promise<void> {
console.log("查询参数", this.route.snapshot.queryParams.page);
this.pageType = this.route.snapshot.queryParams.page;
let token = this.getCookie("SAG_USER_TOKEN");
if (!token) {
alert("未获取到token!");
return;
} else {
token = token.replace(/%3D/g, "=");
this.sinToken = token;
await this.getCurrentUserInfo();
await this.getAuthOrganInfos();
if (this.CurrentUserInfo && this.AuthOrganInfos) {
this.SinochemLogin();
}
}
}
//设置cookie
setCookie(obj) {
for (let key in obj) {
document.cookie = key + "=" + obj[key];
}
}
//读取cookie
getCookie(key) {
console.log(
document.cookie.match(new RegExp("(^|\\s)" + key + "=([^;]+)(;|$)"))
);
let arr = document.cookie.match(
new RegExp("(^|\\s)" + key + "=([^;]+)(;|$)")
);
if (arr && arr.length !== 0) {
return document.cookie.match(
new RegExp("(^|\\s)" + key + "=([^;]+)(;|$)")
)[2];
} else {
return null;
}
}
//删除cookie
removeCookie(key) {
this.setCookie({ [key]: "" });
}
CurrentUserInfo;
AuthOrganInfos;
//获取当前登录用户信息
getCurrentUserInfo() {
return new Promise<void>((resolve, reject) => {
this.http
.get("/sagframe-portal/p3p/auth/getCurrentUserInfo", {
params: {
token: this.sinToken,
},
})
.subscribe(
(data: any) => {
this.CurrentUserInfo = data;
console.log("当前登录用户信息", this.CurrentUserInfo);
resolve();
},
(err) => {
alert("请求中台接口失败");
reject();
}
);
});
}
//获取当前登录用户授权机构
getAuthOrganInfos() {
return new Promise<void>((resolve, reject) => {
this.http
.get("/sagframe-portal/p3p/auth/getAuthOrganInfos", {
params: {
token: this.sinToken,
},
headers: {
resId:
this.pageType == "ai"
? "1724119213161666287118"
: "1724119243583142965118",
},
})
.subscribe(
(data: any) => {
this.AuthOrganInfos = data;
console.log("当前登录用户授权机构", this.CurrentUserInfo);
resolve();
},
(err) => {
alert("请求中台接口失败");
reject();
}
);
});
}
downloadAsTxt(obj) {
// 将对象转换为 JSON 字符串
const jsonString = JSON.stringify(obj, null, 2);
// 创建 Blob 对象
const blob = new Blob([jsonString], { type: "text/plain" });
// 创建下载链接
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = "错误参数.txt"; // 文件名为 data.txt
link.click(); // 触发下载
// 释放 URL 对象
URL.revokeObjectURL(link.href);
}
//中化用户登录获得自己的token信息
SinochemLogin() {
return new Promise<void>((resolve, reject) => {
this.CurrentUserInfo.data.userId = this.CurrentUserInfo.data.id;
delete this.CurrentUserInfo.data.id;
delete this.CurrentUserInfo.data.permissions;
let body = {
user: this.CurrentUserInfo.data,
org: this.AuthOrganInfos.data[0],
sinochemOrgs: this.AuthOrganInfos.data,
userDetail: JSON.stringify(this.CurrentUserInfo.data),
};
this.http.post("/api/TokenAuth/SinochemLogin", body).subscribe(
(data: any) => {
sessionStorage.setItem("isZT", "true");
if (this.pageType == "ai") {
this.enterPage(data);
} else if (this.pageType == "comprehensive") {
this.enterComprehensive(data);
} else {
this.enterPageSystem(data);
}
resolve();
},
(err) => {
this.downloadAsTxt(body);
alert(err?.error?.error?.message || "SinochemLogin接口请求失败");
reject();
}
);
});
}
enterPageSystem(tokenData) {
sessionStorage.setItem("token", tokenData.result.accessToken);
sessionStorage.setItem(
"encryptedAccessToken",
tokenData.result.encryptedAccessToken
);
this.http
.get("/api/services/app/Session/GetCurrentLoginInformations")
.subscribe(
async (data: any) => {
console.log("当前登录账号的信息", data.result);
sessionStorage.setItem("userdata", JSON.stringify(data.result.user));
sessionStorage.setItem(
"userdataOfgasstation",
JSON.stringify(data.result.user)
);
if (data.result.user.menus.length == 0) {
alert("当前用户未分配菜单");
return;
}
if (!data.result.user.organization) {
alert("当前用户没有组织机构信息");
return;
}
// if (data.result.user.organization.isGasStation) {
// alert("油站用户无系统管理权限");
// return;
// }
//跳转页面
this.toPageSystem();
},
(err) => {
alert("获取用户信息错误");
}
);
}
menu3 = [
{ name: "组织机构管理", url: "/system/organization" },
{ name: "用户管理", url: "/system/user" },
{ name: "角色管理", url: "/system/role" },
{ name: "分析主机管理", url: "/system/host" },
{ name: "推送管理", url: "/system/push" },
{ name: "经营类证照管理", url: "/system/updateOfLicense" },
{ name: "资产类证照管理", url: "/system/fileOfLicense" },
{ name: "菜单管理", url: "/system/menu" },
];
userMenu = [];
tap = [];
menuList2 = [];
toPageSystem() {
let a = sessionStorage.getItem("userdata");
this.userMenu = JSON.parse(a).menus;
for (let index = 0; index < this.userMenu.length; index++) {
let a = this.userMenu[index].name;
this.tap.push(a);
}
for (let index = 0; index < this.menu3.length; index++) {
for (let k = 0; k < this.tap.length; k++) {
if (this.tap[k] == this.menu3[index].name) {
this.menuList2.push(this.menu3[index]);
}
}
}
if (this.menuList2.length == 0) {
this.message.create("warning", "未分配系统管理菜单");
return;
} else {
this.router.navigate([this.menuList2[0].url]);
}
}
enterPage(tokenData) {
sessionStorage.setItem("token", tokenData.result.accessToken);
sessionStorage.setItem(
"encryptedAccessToken",
tokenData.result.encryptedAccessToken
);
this.http
.get("/api/services/app/Session/GetCurrentLoginInformations")
.subscribe(
async (data: any) => {
console.log("当前登录账号的信息", data.result);
sessionStorage.setItem("userdata", JSON.stringify(data.result.user));
sessionStorage.setItem(
"userdataOfgasstation",
JSON.stringify(data.result.user)
);
if (data.result.user.menus.length == 0) {
alert("当前用户未分配菜单");
return;
}
if (!data.result.user.organization) {
alert("当前用户没有组织机构信息");
return;
}
if (data.result.user.organization.isGasStation) {
await this.getGasStationBaseInfo();
// if (
// data.result.user.menus[0].name == "数字油站" &&
// data.result.user.menus.length == 1 &&
// !this.init3D
// ) {
// this.message.create(
// "error",
// `当前用户油站未开通3D且仅分配油站菜单`
// );
// return;
// }
}
//跳转页面
this.toPage(data);
},
(err) => {
alert("获取用户信息错误");
}
);
}
enterComprehensive(tokenData) {
sessionStorage.setItem("token", tokenData.result.accessToken);
sessionStorage.setItem(
"encryptedAccessToken",
tokenData.result.encryptedAccessToken
);
this.http
.get("/api/services/app/Session/GetCurrentLoginInformations")
.subscribe(
async (data: any) => {
sessionStorage.setItem("userdata", JSON.stringify(data.result.user));
sessionStorage.setItem(
"userdataOfgasstation",
JSON.stringify(data.result.user)
);
//跳转页面
sessionStorage.setItem("isGasStation", "false");
this.router.navigate(["/comprehensive"]);
},
(err) => {
alert("获取用户信息错误");
}
);
}
menu1 = [
{ name: "首页", url: "/homepage" },
{ name: "数字油站", url: "/plan" },
{ name: "今日预警", url: "/todaywarning" },
{ name: "预警记录", url: "/records_nav" },
{ name: "证照管理", url: "/audit" },
];
menu2 = [
{ name: "数字油站", url: "/plan" },
{ name: "今日预警", url: "/todaywarning" },
{ name: "预警记录", url: "/records_nav" },
{ name: "证照管理", url: "/audit" },
];
init3D;
async getGasStationBaseInfo() {
await new Promise((resolve, reject) => {
let params = {
organizationUnitId: JSON.parse(
sessionStorage.getItem("userdataOfgasstation")
).organization.id,
};
this.http
.get("/api/services/app/GasStation/Get", { params: params })
.subscribe((data: any) => {
resolve(data.result);
sessionStorage.setItem("3dSceneData", JSON.stringify(data.result));
this.init3D = data.result.hasBuildingInfo;
});
});
}
toPage(data) {
if (data.result.user.organization.isGasStation) {
sessionStorage.setItem("isGasStation", "true");
let userdata = sessionStorage.getItem("userdataOfgasstation");
let menuList = this.returnLastMenus(userdata, this.menu2);
let isTrue = menuList.find((item) => {
return item.name == "今日预警";
});
if (isTrue) {
this.router.navigate(["/todaywarning"]);
sessionStorage.setItem("selectedMenu", "今日预警");
} else if (menuList.length == 0) {
return this.message.create("warning", `当前用户未分配菜单`);
} else {
this.router.navigate([menuList[0].url]);
sessionStorage.setItem("selectedMenu", menuList[0].name);
}
} else {
sessionStorage.setItem("isGasStation", "false");
let a = sessionStorage.getItem("userdata");
let menuList = this.returnLastMenus(a, this.menu1);
let isTrue = menuList.find((item) => {
return item.name == "首页";
});
if (menuList.length == 0) {
return this.message.create("warning", `当前用户未分配菜单`);
}
if (isTrue) {
this.router.navigate(["/homepage"]);
sessionStorage.setItem("selectedMenu", "首页");
} else {
this.router.navigate([menuList[0].url]);
sessionStorage.setItem("selectedMenu", menuList[0].name);
}
}
}
returnLastMenus(data, originalMenus) {
let userMenu = JSON.parse(data).menus;
let tap = [];
let menuList = [];
for (let index = 0; index < userMenu.length; index++) {
let a = userMenu[index].name;
tap.push(a);
}
for (let index = 0; index < originalMenus.length; index++) {
for (let k = 0; k < tap.length; k++) {
if (tap[k] == originalMenus[index].name) {
menuList.push(originalMenus[index]);
}
}
}
return menuList;
}
}

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

@ -1,29 +1,38 @@
import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { HttpClient } from '@angular/common/http';
import { NzModalService } from 'ng-zorro-antd/modal';
import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component';
import * as moment from 'moment';
import { TreeService } from '../../service/tree.service';
import { NavChangeService } from '../../service/navChange.service';
import 'linqjs';
import { DispositionComponent } from '../disposition/disposition.component';
import { NzMessageService } from 'ng-zorro-antd/message';
import { listRefreshService } from '../../service/listRefresh.service';
import { DisposeequipmentComponent } from '../records/warning-statistics-list/disposeequipment/disposeequipment.component';
import { Component, OnInit, ViewContainerRef } from "@angular/core";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { Router } from "@angular/router";
import { HttpClient } from "@angular/common/http";
import { NzModalService } from "ng-zorro-antd/modal";
import { GetOutOfLineDetailsComponent } from "../today-warning/get-out-of-line-details/get-out-of-line-details.component";
import * as moment from "moment";
import { TreeService } from "../../service/tree.service";
import { NavChangeService } from "../../service/navChange.service";
import "linqjs";
import { DispositionComponent } from "../disposition/disposition.component";
import { NzMessageService } from "ng-zorro-antd/message";
import { listRefreshService } from "../../service/listRefresh.service";
import { DisposeequipmentComponent } from "../records/warning-statistics-list/disposeequipment/disposeequipment.component";
@Component({
selector: 'app-today-warning-admin',
templateUrl: './today-warning-admin.component.html',
styleUrls: ['./today-warning-admin.component.scss']
selector: "app-today-warning-admin",
templateUrl: "./today-warning-admin.component.html",
styleUrls: ["./today-warning-admin.component.scss"],
})
export class TodayWarningAdminComponent implements OnInit {
validateForm!: FormGroup;
constructor(private listRefreshService: listRefreshService, private http: HttpClient, private fb: FormBuilder, private router: Router, private toTree: TreeService, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private navChangeService: NavChangeService, private message: NzMessageService) { }
isSpin: boolean = false
constructor(
private listRefreshService: listRefreshService,
private http: HttpClient,
private fb: FormBuilder,
private router: Router,
private toTree: TreeService,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private navChangeService: NavChangeService,
private message: NzMessageService
) {}
isSpin: boolean = false;
isMisinformation: boolean = false//误报按钮的显隐
isMisinformation: boolean = false; //误报按钮的显隐
ngOnInit(): void {
this.validateForm = this.fb.group({
level: [null],
@ -33,95 +42,115 @@ export class TodayWarningAdminComponent implements OnInit {
area: [null],
disposalState: [null],
appealState: [null],
datePickerStart: [new Date(`${moment(new Date()).format('YYYY-MM-DD')} 00:00`)],
datePickerEnd: [new Date(`${moment(new Date()).format('YYYY-MM-DD')} 23:59`)]
datePickerStart: [
new Date(`${moment(new Date()).format("YYYY-MM-DD")} 00:00`),
],
datePickerEnd: [
new Date(`${moment(new Date()).format("YYYY-MM-DD")} 23:59`),
],
});
this.warningType()
this.isSpin = true
this.getAllOrganization()
this.warningType();
this.isSpin = true;
this.getAllOrganization();
this.listRefreshService.getMessage().subscribe((message: any) => {
//列表刷新
if (message.type == 'add') {
this.getEarlyWarningList()
if (message.type == "add") {
this.getEarlyWarningList();
}
//更新处置状态
if (message.type == 'updatehandleTime') {
console.log('更新处置状态', message)
if (message.type == "updatehandleTime") {
console.log("更新处置状态", message);
// console.log(this.list)
this.list.forEach(element => {
this.list.forEach((element) => {
if (element.id == message.data) {
element.handleTime = new Date()
element.handleTime = new Date();
}
});
}
});
let loginUserInfo
if (sessionStorage.getItem('isGasStation') == 'true') {
loginUserInfo = JSON.parse(sessionStorage.getItem('userdataOfgasstation'))
let loginUserInfo;
if (sessionStorage.getItem("isGasStation") == "true") {
loginUserInfo = JSON.parse(
sessionStorage.getItem("userdataOfgasstation")
);
} else {
loginUserInfo = JSON.parse(sessionStorage.getItem('userdata'))
loginUserInfo = JSON.parse(sessionStorage.getItem("userdata"));
}
if (loginUserInfo.permissions.find((item) => {
return item.name == 'Data.Violation.Positive.Censor'
})) {
this.isMisinformation = true
if (
loginUserInfo?.permissions?.find((item) => {
return item.name == "Data.Violation.Positive.Censor";
})
) {
this.isMisinformation = true;
} else {
this.isMisinformation = false
this.isMisinformation = false;
}
}
//预警类型接口
warningTypesDetails: any
warningTypesDetailsCopy: any
warningTypesDetails: any;
warningTypesDetailsCopy: any;
warningTypes: any //预警接口数据
warningTypesCopy: any
warningLevels: any
warningLevelsCopy: any
warningTypes: any; //预警接口数据
warningTypesCopy: any;
warningLevels: any;
warningLevelsCopy: any;
warningType() {
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => {
this.warningTypesDetails = JSON.parse(JSON.stringify(data.result))
this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)) //原始数据备份
this.warningTypes = (data.result as any).groupBy((t) => { return t.violationType });
this.warningTypesCopy = (data.result as any).groupBy((t) => { return t.violationType })
this.warningLevels = (data.result as any).groupBy((t) => { return t.level });
this.warningLevelsCopy = (data.result as any).groupBy((t) => { return t.level })
this.warningLevels.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
});
this.warningLevelsCopy.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
this.http
.get("/api/services/app/Violation/GetAllList")
.subscribe((data: any) => {
this.warningTypesDetails = JSON.parse(JSON.stringify(data.result));
this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)); //原始数据备份
this.warningTypes = (data.result as any).groupBy((t) => {
return t.violationType;
});
this.warningTypesCopy = (data.result as any).groupBy((t) => {
return t.violationType;
});
this.warningLevels = (data.result as any).groupBy((t) => {
return t.level;
});
this.warningLevelsCopy = (data.result as any).groupBy((t) => {
return t.level;
});
this.warningLevels.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
});
this.warningLevelsCopy.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
});
// console.log(111, this.warningTypesDetails)
// console.log(222, this.warningTypesCopy)
// console.log(333, this.warningLevels)
});
// console.log(111, this.warningTypesDetails)
// console.log(222, this.warningTypesCopy)
// console.log(333, this.warningLevels)
})
}
typeChange(e) {
if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy
this.warningLevels = this.warningLevelsCopy
return
this.warningTypesDetails = this.warningTypesDetailsCopy;
this.warningLevels = this.warningLevelsCopy;
return;
}
this.warningTypes.forEach(element => {
this.warningTypes.forEach((element) => {
if (element.key == e) {
this.warningTypesDetails = element
this.warningLevels = (element as any).groupBy((t) => { return t.level });
this.warningTypesDetails = element;
this.warningLevels = (element as any).groupBy((t) => {
return t.level;
});
}
});
this.validateForm.patchValue({
@ -130,17 +159,19 @@ export class TodayWarningAdminComponent implements OnInit {
}
levelChange(e) {
if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy
this.warningTypes = this.warningTypesCopy
this.warningTypesDetails = this.warningTypesDetailsCopy;
this.warningTypes = this.warningTypesCopy;
this.validateForm.patchValue({
type: null,
});
return
return;
}
this.warningLevels.forEach(element => {
this.warningLevels.forEach((element) => {
if (element.key == e) {
this.warningTypesDetails = element
this.warningTypes = (element as any).groupBy((t) => { return t.violationType });
this.warningTypesDetails = element;
this.warningTypes = (element as any).groupBy((t) => {
return t.violationType;
});
}
});
this.validateForm.patchValue({
@ -148,100 +179,142 @@ export class TodayWarningAdminComponent implements OnInit {
});
}
defaultOrId: string
defaultOrId: string;
//获取所有组织机构
nodes: any = []
nodes: any = [];
getAllOrganization() {
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true"
let userData = null;
if (sessionStorage.getItem("isGasStation") == "true") {
userData = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
} else {
userData = JSON.parse(sessionStorage.getItem("userdata"));
}
this.http.get('/api/services/app/Organization/GetAll', {
params: params
}).subscribe((data: any) => {
data.result.items.forEach(element => {
if (element.id == OrganizationUnitId) {
element.parentId = null
}
element.key = element.id
element.title = element.displayName
let OrganizationUnitId = userData.organization.id;
let OrganizationUnitIds = userData.organizations?.map((v) => v.id);
let params = {
IsContainsChildren: "true",
};
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(element.id)) {
element.parentId = null;
}
} else {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
}
element.key = element.id;
element.title = element.displayName;
});
this.nodes = [...this.toTree.toTree(data.result.items)];
this.defaultOrId = JSON.parse(
sessionStorage.getItem("userdata")
).organization.id;
this.validateForm.value.organization = this.defaultOrId;
this.getEarlyWarningList();
});
this.nodes = [...this.toTree.toTree(data.result.items)]
this.defaultOrId = JSON.parse(sessionStorage.getItem('userdata')).organization.id
this.validateForm.value.organization = this.defaultOrId
this.getEarlyWarningList()
})
}
//获得预警列表
list: any = [
]
totalCount: string //预警总数
isLoading = false
list: any = [];
totalCount: string; //预警总数
isLoading = false;
getEarlyWarningList() {
this.isLoading = true
let ViolationIds = []
this.isLoading = true;
let ViolationIds = [];
if (this.validateForm.value.event) {
ViolationIds = this.validateForm.value.event
ViolationIds = this.validateForm.value.event;
}
if (this.validateForm.value.type && !this.validateForm.value.event) {
this.warningTypesDetails.forEach(item => {
item.id ? ViolationIds.push(item.id) : null
this.warningTypesDetails.forEach((item) => {
item.id ? ViolationIds.push(item.id) : null;
});
}
let disposalState
if (this.validateForm.value.disposalState == '0') {
disposalState = true
} else if (this.validateForm.value.disposalState == '1') {
disposalState = false
let disposalState;
if (this.validateForm.value.disposalState == "0") {
disposalState = true;
} else if (this.validateForm.value.disposalState == "1") {
disposalState = false;
} else {
disposalState = null
disposalState = null;
}
// console.log(this.validateForm.value)
this.isSpin = true
let ViolateTime = null;
if (
sessionStorage.getItem("singleSignOn") &&
sessionStorage.getItem("singleSignOn") === "true"
) {
ViolateTime = [
"2023-9-1",
moment(this.validateForm.value.datePickerEnd).format("yyyy-MM-DD"),
];
} else {
this.validateForm.value.datePickerEnd &&
this.validateForm.value.datePickerStart
? (ViolateTime = [
moment(this.validateForm.value.datePickerStart).format(
"yyyy-MM-DD HH:mm:ss"
),
moment(this.validateForm.value.datePickerEnd).format(
"yyyy-MM-DD HH:mm:ss"
),
])
: (ViolateTime = null);
}
this.isSpin = true;
let params = {
Level: this.validateForm.value.level,
ViolationIds: ViolationIds,
ViolateAreas: this.validateForm.value.area,
organizationUnitId: this.validateForm.value.organization,
ViolateTime: (this.validateForm.value.datePickerEnd && this.validateForm.value.datePickerStart) ? [moment(this.validateForm.value.datePickerStart).format('yyyy-MM-DD HH:mm:ss'), moment(this.validateForm.value.datePickerEnd).format('yyyy-MM-DD HH:mm:ss')] : null,
ViolateTime: ViolateTime,
// ViolateTime: ['2021-10-27', '2021-11-26'],
IsHandled: disposalState,
AppealStatus: this.validateForm.value.appealState,
IsContainsChildren: 'true',
SkipCount: '0',
MaxResultCount: '9999',
Positive: 'true'
}
this.http.get('/api/services/app/ViolateRecord/GetAll', {
params: params
}).subscribe((data: any) => {
this.list = data.result.items
this.totalCount = data.result.totalCount
console.log('预警列表', this.list)
this.isSpin = false
this.isLoading = false
let obj = {
name: '改变数量',
num: this.totalCount
}
setTimeout(() => {
this.navChangeService.sendMessage(obj);//发布一条消息
}, 0);
})
IsContainsChildren: "true",
SkipCount: "0",
MaxResultCount: "9999",
Positive: "true",
};
this.http
.get("/api/services/app/ViolateRecord/GetAll", {
params: params,
})
.subscribe((data: any) => {
data.result.items = data.result.items.filter((item) => {
return (
item.violation.violationType != "证照资质" ||
(item.violation.violationType == "证照资质" &&
item.gasStation.companyName.includes("延长"))
);
});
this.list = data.result.items;
this.totalCount = data.result.totalCount;
console.log("预警列表", this.list);
this.isSpin = false;
this.isLoading = false;
let obj = {
name: "改变数量",
num: this.totalCount,
};
setTimeout(() => {
this.navChangeService.sendMessage(obj); //发布一条消息
}, 0);
});
}
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
this.getEarlyWarningList()
this.getEarlyWarningList();
}
resetForm(e: MouseEvent): void {
@ -252,93 +325,125 @@ export class TodayWarningAdminComponent implements OnInit {
this.validateForm.controls[key].updateValueAndValidity();
}
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
datePickerStart: new Date(`${moment(new Date()).format('YYYY-MM-DD')} 00:00`),
datePickerEnd: new Date(`${moment(new Date()).format('YYYY-MM-DD')} 23:59`)
organization: JSON.parse(sessionStorage.getItem("userdata")).organization
.id,
datePickerStart: new Date(
`${moment(new Date()).format("YYYY-MM-DD")} 00:00`
),
datePickerEnd: new Date(
`${moment(new Date()).format("YYYY-MM-DD")} 23:59`
),
});
this.getEarlyWarningList()
this.getEarlyWarningList();
}
isVisible = false
isVisible = false;
look(item) {
if (item.violation.violationType == '设备监测') {
item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot)
if (item.violation.violationType == "设备监测") {
item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot);
const modal = this.modal.create({
nzContent: DisposeequipmentComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 380,
nzBodyStyle: {
'border': '1px solid #91CCFF',
'border-radius': '0px',
'padding': '7px',
'box-shadow': '0 0 8px 0 #fff',
'background-image': 'linear-gradient(#003665, #000f25)'
border: "1px solid #91CCFF",
"border-radius": "0px",
padding: "7px",
"box-shadow": "0 0 8px 0 #fff",
"background-image": "linear-gradient(#003665, #000f25)",
},
nzComponentParams: {
data: item
data: item,
},
nzFooter: null,
nzClosable: false,
nzOnOk: async () => {
if (instance.isScrap) {
await new Promise(resolve => {
await new Promise((resolve) => {
let body = {
id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name,
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'),
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
}
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = {
id: item.id,
handleRecord: '报废成功!'
}
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data)
this.message.create('success', '报废成功!');
item.handleTime = new Date()
return true
})
})
})
organizationUnitId:
item.violatedItemSnapshotObj.organizationUnitId,
};
this.http
.put("/api/services/app/FireEquipment/Update", body)
.subscribe((data: any) => {
let body = {
id: item.id,
handleRecord: "报废成功!",
};
this.http
.post(
"/api/services/app/ViolateRecord/HandleViolateRecord",
body
)
.subscribe((data) => {
resolve(data);
this.message.create("success", "报废成功!");
item.handleTime = new Date();
return true;
});
});
});
} else {
if (instance.validateForm.valid) {
await new Promise(resolve => {
await new Promise((resolve) => {
let body = {
id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name,
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) => {
// item.violatedItemSnapshotObj = data.result
let body = {
id: item.id,
handleRecord: '维保成功!'
}
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data)
this.message.create('success', '维保成功!');
item.handleTime = new Date()
return true
})
})
})
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) => {
// item.violatedItemSnapshotObj = data.result
let body = {
id: item.id,
handleRecord: "维保成功!",
};
this.http
.post(
"/api/services/app/ViolateRecord/HandleViolateRecord",
body
)
.subscribe((data) => {
resolve(data);
this.message.create("success", "维保成功!");
item.handleTime = new Date();
return true;
});
});
});
} else {
this.message.create('warning', '请填写完整!');
return false
this.message.create("warning", "请填写完整!");
return false;
}
}
}
},
});
const instance = modal.getContentComponent();
} else {
@ -346,69 +451,73 @@ export class TodayWarningAdminComponent implements OnInit {
nzContent: GetOutOfLineDetailsComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200,
nzWidth:
document.documentElement.clientHeight < 650 ||
document.documentElement.clientWidth < 1400
? 1000
: 1200,
nzClosable: false,
nzClassName: 'modelnobg',
nzClassName: "modelnobg",
nzBodyStyle: {
'border-radius': '0px',
'padding': '0px',
"border-radius": "0px",
padding: "0px",
},
nzComponentParams: {
data: item
data: item,
},
nzFooter: null,
nzOnOk: async () => {
console.log('误报处理')
console.log("误报处理");
for (let index = 0; index < this.list.length; index++) {
const element = this.list[index];
if (element.id == item.id) {
this.list.splice(index, 1)
this.totalCount = String(Number(this.totalCount) - 1)
this.list.splice(index, 1);
this.totalCount = String(Number(this.totalCount) - 1);
// this.SkipCount = String(Number(this.SkipCount) - 1)
}
}
}
},
});
const instance = modal.getContentComponent();
}
}
dispose(item) {
console.log(item)
console.log(item);
const modal = this.modal.create({
nzContent: DispositionComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth: 380,
nzBodyStyle: {
'border': '1px solid #91CCFF',
'border-radius': '0px',
'padding': '7px',
'box-shadow': '0 0 8px 0 #fff',
'background-image': 'linear-gradient(#003665, #000f25)'
border: "1px solid #91CCFF",
"border-radius": "0px",
padding: "7px",
"box-shadow": "0 0 8px 0 #fff",
"background-image": "linear-gradient(#003665, #000f25)",
},
nzComponentParams: {},
nzFooter: null,
nzClosable: false,
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
await new Promise((resolve) => {
let body = {
id: item.id,
handleRecord: instance.validateForm.value.content
}
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data)
this.message.create('success', '处置成功!');
item.handleTime = new Date()
return true
})
})
handleRecord: instance.validateForm.value.content,
};
this.http
.post("/api/services/app/ViolateRecord/HandleViolateRecord", body)
.subscribe((data) => {
resolve(data);
this.message.create("success", "处置成功!");
item.handleTime = new Date();
return true;
});
});
} else {
this.message.create('warning', '请填写完整!');
return false
this.message.create("warning", "请填写完整!");
return false;
}
},
});

7
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html

@ -23,9 +23,10 @@
<ng-container *ngIf="isShowAxOtherRegion">
<label *ngFor="let item of this.legendList" nz-checkbox [(ngModel)]="item.checked"
(ngModelChange)="typeChange(item)">
<div style="width: 10px;height: 10px;display: inline-block;" [ngStyle]="{'background': typeArr[item.id].color}">
<div style="width: 10px;height: 10px;display: inline-block;"
[ngStyle]="{'background': typeArr[item.id]?.color || 'yellow'}">
</div>
{{typeArr[item.id].name}}
{{typeArr[item.id]?.name || '未定义'}}
</label>
</ng-container>
<!-- <button nz-button nzType="primary" (click)="downImg()">导出图片</button> -->
@ -37,7 +38,7 @@
<img [id]="'img'+data.id" [src]="imgUrl" alt="">
<canvas *ngIf="isAnxin" [width]="canvasWidth" [height]="canvasHeight"
[ngStyle]="{'width': canvasWidth + 'px','height': canvasHeight + 'px'}" class="canvas"
[id]="'canvas'+data.id"></canvas>
[id]="'canvas'+data.id" (click)="viewImg($event)"></canvas>
<div *ngIf="isCarStop && isAnxin" class="pageturning lastpage" (click)="pageturning('last')">
<i nz-icon nzType="left" nzTheme="outline"></i>
</div>

52
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

@ -50,7 +50,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
legendList: any = [];
typeArr = [
{ id: 0, name: "工装", color: "#91CCFF" },
{ id: 2, name: "便装", color: "#46DFFF" },
{ id: 1, name: "便装", color: "#46DFFF" },
{ id: 2, name: "抽烟", color: "#36A2FF" },
{ id: 3, name: "打电话", color: "#FF6181" },
{ id: 4, name: "隔离锥", color: "#000000" },
@ -69,8 +69,12 @@ export class GetOutOfLineDetailsComponent implements OnInit {
{ id: 17, name: "延长工装", color: "blue" },
{ id: 18, name: "江苏工装", color: "blue" },
{ id: 19, name: "经理工装", color: "yellow" },
{ id: 20, name: "江苏道达尔工装", color: "yellow" },
{ id: 21, name: "延长壳牌工装", color: "red" },
{ id: 22, name: "山西高速工装", color: "red" },
];
userName; //登录账号的用户名
name; //登录账号的真实名
isShowAxOtherRegion; //控制哪些用户可以看到ax全部
isCarStop = false;
@ -80,6 +84,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
console.log("传进来的信息", this.data);
// 安信框选
this.userName = JSON.parse(sessionStorage.getItem("userdata")).userName;
this.name = JSON.parse(sessionStorage.getItem("userdata")).name;
if (this.userName === "admin" || this.userName === "superadmin") {
this.isShowAxOtherRegion = true;
} else {
@ -232,24 +237,32 @@ export class GetOutOfLineDetailsComponent implements OnInit {
ctx;
canvasLabel() {
let imgBg: any = document.getElementById("img" + this.data.id);
imgBg.onload = () => {
console.log("图片加载完毕...");
const drawImageAndRect = () => {
this.canvasWidth = imgBg.offsetWidth;
this.canvasHeight = imgBg.offsetHeight;
const canvas: any = document.getElementById("canvas" + this.data.id);
this.ctx = canvas.getContext("2d");
const cWidth = canvas.width,
cHeight = canvas.height;
setTimeout(() => {
console.log("以图画底,描绘预警框...");
// 以图画底
this.ctx = canvas.getContext("2d");
const cWidth = canvas.width,
cHeight = canvas.height;
console.log(1, cWidth, cHeight);
this.ctx.drawImage(imgBg, 0, 0, cWidth, cHeight);
this.strokeRect(this.currentCoordinate);
}, 100);
}, 0);
};
if (imgBg.complete) {
console.log("图片已经加载, 直接绘制...");
drawImageAndRect(); // 如果图片已加载,直接调用绘制函数
} else {
imgBg.onload = () => {
console.log("图片加载完毕...");
drawImageAndRect(); // 图片加载完成后,调用绘制函数
};
}
}
strokeRect(data) {
console.log(data);
data.forEach((item) => {
let startPoint = [
Math.round(this.canvasWidth * item.box[0]),
@ -260,7 +273,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
Math.round(this.canvasHeight * item.box[3]),
];
if (this.isShowAxOtherRegion) {
this.ctx.strokeStyle = this.typeArr[item.id].color;
this.ctx.strokeStyle = this.typeArr[item.id]?.color || "yellow";
this.ctx.lineWidth = 3;
this.ctx.strokeRect(
startPoint[0],
@ -270,16 +283,16 @@ export class GetOutOfLineDetailsComponent implements OnInit {
);
//如果当前矩形区域为错误区域,则左上角增加色块
if (item.error) {
this.ctx.fillStyle = this.typeArr[item.id].color;
this.ctx.fillStyle = this.typeArr[item.id]?.color || "yellow";
this.ctx.fillRect(startPoint[0], startPoint[1], 10, 10);
}
this.ctx.fillStyle = this.typeArr[item.id].color;
this.ctx.fillStyle = this.typeArr[item.id]?.color || "yellow";
this.ctx.font = "16px Verdana";
let name = "";
if (this.isShowAxOtherRegion) {
name = this.typeArr[item.id].name + item.scores;
name = this.typeArr[item.id]?.name || "未定义" + item.scores;
} else {
name = this.typeArr[item.id].name;
name = this.typeArr[item.id]?.name || "未定义";
}
this.ctx.fillText(
name,
@ -290,7 +303,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
);
} else {
if (item.error) {
this.ctx.strokeStyle = this.typeArr[item.id].color;
this.ctx.strokeStyle = this.typeArr[item.id]?.color || "yellow";
this.ctx.lineWidth = 3;
this.ctx.strokeRect(
startPoint[0],
@ -298,9 +311,9 @@ export class GetOutOfLineDetailsComponent implements OnInit {
endPoint[0] - startPoint[0],
endPoint[1] - startPoint[1]
);
this.ctx.fillStyle = this.typeArr[item.id].color;
this.ctx.fillStyle = this.typeArr[item.id]?.color || "yellow";
this.ctx.fillRect(startPoint[0], startPoint[1], 10, 10);
this.ctx.fillStyle = this.typeArr[item.id].color;
this.ctx.fillStyle = this.typeArr[item.id]?.color || "yellow";
this.ctx.font = "16px Verdana";
}
}
@ -421,7 +434,9 @@ export class GetOutOfLineDetailsComponent implements OnInit {
}
//查看图片
viewImg(url) {
viewImg(e) {
// return;
const url = e.target.toDataURL();
let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes;
let node = document.createElement("img");
@ -455,6 +470,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
this.message.create("success", "处置成功!");
this.data.handleTime = new Date();
this.data.handleStateStr = "已处置";
this.data.handleUserName = this.name;
this.data.handleRecord = this.content;
});
}

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

@ -230,6 +230,13 @@ export class TodayWarningComponent implements OnInit {
params: params,
})
.subscribe((data: any) => {
data.result.items = data.result.items.filter((item) => {
return (
item.violation.violationType != "证照资质" ||
(item.violation.violationType == "证照资质" &&
item.gasStation.companyName.includes("延长"))
);
});
this.list = data.result.items;
this.totalCount = data.result.totalCount;
console.log("预警列表", this.list);

9
src/app/service/pattern.service.ts

@ -1,13 +1,12 @@
import { Injectable } from '@angular/core';
import { Injectable } from "@angular/core";
@Injectable({
providedIn: 'root'
providedIn: "root",
})
export class PatternService {
static isProd: any = true;
constructor() { }
public isProd: boolean = true //是否是生产环境
constructor() {}
public isProd: boolean = true; //是否是生产环境
}

7
src/app/service/tree.service.ts

@ -18,10 +18,11 @@ export class TreeService {
}
parentNode.children.push(item);
} else {
if (!item.parentId) {
//如果parentId为null
newdata.push(item);
// 如果parentId找不到对应的id,则将parentId设置为null,并添加到newdata的顶层
if (item.parentId !== null && item.parentId !== undefined) {
item.parentId = null; // 将parentId设置为null
}
newdata.push(item);
}
});
return newdata;

21
src/app/system-management/algorithm-config/algorithm-config.component.ts

@ -51,7 +51,6 @@ export class AlgorithmConfigComponent implements OnInit {
organizationList; //组织机构列表
getAllOrganization() {
let params = {
OrganizationUnitId: this.OrganizationUnitId,
IsContainsChildren: "true",
};
this.http
@ -73,6 +72,14 @@ export class AlgorithmConfigComponent implements OnInit {
nzExpandedKeys = [];
nzSelectedKeys: any[] = [];
getStationsNum(e) {
let userData = null;
if (sessionStorage.getItem("isGasStation") == "true") {
userData = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
} else {
userData = JSON.parse(sessionStorage.getItem("userdata"));
}
let OrganizationUnitId = userData.organization.id;
let OrganizationUnitIds = userData.organizations?.map((v) => v.id);
this.http
.get(
"/api/services/app/GasStation/GetCountsByOrganizations?IsContainsChildren=true"
@ -90,8 +97,14 @@ export class AlgorithmConfigComponent implements OnInit {
});
for (let index = 0; index < arrs.length; index++) {
arrs[index].isLeaf = true;
if (arrs[index].id == this.OrganizationUnitId) {
arrs[index].parentId = null;
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(arrs[index].id)) {
arrs[index].parentId = null;
}
} else {
if (arrs[index].id == OrganizationUnitId) {
arrs[index].parentId = null;
}
}
arrs[index].title =
arrs[index].displayName +
@ -166,7 +179,7 @@ export class AlgorithmConfigComponent implements OnInit {
}
pageSizeChange($event) {
// console.log($event);
this.MaxResultCount = $event
this.MaxResultCount = $event;
this.SkipCount = 0;
this.nzPageIndex = 1;
this.getStationViolationConfigList();

384
src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts

@ -1,284 +1,326 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit, AfterViewInit, ViewChild, ViewContainerRef } from '@angular/core';
import { TreeService } from 'src/app/service/tree.service';
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message';
import { AddhostComponent } from './addhost/addhost.component';
import { AddcameraComponent } from './addcamera/addcamera.component';
import { EdithostComponent } from './edithost/edithost.component';
import { EditcameraComponent } from './editcamera/editcamera.component';
import { HttpClient } from "@angular/common/http";
import {
Component,
OnInit,
AfterViewInit,
ViewChild,
ViewContainerRef,
} from "@angular/core";
import { TreeService } from "src/app/service/tree.service";
import {
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNodeOptions,
} from "ng-zorro-antd/tree";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { NzModalService } from "ng-zorro-antd/modal";
import { NzMessageService } from "ng-zorro-antd/message";
import { AddhostComponent } from "./addhost/addhost.component";
import { AddcameraComponent } from "./addcamera/addcamera.component";
import { EdithostComponent } from "./edithost/edithost.component";
import { EditcameraComponent } from "./editcamera/editcamera.component";
@Component({
selector: 'app-analysis-of-the-host',
templateUrl: './analysis-of-the-host.component.html',
styleUrls: ['./analysis-of-the-host.component.scss']
selector: "app-analysis-of-the-host",
templateUrl: "./analysis-of-the-host.component.html",
styleUrls: ["./analysis-of-the-host.component.scss"],
})
export class AnalysisOfTheHostComponent implements OnInit {
constructor(private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private modal: NzModalService, private message: NzMessageService, private viewContainerRef: ViewContainerRef) { }
constructor(
private fb: FormBuilder,
private http: HttpClient,
private toTree: TreeService,
private modal: NzModalService,
private message: NzMessageService,
private viewContainerRef: ViewContainerRef
) {}
ngOnInit(): void {
this.getAllOrganization()
this.getAllOrganization();
}
//获取所有组织机构
searchValue = '';
searchValue = "";
nzExpandAll = false;
totalCount: string
totalCount: string;
getAllOrganization() {
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true"
let userData = null;
if (sessionStorage.getItem("isGasStation") == "true") {
userData = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
} else {
userData = JSON.parse(sessionStorage.getItem("userdata"));
}
this.http.get('/api/services/app/Organization/GetAll', {
params: params
}).subscribe((data: any) => {
this.totalCount = data.result.totalCount
data.result.items.forEach(element => {
if (element.id == OrganizationUnitId) {
element.parentId = null
}
element.key = element.id
element.title = element.displayName
element.selectable = false
let OrganizationUnitId = userData.organization.id;
let OrganizationUnitIds = userData.organizations?.map((v) => v.id);
let params = {
IsContainsChildren: "true",
};
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe((data: any) => {
this.totalCount = data.result.totalCount;
data.result.items.forEach((element) => {
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(element.id)) {
element.parentId = null;
}
} else {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
}
element.key = element.id;
element.title = element.displayName;
element.selectable = false;
});
this.nodes = [...this.toTree.toTree(data.result.items)];
this.defaultExpandedKeys = [this.nodes[0].id];
this.defaultExpandedKeys = [...this.defaultExpandedKeys];
});
this.nodes = [...this.toTree.toTree(data.result.items)]
this.defaultExpandedKeys = [this.nodes[0].id]
this.defaultExpandedKeys = [...this.defaultExpandedKeys]
})
}
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
@ViewChild("nzTreeComponent", { static: false })
nzTreeComponent!: NzTreeComponent;
defaultExpandedKeys = [];
nodes: any[] = []
nzSelectedKeys: any[] = []
selectedOilStation: any
nodes: any[] = [];
nzSelectedKeys: any[] = [];
selectedOilStation: any;
nzClick(event: NzFormatEmitEvent): void {
console.log(event.node.origin);
if (event.node.origin.isGasStation) {//如果点击的是加油站才生效
this.nzSelectedKeys[0] = event.node.origin.id
this.nzSelectedKeys = [...this.nzSelectedKeys]
this.selectedOilStation = event.node.origin
this.getHost()
this.getCamera()
if (event.node.origin.isGasStation) {
//如果点击的是加油站才生效
this.nzSelectedKeys[0] = event.node.origin.id;
this.nzSelectedKeys = [...this.nzSelectedKeys];
this.selectedOilStation = event.node.origin;
this.getHost();
this.getCamera();
} else {
this.message.info('只有加油站才可以增加主机');
this.message.info("只有加油站才可以增加主机");
}
}
//获得加油站的主机
listOfData: any[] = [];
getHost() {
this.http.get('/api/services/app/EdgeDevice/GetAll', {
params: {
organizationUnitId: this.selectedOilStation.id,
SkipCount: '0',
MaxResultCount: '100',
}
}).subscribe((data: any) => {
console.log('主机列表', data.result.items)
this.listOfData = data.result.items
})
this.http
.get("/api/services/app/EdgeDevice/GetAll", {
params: {
organizationUnitId: this.selectedOilStation.id,
SkipCount: "0",
MaxResultCount: "100",
},
})
.subscribe((data: any) => {
console.log("主机列表", data.result.items);
this.listOfData = data.result.items;
});
}
//获得加油站摄像头
listOfDataCamera: any[] = [];
getCamera() {
this.http.get('/api/services/app/Camera/GetAll', {
params: {
organizationUnitId: this.selectedOilStation.id,
SkipCount: '0',
MaxResultCount: '100',
}
}).subscribe((data: any) => {
// console.log('摄像头列表', data)
this.listOfDataCamera = data.result.items
})
this.http
.get("/api/services/app/Camera/GetAll", {
params: {
organizationUnitId: this.selectedOilStation.id,
SkipCount: "0",
MaxResultCount: "100",
},
})
.subscribe((data: any) => {
// console.log('摄像头列表', data)
this.listOfDataCamera = data.result.items;
});
}
ngAfterViewInit(): void {
}
ngAfterViewInit(): void {}
//新增分析主机
addHost() {
console.log(this.selectedOilStation)
console.log(this.selectedOilStation);
const modal = this.modal.create({
nzTitle: '新增加油站主机',
nzTitle: "新增加油站主机",
nzContent: AddhostComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 288,
nzComponentParams: {},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
console.log('表单信息', instance.validateForm)
await new Promise((resolve) => {
console.log("表单信息", instance.validateForm);
let body = {
hostIPAddress: instance.validateForm.value.ip,
organizationUnitId: this.selectedOilStation.id
}
this.http.post('/api/services/app/EdgeDevice/Create', body).subscribe(data => {
resolve(data)
this.message.create('success', '创建成功!');
this.getHost()
return true
})
})
organizationUnitId: this.selectedOilStation.id,
};
this.http
.post("/api/services/app/EdgeDevice/Create", body)
.subscribe((data) => {
resolve(data);
this.message.create("success", "创建成功!");
this.getHost();
return true;
});
});
} else {
this.message.create('warning', '请填写完整!');
return false
this.message.create("warning", "请填写完整!");
return false;
}
}
},
});
const instance = modal.getContentComponent();
}
edit(data) {
console.log(data)
console.log(data);
const modal = this.modal.create({
nzTitle: '编辑加油站主机',
nzTitle: "编辑加油站主机",
nzContent: EdithostComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 288,
nzComponentParams: {
ip: data.hostIPAddress
ip: data.hostIPAddress,
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
console.log('表单信息', instance.validateForm)
data.hostIPAddress = instance.validateForm.value.ip,
this.http.put('/api/services/app/EdgeDevice/Update', data).subscribe(data => {
resolve(data)
this.message.create('success', '修改成功!');
this.getHost()
return true
})
})
await new Promise((resolve) => {
console.log("表单信息", instance.validateForm);
(data.hostIPAddress = instance.validateForm.value.ip),
this.http
.put("/api/services/app/EdgeDevice/Update", data)
.subscribe((data) => {
resolve(data);
this.message.create("success", "修改成功!");
this.getHost();
return true;
});
});
} else {
this.message.create('warning', '请填写完整!');
return false
this.message.create("warning", "请填写完整!");
return false;
}
}
},
});
const instance = modal.getContentComponent();
}
delete(item) {
console.log(item)
console.log(item);
this.modal.confirm({
nzTitle: `确定要删除${item.name}这个主机吗?`,
nzOkText: '确定',
nzOkType: 'primary',
nzOkText: "确定",
nzOkType: "primary",
nzOnOk: () => {
this.http.delete('/api/services/app/EdgeDevice/Delete', {
params: {
Id: item.id
}
}).subscribe(data => {
this.message.create('success', '删除成功!');
this.getHost()
})
this.http
.delete("/api/services/app/EdgeDevice/Delete", {
params: {
Id: item.id,
},
})
.subscribe((data) => {
this.message.create("success", "删除成功!");
this.getHost();
});
},
nzCancelText: '取消'
nzCancelText: "取消",
});
}
//摄像头
addCamera() {
console.log(this.selectedOilStation)
console.log(this.selectedOilStation);
const modal = this.modal.create({
nzTitle: '新增加油站摄像头',
nzTitle: "新增加油站摄像头",
nzContent: AddcameraComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 288,
nzComponentParams: {},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
console.log('表单信息', instance.validateForm)
await new Promise((resolve) => {
console.log("表单信息", instance.validateForm);
let body = {
organizationUnitId: this.selectedOilStation.id,
ipAdress: instance.validateForm.value.ip,
code: instance.validateForm.value.code,
name: instance.validateForm.value.name,
// description: "",
}
this.http.post('/api/services/app/Camera/Create', body).subscribe(data => {
resolve(data)
this.message.create('success', '创建成功!');
this.getCamera()
return true
}, err => {
return false
})
})
};
this.http.post("/api/services/app/Camera/Create", body).subscribe(
(data) => {
resolve(data);
this.message.create("success", "创建成功!");
this.getCamera();
return true;
},
(err) => {
return false;
}
);
});
} else {
this.message.create('warning', '请填写完整!');
return false
this.message.create("warning", "请填写完整!");
return false;
}
}
},
});
const instance = modal.getContentComponent();
}
editCamera(data) {
console.log(data)
console.log(data);
const modal = this.modal.create({
nzTitle: '编辑加油站摄像头',
nzTitle: "编辑加油站摄像头",
nzContent: EditcameraComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 288,
nzComponentParams: {
data: data
data: data,
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
console.log('表单信息', instance.validateForm)
data.name = instance.validateForm.value.name
data.code = instance.validateForm.value.code
data.ipAdress = instance.validateForm.value.ip
this.http.put('/api/services/app/Camera/Update', data).subscribe(data => {
resolve(data)
this.message.create('success', '编辑成功!');
this.getCamera()
return true
}, err => {
return false
})
})
await new Promise((resolve) => {
console.log("表单信息", instance.validateForm);
data.name = instance.validateForm.value.name;
data.code = instance.validateForm.value.code;
data.ipAdress = instance.validateForm.value.ip;
this.http.put("/api/services/app/Camera/Update", data).subscribe(
(data) => {
resolve(data);
this.message.create("success", "编辑成功!");
this.getCamera();
return true;
},
(err) => {
return false;
}
);
});
} else {
this.message.create('warning', '请填写完整!');
return false
this.message.create("warning", "请填写完整!");
return false;
}
}
},
});
const instance = modal.getContentComponent();
}
deleteCamera(item) {
console.log(item)
console.log(item);
this.modal.confirm({
nzTitle: `确定要删除${item.name}这个摄像头吗?`,
nzOkText: '确定',
nzOkType: 'primary',
nzOkText: "确定",
nzOkType: "primary",
nzOnOk: () => {
this.http.delete('/api/services/app/Camera/Delete', {
params: {
Id: item.id
}
}).subscribe(data => {
this.message.create('success', '删除成功!');
this.getCamera()
})
this.http
.delete("/api/services/app/Camera/Delete", {
params: {
Id: item.id,
},
})
.subscribe((data) => {
this.message.create("success", "删除成功!");
this.getCamera();
});
},
nzCancelText: '取消'
nzCancelText: "取消",
});
}
}

2
src/app/system-management/navigation/navigation.component.html

@ -25,7 +25,7 @@
<nz-layout>
<nz-header>
<span>Hey,欢迎登录加油站智能安全管理系统</span>
<a nz-dropdown [nzDropdownMenu]="menu" [nzTrigger]="'click'" [nzBackdrop]='false'>
<a nz-dropdown [nzDropdownMenu]="menu" [nzTrigger]="'click'" [nzBackdrop]='false' *ngIf="isZT ==='false'">
<i nz-icon nzType="setting"></i>
</a>
<nz-dropdown-menu #menu="nzDropdownMenu">

2
src/app/system-management/navigation/navigation.component.scss

@ -16,7 +16,7 @@ nz-sider {
width: 100%;
display: flex;
justify-content: center;
margin-top: 40px;
margin-top: 0px;
}
.headPortrait {

16
src/app/system-management/navigation/navigation.component.ts

@ -9,6 +9,7 @@ import { PatternService } from "src/app/service/pattern.service";
})
export class NavigationComponent implements OnInit {
constructor(private router: Router, private patternService: PatternService) {}
isZT = sessionStorage.getItem("isZT") || "false";
userMenu = [];
menu = [];
tap = [];
@ -67,6 +68,16 @@ export class NavigationComponent implements OnInit {
url: "/system/algorithm",
img: "../../../assets/images/icon/license.png",
},
{
name: "中台用户绑定",
url: "/system/userbinding",
img: "../../../assets/images/icon/license.png",
},
{
name: "中台机构绑定",
url: "/system/orbinding",
img: "../../../assets/images/icon/license.png",
},
];
name;
@ -89,7 +100,10 @@ export class NavigationComponent implements OnInit {
// console.log(this.menuList1);
}
for (let index = 0; index < this.menu3.length; index++) {
if (JSON.parse(a).userName == "admin") {
if (
JSON.parse(a).userName == "admin" ||
JSON.parse(a).userName == "superadmin"
) {
this.menuList2 = this.menu3;
} else {
for (let k = 0; k < this.tap.length; k++) {

35
src/app/system-management/or-binding/or-binding-model/or-binding-model.component.html

@ -0,0 +1,35 @@
<div class="orbox">
<div class="topbox">
<div class="righttop">
<nz-input-group nzPrefixIcon="search">
<input type="text" nz-input placeholder="请输入机构名称" [(ngModel)]="searchValue" />
</nz-input-group>
</div>
</div>
<div class="treeTitle">
<span>组织机构</span>
<label nz-checkbox [(ngModel)]="IsContainsChildren" (ngModelChange)="getAllOrganization()">包含子节点</label>
</div>
<div class="treebox">
<nz-tree [nzHideUnMatched]='true' [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes"
[nzExpandedKeys]="defaultExpandedKeys" [nzTreeTemplate]="nzTreeTemplate" nzBlockNode
[nzExpandedIcon]="multiExpandedIconTpl">
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="nodebox">
<span class="name">{{ node.title }}</span>
<div class="operation">
<span class="blueColor" (click)="okbinding(node)">绑定机构</span>
</div>
</div>
</ng-template>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length !== 0">
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'"
class="ant-tree-switcher-line-icon"></i>
</ng-container>
</ng-template>
</div>
</div>

76
src/app/system-management/or-binding/or-binding-model/or-binding-model.component.scss

@ -0,0 +1,76 @@
.orbox {
width: 100%;
max-height: 600px;
overflow-y: auto;
margin-right: 10px;
display: flex;
flex-direction: column;
.treebox {
display: flex;
flex: 1;
overflow: auto;
flex-direction: column;
box-sizing: border-box;
padding: 10px 0;
}
.topbox2 {
width: 100%;
height: 36px;
display: flex;
align-items: center;
margin-top: 20px;
.lefttop {
height: 36px;
line-height: 36px;
color: #000;
margin-right: 10px;
font-size: 15px;
}
.righttop {
flex: 1;
height: 36px;
display: flex;
nz-input-group {
height: 36px;
}
}
}
.treeTitle {
width: 100%;
height: 55px;
line-height: 55px;
margin-top: 12px;
display: flex;
justify-content: space-between;
color: #000d21;
box-sizing: border-box;
padding: 0 10px;
background: rgba(145, 204, 255, 0.2);
border: 1px solid rgba(145, 204, 255, 0.2);
span {
font-size: 14px;
}
div {
flex: 1;
width: 100px;
margin-left: 55px;
}
}
.nodebox {
display: flex;
width: 100%;
justify-content: space-between;
}
}

128
src/app/system-management/or-binding/or-binding-model/or-binding-model.component.ts

@ -0,0 +1,128 @@
import {
Component,
Input,
OnInit,
TemplateRef,
ViewChild,
ViewContainerRef,
} from "@angular/core";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import {
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNodeOptions,
} from "ng-zorro-antd/tree";
import { NzModalService } from "ng-zorro-antd/modal";
import { NzMessageService } from "ng-zorro-antd/message";
import { HttpClient } from "@angular/common/http";
import { TreeService } from "src/app/service/tree.service";
import { NzNotificationService } from "ng-zorro-antd/notification";
@Component({
selector: "app-or-binding-model",
templateUrl: "./or-binding-model.component.html",
styleUrls: ["./or-binding-model.component.scss"],
})
export class OrBindingModelComponent implements OnInit {
@Input() data?: any;
constructor(
private fb: FormBuilder,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private message: NzMessageService,
private http: HttpClient,
private toTree: TreeService,
private notification: NzNotificationService,
private notificationService: NzNotificationService
) {}
level;
getAllUrl;
addUrl;
editUrl;
deleteUrl;
isAdmin: boolean;
ngOnInit(): void {
this.level = JSON.parse(
sessionStorage.getItem("userdata")
).organization.level;
this.getAllUrl = "/api/services/app/User/GetAll";
this.getAllOrganization();
}
nzSelectedKeys: any[] = [];
defaultExpandedKeys = [];
IsContainsChildren = true;
searchValue = "";
totalCount: string;
//获取所有用户
//获取所有组织机构
nodes: any = [];
organization;
async getAllOrganization() {
let userData = null;
if (sessionStorage.getItem("isGasStation") == "true") {
userData = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
} else {
userData = JSON.parse(sessionStorage.getItem("userdata"));
}
let OrganizationUnitId = userData.organization.id;
let OrganizationUnitIds = userData.organizations?.map((v) => v.id);
let params = {
IsContainsChildren: "true",
};
await new Promise<void>((resolve, reject) => {
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe(async (data: any) => {
this.organization = data.result.items;
for (let index = 0; index < data.result.items.length; index++) {
// if (data.result.items[index].id == OrganizationUnitId) {
// data.result.items[index].parentId = null;
// }
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(data.result.items[index].id)) {
data.result.items[index].parentId = null;
}
} else {
if (data.result.items[index].id == OrganizationUnitId) {
data.result.items[index].parentId = null;
}
}
data.result.items[index].title =
data.result.items[index].displayName;
data.result.items[index].key = data.result.items[index].id;
}
this.nodes = [...this.toTree.toTree(data.result.items)];
this.defaultExpandedKeys = [this.nodes[0].id];
});
});
}
okbinding(item) {
console.log(this.data);
console.log(item);
this.modal.confirm({
nzTitle: "确定要绑定到此机构吗?",
nzOkText: "确定",
nzOkType: "primary",
nzOnOk: () => {
this.http
.post("/api/services/app/Organization/SetSinoOrgLocal", null, {
params: {
sinoOrgId: this.data.organId,
localOrgId: item.key,
},
})
.subscribe(() => {
this.message.create("success", "绑定成功");
});
},
nzCancelText: "取消",
nzOnCancel: () => console.log("Cancel"),
});
}
}

56
src/app/system-management/or-binding/or-binding.component.html

@ -0,0 +1,56 @@
<div class="userBox" id="userBox">
<div class="box">
<div class="topbox">
<div class="lefttop">
<span>中台组织机构列表</span>
<span><i nz-icon nzType="search"></i> {{listConfig.totalCount}}个组织</span>
</div>
<div class="righttop">
<button nz-button nzType="primary" style="margin-right: 12px;" (click)="syncOr()">全量同步机构</button>
<button nz-button nzType="primary" style="margin-right: 12px;" (click)="syncUser()">全量同步用户</button>
<!-- <button nz-button nzType="primary" style="margin-right: 12px;" (click)="sync()">同步数据</button> -->
<label class="isBinding" nz-checkbox [(ngModel)]="listConfig.IsBindingLocal"
(ngModelChange)="submitForm()">是否绑定本地机构</label>
<form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
<nz-form-item>
<nz-form-control>
<nz-input-group nzPrefixIcon="search">
<input type="text" nz-input placeholder="请输入站名" formControlName="search" />
</nz-input-group>
</nz-form-control>
<button style="display: none;" type="submit"></button>
</nz-form-item>
</form>
</div>
</div>
<div class="tablebox" #tablebox>
<nz-table #basicTable [nzLoading]="listConfig.loading" [nzData]="listConfig.usersLIst" [nzShowPagination]='false'
[nzPageSize]='16'>
<thead>
<tr>
<th>机构名称</th>
<th>机构类型</th>
<th>已绑机构</th>
<th [width]="'10%'">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{ data.organName }}</td>
<td>{{ getOrganType(data.detail.organType) }}</td>
<td>{{ data.organization?.displayName || '' }}</td>
<td class="operation">
<span class="blueColor" (click)="binding(data)">绑定机构</span>
</td>
</tr>
</tbody>
</nz-table>
</div>
<div class="pagination">
<nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="listConfig.totalCount" [nzPageSize]="16"
[nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)">
</nz-pagination>
<ng-template #totalTemplate let-total> 16条/页,共{{listConfig.totalCount}}条 </ng-template>
</div>
</div>
</div>

168
src/app/system-management/or-binding/or-binding.component.scss

@ -0,0 +1,168 @@
.userBox {
width: 100%;
height: 100%;
background: #ffffff;
box-sizing: border-box;
padding: 20px;
overflow: hidden;
display: flex;
position: relative;
.treebox {
display: flex;
flex: 1;
overflow: auto;
flex-direction: column;
box-sizing: border-box;
padding: 10px 0;
}
.check {
width: 100%;
float: right;
}
.topbox2 {
width: 100%;
height: 36px;
display: flex;
align-items: center;
margin-top: 20px;
.lefttop {
height: 36px;
line-height: 36px;
color: #000;
margin-right: 10px;
font-size: 15px;
}
.righttop {
flex: 1;
height: 36px;
display: flex;
nz-input-group {
height: 36px;
}
}
}
.orbox {
width: 260px;
min-width: 250px;
overflow-y: auto;
margin-right: 10px;
display: flex;
flex-direction: column;
}
.treeTitle {
width: 100%;
height: 55px;
line-height: 55px;
margin-top: 12px;
display: flex;
justify-content: space-between;
color: #000d21;
box-sizing: border-box;
padding: 0 10px;
background: rgba(145, 204, 255, 0.2);
border: 1px solid rgba(145, 204, 255, 0.2);
span {
font-size: 14px;
}
div {
flex: 1;
width: 100px;
margin-left: 55px;
}
}
.nodebox {
display: flex;
justify-content: space-between;
}
tbody {
.operation {
i {
cursor: pointer;
margin-right: 8px;
}
}
}
}
.box {
flex: 1;
// overflow: auto;
padding-top: 20px;
overflow-y: auto;
display: flex;
flex-direction: column;
height: 100%;
}
.topbox {
width: 100%;
height: 36px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
.lefttop {
span:nth-child(1) {
color: #000d21;
margin-right: 16px;
}
span:nth-child(2) {
color: rgba(36, 36, 36, 0.24);
}
}
.righttop {
display: flex;
// align-items: center;
.isBinding {
margin-top: 6px;
}
button {
margin-left: 16px;
}
nz-input-group {
height: 32px;
}
}
}
.tablebox {
flex: 1;
overflow-y: auto;
overflow: auto;
}
.pagination {
margin: 15px 0;
display: flex;
align-items: center;
justify-content: center;
}
.ortype {
width: 36px;
height: 20px;
background: #2399ff;
opacity: 1;
border-radius: 2px;
font-size: 12px;
margin-right: 8px;
color: #fff;
text-align: center;
}

156
src/app/system-management/or-binding/or-binding.component.ts

@ -0,0 +1,156 @@
import {
Component,
OnInit,
TemplateRef,
ViewChild,
ViewContainerRef,
} from "@angular/core";
import { FormBuilder, FormGroup } from "@angular/forms";
import { NzFormatEmitEvent } from "ng-zorro-antd/tree";
import { NzModalService } from "ng-zorro-antd/modal";
import { NzMessageService } from "ng-zorro-antd/message";
import { HttpClient } from "@angular/common/http";
import { TreeService } from "src/app/service/tree.service";
import { NzNotificationService } from "ng-zorro-antd/notification";
import { OrBindingModelComponent } from "./or-binding-model/or-binding-model.component";
// import { BindingComponent } from "./binding/binding.component";
@Component({
selector: "app-or-binding",
templateUrl: "./or-binding.component.html",
styleUrls: ["./or-binding.component.scss"],
})
export class OrBindingComponent implements OnInit {
validateForm!: FormGroup;
constructor(
private fb: FormBuilder,
private http: HttpClient,
private toTree: TreeService,
private modal: NzModalService,
private message: NzMessageService,
private viewContainerRef: ViewContainerRef
) {}
ngOnInit(): void {
this.validateForm = this.fb.group({
search: [null],
});
this.getAllOr();
// this.getAllOrganization();
}
listConfig = {
loading: false,
usersLIst: [],
totalCount: 0,
IsContainsChildren: true,
searchValue: "",
OrganizationUnitId: "",
IsBindingLocal: true,
};
getAllOr() {
this.listConfig.loading = true;
let params = {
Keyword: this.validateForm.value.search
? this.validateForm.value.search
: "",
SkipCount: String(this.SkipCount),
MaxResultCount: String(this.MaxResultCount),
// OrganizationUnitId: this.OrganizationUnitId,
IsBindingLocal: this.listConfig.IsBindingLocal,
// IsActive:true,
// IsContainsChildren: String(this.listConfig.IsContainsChildren),
};
this.http
.get(this.getAllUrl, {
params: params,
})
.subscribe((data: any) => {
console.log("中台组织机构列表", data);
data.result.items.forEach((element) => {
element.detail = JSON.parse(element.detail);
});
this.listConfig.usersLIst = data.result.items;
this.listConfig.totalCount = data.result.totalCount;
this.listConfig.loading = false;
});
}
SkipCount: number = 0; //0 16 32 48
MaxResultCount: number = 16;
pageChange($event) {
this.SkipCount = ($event - 1) * this.MaxResultCount;
this.getAllOr();
}
getAllUrl = "/api/services/app/Organization/GetSinochemOrgs";
//搜索框提交
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
this.getAllOr();
}
getOrganType(type) {
let obj = {
"00": "总公司",
"01": "省公司",
"05": "管理部门",
"06": "大区公司",
"07": "模块",
"08": "管理区域",
"09": "省子公司",
"10": "油站网点/线上商城",
"11": "油库",
};
return obj[type];
}
binding(data) {
const modal = this.modal.create({
nzTitle: "绑定本地机构",
nzContent: OrBindingModelComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1500,
nzFooter: null,
nzMaskClosable: false,
nzComponentParams: {
data: JSON.parse(JSON.stringify(data)),
},
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe((result) => this.getAllOr());
}
// sync() {
// this.http
// .post("/api/services/app/OrganizationSync/AutoSinochemOrgRelate", null)
// .subscribe((data: any) => {
// this.message.create("success", "同步成功");
// });
// }
syncOr() {
this.http
.post("/api/services/app/OrganizationSync/SyncOrgFromSinochem", null)
.subscribe(() => {
this.http
.post(
"/api/services/app/OrganizationSync/AutoSinochemOrgRelate",
null
)
.subscribe(() => {
this.message.create("success", "同步成功");
});
});
}
syncUser() {
this.http
.post("/api/services/app/OrganizationSync/SyncUserFromSinochem", null)
.subscribe(() => {
this.message.create("success", "同步成功");
});
}
}

4
src/app/system-management/organization/change-or/change-or.component.html

@ -0,0 +1,4 @@
<div class="box">
<nz-tree #nzTreeComponent [nzSelectedKeys]="defaultSelectedKeys" [nzData]="nodes"
[nzExpandedKeys]="defaultExpandedKeys"></nz-tree>
</div>

5
src/app/system-management/organization/change-or/change-or.component.scss

@ -0,0 +1,5 @@
.box {
max-height: 500px;
overflow-y: auto;
}

55
src/app/system-management/organization/change-or/change-or.component.ts

@ -0,0 +1,55 @@
import { Component, Input, OnInit, ViewChild } from "@angular/core";
import { NzModalRef } from "ng-zorro-antd/modal";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { HttpClient } from "@angular/common/http";
import { TreeService } from "src/app/service/tree.service";
import { NzTreeComponent } from "ng-zorro-antd/tree";
@Component({
selector: "app-change-or",
templateUrl: "./change-or.component.html",
styleUrls: ["./change-or.component.scss"],
})
export class ChangeOrComponent implements OnInit {
@Input() data?: any;
@ViewChild("nzTreeComponent", { static: false })
nzTreeComponent!: NzTreeComponent;
constructor(
private modal: NzModalRef,
private fb: FormBuilder,
private http: HttpClient,
private toTree: TreeService
) {}
defaultExpandedKeys = [];
defaultSelectedKeys = [];
ngOnInit(): void {
this.getAllOrganization();
// this.nzTreeComponent.getCheckedNodeList()
}
allOrList: any;
nodes: any;
getAllOrganization() {
let params = {
IsContainsChildren: "true",
};
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe((data: any) => {
console.log(data);
data.result.items.forEach((element) => {
element.key = element.id;
element.title = element.displayName;
});
this.allOrList = data.result.items.filter((v) => !v.isGasStation);
this.nodes = [...this.toTree.toTree(this.allOrList)];
});
}
destroyModal(): void {
this.modal.destroy({ data: "this the result data" });
}
}

9
src/app/system-management/organization/organization.component.html

@ -12,7 +12,7 @@
<nz-input-group nzPrefixIcon="search">
<input type="text" nz-input placeholder="请输入单位" [(ngModel)]="searchValue" />
</nz-input-group>
<button nz-button nzType="primary" (click)="addOr()"><i nz-icon nzType="plus-circle"
<button *ngIf="isAdmin" nz-button nzType="primary" (click)="addOr()"><i nz-icon nzType="plus-circle"
nzTheme="outline"></i>新增</button>
</div>
</div>
@ -21,8 +21,8 @@
<span>操作</span>
</div>
<nz-tree [nzHideUnMatched]='true' [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes"
[nzExpandAll]="nzExpandAll" [nzExpandedKeys]="defaultExpandedKeys" [nzTreeTemplate]="nzTreeTemplate" nzDraggable
nzBlockNode (nzOnDrop)="nzEvent($event)" [nzBeforeDrop]="beforeDrop" [nzExpandedIcon]="multiExpandedIconTpl">
[nzExpandAll]="nzExpandAll" [nzExpandedKeys]="defaultExpandedKeys" [nzTreeTemplate]="nzTreeTemplate" nzBlockNode
[nzExpandedIcon]="multiExpandedIconTpl">
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="nodebox">
@ -31,9 +31,10 @@
<span *ngIf="!node.origin.isGasStation">({{node.origin.products? node.origin.products.stationsCount :
0}})</span>
</span>
<span class="operation" *ngIf="level === 1">
<span class="operation" *ngIf="level === 1 && isAdmin">
<span (click)="addOr(node)" *ngIf="!node.origin.isGasStation">新增</span>
<span (click)="waring(node)" *ngIf="node.origin.isGasStation">配置预警事件</span>
<span class="blue" (click)="changeOr(node)">修改所属机构</span>
<span (click)="editOr(node)">编辑</span>
<span [ngClass]="{'grey':node.origin.children && node.origin.children.length != 0}"
(click)="deleteOr(node)">删除</span>

84
src/app/system-management/organization/organization.component.ts

@ -22,6 +22,7 @@ import { NzFormatBeforeDropEvent } from "ng-zorro-antd/tree";
import { Observable, of } from "rxjs";
import { delay } from "rxjs/operators";
import { WarningEventsComponent } from "./warning-events/warning-events.component";
import { ChangeOrComponent } from "./change-or/change-or.component";
@Component({
selector: "app-organization",
templateUrl: "./organization.component.html",
@ -38,8 +39,18 @@ export class OrganizationComponent implements OnInit {
private viewContainerRef: ViewContainerRef
) {}
isAdmin: boolean;
level: number; //当前登录账号的组织机构等级
ngOnInit(): void {
let userdata = JSON.parse(sessionStorage.getItem("userdata"));
if (userdata.userName == "admin" || userdata.userName == "superadmin") {
//是superadmin,是内部制作账号
this.isAdmin = true;
} else {
this.isAdmin = false;
}
this.level = JSON.parse(
sessionStorage.getItem("userdata")
).organization.level;
@ -66,13 +77,7 @@ export class OrganizationComponent implements OnInit {
isLoading = false;
getAllOrganization() {
this.isLoading = true;
let OrganizationUnitId =
sessionStorage.getItem("isGasStation") == "true"
? JSON.parse(sessionStorage.getItem("userdataOfgasstation"))
.organization.id
: JSON.parse(sessionStorage.getItem("userdata")).organization.id;
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true",
};
this.http
@ -89,11 +94,14 @@ export class OrganizationComponent implements OnInit {
//获得组织机构下有多少油站
stationsList;
getStationsNum(e) {
let OrganizationUnitId =
sessionStorage.getItem("isGasStation") == "true"
? JSON.parse(sessionStorage.getItem("userdataOfgasstation"))
.organization.id
: JSON.parse(sessionStorage.getItem("userdata")).organization.id;
let userData = null;
if (sessionStorage.getItem("isGasStation") == "true") {
userData = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
} else {
userData = JSON.parse(sessionStorage.getItem("userdata"));
}
let OrganizationUnitId = userData.organization.id;
let OrganizationUnitIds = userData.organizations?.map((v) => v.id);
this.http
.get(
"/api/services/app/GasStation/GetCountsByOrganizations?IsContainsChildren=true"
@ -110,8 +118,14 @@ export class OrganizationComponent implements OnInit {
};
});
for (let index = 0; index < arrs.length; index++) {
if (arrs[index].id == OrganizationUnitId) {
arrs[index].parentId = null;
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(arrs[index].id)) {
arrs[index].parentId = null;
}
} else {
if (arrs[index].id == OrganizationUnitId) {
arrs[index].parentId = null;
}
}
arrs[index].title = arrs[index].displayName;
arrs[index].key = arrs[index].id;
@ -416,4 +430,48 @@ export class OrganizationComponent implements OnInit {
return of(true);
}
};
changeOr(node) {
const modal = this.modal.create({
nzTitle: "修改所属组织机构",
nzContent: ChangeOrComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 500,
nzComponentParams: {
data: this.allOrList,
},
nzOnOk: async () => {
let selectedNode =
instance.nzTreeComponent.getSelectedNodeList()[0].key;
if (selectedNode) {
await new Promise((resolve) => {
let body = {
id: node.origin.id,
parentId: selectedNode,
displayName: node.origin.displayName,
isGasStation: node.origin.isGasStation,
isSkipAudit: node.origin.isSkipAudit,
level: node.origin.level,
};
this.http
.put(`/api/services/app/Organization/Update`, body)
.subscribe((data) => {
resolve(data);
this.message.create("success", "修改成功!");
this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
this.defaultExpandedKeys.push(item.key);
});
this.getAllOrganization();
return true;
});
});
} else {
this.message.create("warning", "请选择机构!");
return false;
}
},
});
const instance = modal.getContentComponent();
}
}

4
src/app/system-management/system-management-routing.module.ts

@ -11,6 +11,8 @@ import { UpdateOfLicenseComponent } from "./update-of-license/update-of-license.
import { FileOfLicenseComponent } from "./file-of-license/file-of-license.component";
import { MenuComponent } from "./menu/menu.component";
import { AlgorithmConfigComponent } from "./algorithm-config/algorithm-config.component";
import { UserBindingComponent } from "./user-binding/user-binding.component";
import { OrBindingComponent } from "./or-binding/or-binding.component";
const routes: Routes = [
{ path: "organization", component: OrganizationComponent },
{ path: "user", component: UserComponent },
@ -21,6 +23,8 @@ const routes: Routes = [
{ path: "updateOfLicense", component: UpdateOfLicenseComponent },
{ path: "menu", component: MenuComponent },
{ path: "algorithm", component: AlgorithmConfigComponent },
{ path: "userbinding", component: UserBindingComponent },
{ path: "orbinding", component: OrBindingComponent },
];
@NgModule({

15
src/app/system-management/system-management.module.ts

@ -50,7 +50,12 @@ import { NzSwitchModule } from "ng-zorro-antd/switch";
import { NzNotificationModule } from "ng-zorro-antd/notification";
import { DragDropModule } from "@angular/cdk/drag-drop";
import { NzToolTipModule } from "ng-zorro-antd/tooltip";
import { AlgorithmConfigComponent } from './algorithm-config/algorithm-config.component';
import { AlgorithmConfigComponent } from "./algorithm-config/algorithm-config.component";
import { UserBindingComponent } from "./user-binding/user-binding.component";
import { BindingComponent } from "./user-binding/binding/binding.component";
import { OrBindingComponent } from './or-binding/or-binding.component';
import { OrBindingModelComponent } from './or-binding/or-binding-model/or-binding-model.component';
import { ChangeOrComponent } from './organization/change-or/change-or.component';
@NgModule({
declarations: [
OrganizationComponent,
@ -82,6 +87,11 @@ import { AlgorithmConfigComponent } from './algorithm-config/algorithm-config.co
MenusComponent,
WarningEventsComponent,
AlgorithmConfigComponent,
UserBindingComponent,
BindingComponent,
OrBindingComponent,
OrBindingModelComponent,
ChangeOrComponent,
],
imports: [
CommonModule,
@ -107,7 +117,7 @@ import { AlgorithmConfigComponent } from './algorithm-config/algorithm-config.co
NzSwitchModule,
NzNotificationModule,
DragDropModule,
NzToolTipModule
NzToolTipModule,
],
entryComponents: [
AdduserComponent,
@ -129,6 +139,7 @@ import { AlgorithmConfigComponent } from './algorithm-config/algorithm-config.co
EditmenuComponent,
MenusComponent,
WarningEventsComponent,
BindingComponent,
],
})
export class SystemManagementModule {}

113
src/app/system-management/user-binding/binding/binding.component.html

@ -0,0 +1,113 @@
<div class="userBox" id="userBox">
<div class="orbox">
<div class="topbox2">
<div class="lefttop">
组织机构
</div>
<div class="righttop">
<nz-input-group nzPrefixIcon="search">
<input type="text" nz-input placeholder="请输入机构名称" [(ngModel)]="searchValue" />
</nz-input-group>
</div>
</div>
<div class="treeTitle">
<span>组织机构</span>
<label nz-checkbox [(ngModel)]="IsContainsChildren" (ngModelChange)="getAllOrganization()">包含子节点</label>
</div>
<div class="treebox">
<nz-tree [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes"
[nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys]='nzSelectedKeys' (nzClick)="nzClick($event)"
[nzExpandedIcon]="multiExpandedIconTpl" [nzHideUnMatched]="true" [nzTreeTemplate]="nzTreeTemplate">
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="nodebox">
<span class="name">{{ node.title }}</span>
<span class="name">({{node.origin.products? node.origin.products.usersCount : 0}})</span>
</div>
</ng-template>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">
</ng-container>
<ng-template #elseTemplate>
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'"
class="ant-tree-switcher-line-icon"></i>
</ng-template>
</ng-template>
</div>
</div>
<div class="box">
<div class="topbox">
<div class="lefttop">
<span>用户列表</span>
<span><i nz-icon nzType="search"></i> {{usersNum}}名用户</span>
</div>
<div class="righttop">
<form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
<nz-form-item>
<nz-form-control>
<nz-input-group nzPrefixIcon="search">
<input type="text" nz-input placeholder="请输入用户名" formControlName="search" />
</nz-input-group>
</nz-form-control>
<button style="display: none;" type="submit"></button>
</nz-form-item>
</form>
</div>
</div>
<div class="tablebox" #tablebox>
<nz-table #basicTable [nzLoading]="loading" [nzData]="usersLIst" [nzShowPagination]='false'
[nzPageSize]='16'>
<thead>
<tr>
<th></th>
<th>账号</th>
<th>姓名</th>
<!-- <th>角色/预警接收级别</th> -->
<th [width]="'13%'">所属机构</th>
<th [width]="'8%'">用户状态</th>
<th [width]="'8%'">备注</th>
<th [width]="'10%'">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td><img src="../../../assets/images/user.png" alt=""></td>
<td>{{ data.userName }}</td>
<td>{{ data.name }}</td>
<!-- <td nzBreakWord>
<span style="margin-right: 8px;" *ngFor="let item of data.roleDisplayNames">{{item}}</span>
</td> -->
<td>
{{data.organizationName}}
</td>
<td>
<ng-container *ngIf="data.isActive; else elseTemplate">
<span class="greenColor2">已启用</span>
</ng-container>
<ng-template #elseTemplate>
<span class="redColor">已停用</span>
</ng-template>
</td>
<td>
{{data.note}}
</td>
<td class="operation">
<span class="blueColor" (click)="okbinding(data)">确认绑定</span>
</td>
</tr>
</tbody>
</nz-table>
</div>
<div class="pagination">
<nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="usersNum" [nzPageSize]="16"
[nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)">
</nz-pagination>
<ng-template #totalTemplate let-total> 16条/页,共{{usersNum}}条 </ng-template>
</div>
</div>
</div>

223
src/app/system-management/user-binding/binding/binding.component.scss

@ -0,0 +1,223 @@
.userBox {
width: 100%;
max-height: 680px;
background: #FFFFFF;
overflow: hidden;
display: flex;
position: relative;
.treebox {
display: flex;
flex: 1;
overflow: auto;
flex-direction: column;
box-sizing: border-box;
padding: 10px 0;
}
.topbox2 {
width: 100%;
height: 36px;
display: flex;
align-items: center;
margin-top: 20px;
.lefttop {
height: 36px;
line-height: 36px;
color: #000;
margin-right: 10px;
font-size: 15px;
}
.righttop {
flex: 1;
height: 36px;
display: flex;
nz-input-group {
height: 36px;
}
}
}
.orbox {
width: 260px;
min-width: 250px;
overflow-y: auto;
margin-right: 10px;
display: flex;
flex-direction: column;
}
.treeTitle {
width: 100%;
height: 55px;
line-height: 55px;
margin-top: 12px;
display: flex;
justify-content: space-between;
color: #000D21;
box-sizing: border-box;
padding: 0 10px;
background: rgba(145, 204, 255, 0.2);
border: 1px solid rgba(145, 204, 255, 0.2);
span {
font-size: 14px;
}
div {
flex: 1;
width: 100px;
margin-left: 55px;
}
}
.nodebox {
display: flex;
justify-content: space-between;
}
tbody {
tr {
td:nth-child(1) {
text-align: right;
}
}
.operation {
i {
cursor: pointer;
margin-right: 8px;
}
}
}
}
.box {
flex: 1;
padding-top: 20px;
display: flex;
flex-direction: column;
overflow: hidden;
}
.topbox {
width: 100%;
height: 36px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
.lefttop {
span:nth-child(1) {
color: #000D21;
margin-right: 16px;
}
span:nth-child(2) {
color: rgba(36, 36, 36, 0.24);
}
}
.righttop {
display: flex;
button {
margin-left: 16px;
}
nz-input-group {
height: 32px;
}
}
}
.tablebox {
flex: 1;
overflow-y: auto;
}
.pagination {
margin: 15px 0;
display: flex;
align-items: center;
justify-content: center;
}
.ortype {
width: 36px;
height: 20px;
background: #2399FF;
opacity: 1;
border-radius: 2px;
font-size: 12px;
margin-right: 8px;
color: #fff;
text-align: center;
}
.resetPasswordContent {
z-index: 999;
width: 380px;
height: 138px;
position: absolute;
left: 30%;
top: 30%;
display: flex;
flex-direction: column;
justify-content: center;
box-sizing: border-box;
padding-left: 40px;
color: #000;
border-radius: 5px;
border-radius: 2px;
box-shadow: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%), 0 9px 28px 8px rgb(0 0 0 / 5%);
background: #fff;
.titlebox {
display: flex;
align-items: center;
position: relative;
span {
font-size: 18px;
font-weight: 600;
}
i {
font-size: 26px;
margin-right: 6px;
}
.close {
position: absolute;
right: 2px;
top: -22px;
font-size: 16px;
cursor: pointer;
}
.move {
position: absolute;
left: -32px;
top: -22px;
cursor: move;
}
}
.message {
margin-top: 20px;
i {
cursor: pointer;
}
i:hover {
color: #18bb18;
}
}
}

208
src/app/system-management/user-binding/binding/binding.component.ts

@ -0,0 +1,208 @@
import {
Component,
Input,
OnInit,
TemplateRef,
ViewChild,
ViewContainerRef,
} from "@angular/core";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import {
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNodeOptions,
} from "ng-zorro-antd/tree";
import { NzModalService } from "ng-zorro-antd/modal";
import { NzMessageService } from "ng-zorro-antd/message";
import { HttpClient } from "@angular/common/http";
import { TreeService } from "src/app/service/tree.service";
import { NzNotificationService } from "ng-zorro-antd/notification";
@Component({
selector: "app-binding",
templateUrl: "./binding.component.html",
styleUrls: ["./binding.component.scss"],
})
export class BindingComponent implements OnInit {
@Input() data?: any;
validateForm!: FormGroup;
constructor(
private fb: FormBuilder,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private message: NzMessageService,
private http: HttpClient,
private toTree: TreeService,
private notification: NzNotificationService,
private notificationService: NzNotificationService
) {}
level;
getAllUrl;
addUrl;
editUrl;
deleteUrl;
CountsByOrganizations;
isAdmin: boolean;
ngOnInit(): void {
this.validateForm = this.fb.group({
search: [null],
});
this.level = JSON.parse(
sessionStorage.getItem("userdata")
).organization.level;
this.getAllUrl = "/api/services/app/User/GetAll";
this.CountsByOrganizations =
"/api/services/app/User/GetCountsByOrganizations";
this.getAllOrganization();
}
nzSelectedKeys: any[] = [];
defaultExpandedKeys = [];
IsContainsChildren = true;
searchValue = "";
totalCount: string;
//获取所有用户
usersLIst: any = [];
usersNum: string;
OrganizationUnitId;
loading: boolean;
organizationsList = [];
getAllUsers() {
this.loading = true;
let params = {
Keyword: this.validateForm.value.search
? this.validateForm.value.search
: "",
SkipCount: String(this.SkipCount),
MaxResultCount: String(this.MaxResultCount),
OrganizationUnitId: this.OrganizationUnitId,
IsContainsChildren: String(this.IsContainsChildren),
// Sorting: 'BuildingBasicInfo.Id asc'
};
this.http
.get(this.getAllUrl, {
params: params,
})
.subscribe((data: any) => {
this.usersLIst = data.result.items;
this.usersNum = data.result.totalCount;
this.loading = false;
});
}
SkipCount: number = 0; //0 16 32 48
MaxResultCount: number = 16;
pageChange($event) {
this.SkipCount = ($event - 1) * this.MaxResultCount;
this.getAllUsers();
}
//获取所有组织机构
nodes: any = [];
organization;
async getAllOrganization() {
let params = {
IsContainsChildren: "true",
};
await new Promise<void>((resolve, reject) => {
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe(async (data: any) => {
this.organization = data.result.items;
await this.getuser(data.result.items);
resolve(data);
this.getAllUsers();
});
});
}
async getuser(e) {
let userData = null;
if (sessionStorage.getItem("isGasStation") == "true") {
userData = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
} else {
userData = JSON.parse(sessionStorage.getItem("userdata"));
}
let OrganizationUnitId = userData.organization.id;
let OrganizationUnitIds = userData.organizations?.map((v) => v.id);
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true",
IsUsersCountContainsChildren: String(this.IsContainsChildren),
};
await new Promise<void>((resolve, reject) => {
this.http
.get(this.CountsByOrganizations, {
params: params,
})
.subscribe((data: any) => {
resolve(data);
this.organizationsList = data.result;
const arrs = e.map((item) => {
const data = this.organizationsList.find(
(i) => item.id == i.organizationId
);
return {
...item,
products: data ? data : false,
};
});
for (let index = 0; index < arrs.length; index++) {
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(arrs[index].id)) {
arrs[index].parentId = null;
}
} else {
if (arrs[index].id == OrganizationUnitId) {
arrs[index].parentId = null;
}
}
arrs[index].title = arrs[index].displayName;
arrs[index].key = arrs[index].id;
}
this.nodes = [...this.toTree.toTree(arrs)];
this.defaultExpandedKeys = [this.nodes[0].id];
this.nzSelectedKeys = [this.nodes[0].id];
this.OrganizationUnitId = [this.nodes[0].id];
});
});
}
//搜索框提交
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
this.getAllUsers();
}
nzClick(event: NzFormatEmitEvent) {
this.nzSelectedKeys[0] = event.node.origin.id;
this.nzSelectedKeys = [...this.nzSelectedKeys];
this.OrganizationUnitId = event.node.origin.id;
this.getAllUsers();
}
okbinding(item) {
this.modal.confirm({
nzTitle: "确定要绑定到此本地用户吗?",
nzOkText: "确定",
nzOkType: "primary",
nzOnOk: () => {
this.http
.post("/api/services/app/User/SetSinochemUserLocal", null, {
params: {
sinochemUserId: this.data.userId,
localUserId: item.id,
},
})
.subscribe(() => {
this.message.create("success", "绑定成功");
});
},
nzCancelText: "取消",
nzOnCancel: () => console.log("Cancel"),
});
}
}

101
src/app/system-management/user-binding/user-binding.component.html

@ -0,0 +1,101 @@
<div class="userBox" id="userBox">
<!-- <div class="orbox">
<div class="topbox2">
<div class="lefttop">
组织机构
</div>
<div class="righttop">
<nz-input-group nzPrefixIcon="search">
<input type="text" nz-input placeholder="请输入机构名称" [(ngModel)]="searchValue" />
</nz-input-group>
</div>
</div>
<div class="treeTitle">
<span>组织机构</span>
<label nz-checkbox [(ngModel)]="IsContainsChildren" (ngModelChange)="getAllOrganization()">包含子节点</label>
</div>
<div class="treebox">
<nz-tree [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes" [nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]='nzSelectedKeys' (nzClick)="nzClick($event)" [nzExpandedIcon]="multiExpandedIconTpl"
[nzHideUnMatched]="true" [nzTreeTemplate]="nzTreeTemplate">
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="nodebox">
<span class="name">{{ node.title }}</span>
<span class="name">({{node.origin.products? node.origin.products.usersCount : 0}})</span>
</div>
</ng-template>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">
</ng-container>
<ng-template #elseTemplate>
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'" class="ant-tree-switcher-line-icon"></i>
</ng-template>
</ng-template>
</div>
</div> -->
<div class="box">
<div class="topbox">
<div class="lefttop">
<span>中台用户列表</span>
<span><i nz-icon nzType="search"></i> {{listConfig.totalCount}}名用户</span>
</div>
<div class="righttop">
<label class="isBinding" nz-checkbox [(ngModel)]="listConfig.IsBindingLocal" (ngModelChange)="submitForm()">是否绑定本地用户</label>
<form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
<nz-form-item>
<nz-form-control>
<nz-input-group nzPrefixIcon="search">
<input type="text" nz-input placeholder="请输入用户名" formControlName="search" />
</nz-input-group>
</nz-form-control>
<button style="display: none;" type="submit"></button>
</nz-form-item>
</form>
</div>
</div>
<div class="tablebox" #tablebox>
<nz-table #basicTable [nzLoading]="listConfig.loading" [nzData]="listConfig.usersLIst" [nzShowPagination]='false'
[nzPageSize]='16'>
<thead>
<tr>
<th [width]="'5%'"></th>
<th>账号</th>
<th>账号id</th>
<th>绑定的本地用户id</th>
<th [width]="'8%'">备注</th>
<th [width]="'10%'">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td><img src="../../../assets/images/user.png" alt=""></td>
<td>{{ data.loginName }}</td>
<td>{{ data.userId }}</td>
<td>
{{data.localUserId}}
</td>
<td>
{{data.detail}}
</td>
<td class="operation">
<span class="blueColor" (click)="binding(data)">绑定本地用户</span>
</td>
</tr>
</tbody>
</nz-table>
</div>
<div class="pagination">
<nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="listConfig.totalCount" [nzPageSize]="16"
[nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)">
</nz-pagination>
<ng-template #totalTemplate let-total> 16条/页,共{{listConfig.totalCount}}条 </ng-template>
</div>
</div>
</div>

173
src/app/system-management/user-binding/user-binding.component.scss

@ -0,0 +1,173 @@
.userBox {
width: 100%;
height: 100%;
background: #ffffff;
box-sizing: border-box;
padding: 20px;
overflow: hidden;
display: flex;
position: relative;
.treebox {
display: flex;
flex: 1;
overflow: auto;
flex-direction: column;
box-sizing: border-box;
padding: 10px 0;
}
.check {
width: 100%;
float: right;
}
.topbox2 {
width: 100%;
height: 36px;
display: flex;
align-items: center;
margin-top: 20px;
.lefttop {
height: 36px;
line-height: 36px;
color: #000;
margin-right: 10px;
font-size: 15px;
}
.righttop {
flex: 1;
height: 36px;
display: flex;
nz-input-group {
height: 36px;
}
}
}
.orbox {
width: 260px;
min-width: 250px;
overflow-y: auto;
margin-right: 10px;
display: flex;
flex-direction: column;
}
.treeTitle {
width: 100%;
height: 55px;
line-height: 55px;
margin-top: 12px;
display: flex;
justify-content: space-between;
color: #000d21;
box-sizing: border-box;
padding: 0 10px;
background: rgba(145, 204, 255, 0.2);
border: 1px solid rgba(145, 204, 255, 0.2);
span {
font-size: 14px;
}
div {
flex: 1;
width: 100px;
margin-left: 55px;
}
}
.nodebox {
display: flex;
justify-content: space-between;
}
tbody {
tr {
td:nth-child(1) {
text-align: right;
}
}
.operation {
i {
cursor: pointer;
margin-right: 8px;
}
}
}
}
.box {
flex: 1;
// overflow: auto;
padding-top: 20px;
overflow-y: auto;
display: flex;
flex-direction: column;
height: 100%;
}
.topbox {
width: 100%;
height: 36px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
.lefttop {
span:nth-child(1) {
color: #000d21;
margin-right: 16px;
}
span:nth-child(2) {
color: rgba(36, 36, 36, 0.24);
}
}
.righttop {
display: flex;
// align-items: center;
.isBinding {
margin-top: 6px;
}
button {
margin-left: 16px;
}
nz-input-group {
height: 32px;
}
}
}
.tablebox {
flex: 1;
overflow-y: auto;
overflow: auto;
}
.pagination {
margin: 15px 0;
display: flex;
align-items: center;
justify-content: center;
}
.ortype {
width: 36px;
height: 20px;
background: #2399ff;
opacity: 1;
border-radius: 2px;
font-size: 12px;
margin-right: 8px;
color: #fff;
text-align: center;
}

106
src/app/system-management/user-binding/user-binding.component.ts

@ -0,0 +1,106 @@
import {
Component,
OnInit,
TemplateRef,
ViewChild,
ViewContainerRef,
} from "@angular/core";
import { FormBuilder, FormGroup } from "@angular/forms";
import { NzFormatEmitEvent } from "ng-zorro-antd/tree";
import { NzModalService } from "ng-zorro-antd/modal";
import { NzMessageService } from "ng-zorro-antd/message";
import { HttpClient } from "@angular/common/http";
import { TreeService } from "src/app/service/tree.service";
import { NzNotificationService } from "ng-zorro-antd/notification";
import { BindingComponent } from "./binding/binding.component";
@Component({
selector: "app-user-binding",
templateUrl: "./user-binding.component.html",
styleUrls: ["./user-binding.component.scss"],
})
export class UserBindingComponent implements OnInit {
validateForm!: FormGroup;
constructor(
private fb: FormBuilder,
private http: HttpClient,
private toTree: TreeService,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef
) {}
ngOnInit(): void {
this.validateForm = this.fb.group({
search: [null],
});
this.getAllUsers();
// this.getAllOrganization();
}
listConfig = {
loading: false,
usersLIst: [],
totalCount: 0,
IsContainsChildren: true,
searchValue: "",
OrganizationUnitId: "",
IsBindingLocal: true,
};
getAllUsers() {
this.listConfig.loading = true;
let params = {
Keyword: this.validateForm.value.search
? this.validateForm.value.search
: "",
SkipCount: String(this.SkipCount),
MaxResultCount: String(this.MaxResultCount),
// OrganizationUnitId: this.OrganizationUnitId,
IsBindingLocal: this.listConfig.IsBindingLocal,
// IsActive:true,
// IsContainsChildren: String(this.listConfig.IsContainsChildren),
};
this.http
.get(this.getAllUrl, {
params: params,
})
.subscribe((data: any) => {
console.log("中台用户列表", data);
this.listConfig.usersLIst = data.result.items;
this.listConfig.totalCount = data.result.totalCount;
this.listConfig.loading = false;
});
}
SkipCount: number = 0; //0 16 32 48
MaxResultCount: number = 16;
pageChange($event) {
this.SkipCount = ($event - 1) * this.MaxResultCount;
this.getAllUsers();
}
getAllUrl = "/api/services/app/User/GetSinochemUsers";
//搜索框提交
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
this.getAllUsers();
}
binding(data) {
const modal = this.modal.create({
nzTitle: "绑定本地用户",
nzContent: BindingComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1500,
nzFooter: null,
nzMaskClosable: false,
nzComponentParams: {
data: JSON.parse(JSON.stringify(data)),
},
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe((result) => this.getAllUsers());
}
}

122
src/app/system-management/user/adduser/adduser.component.ts

@ -1,19 +1,23 @@
import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
import { Component, OnInit, Input } from "@angular/core";
import { NzModalRef } from "ng-zorro-antd/modal";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { HttpClient } from "@angular/common/http";
import { TreeService } from "src/app/service/tree.service";
@Component({
selector: 'app-adduser',
templateUrl: './adduser.component.html',
styleUrls: ['./adduser.component.scss']
selector: "app-adduser",
templateUrl: "./adduser.component.html",
styleUrls: ["./adduser.component.scss"],
})
export class AdduserComponent implements OnInit {
@Input() title?: string;
@Input() subtitle?: string;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { }
constructor(
private modal: NzModalRef,
private fb: FormBuilder,
private http: HttpClient,
private toTree: TreeService
) {}
ngOnInit(): void {
this.validateForm = this.fb.group({
@ -23,15 +27,15 @@ export class AdduserComponent implements OnInit {
role: [[], [Validators.required]],
role2: [[]],
phonenum: [null, [Validators.required]],
note:[null]
note: [null],
});
this.getAllRoles()
this.getAllRoles2()
this.getAllOrganization()
this.getAllRoles();
this.getAllRoles2();
this.getAllOrganization();
}
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
this.modal.destroy({ data: "this the result data" });
}
listOfData: any[] = [];
@ -39,49 +43,67 @@ export class AdduserComponent implements OnInit {
//获取角色列表
getAllRoles() {
let params = {
SkipCount: '0',
MaxResultCount: '999'
}
this.http.get('/api/services/app/Role/GetAll', {
params: params
}).subscribe((data: any) => {
// console.log('角色列表', data.result.items)
this.listOfData = data.result.items
})
SkipCount: "0",
MaxResultCount: "999",
};
this.http
.get("/api/services/app/Role/GetAll", {
params: params,
})
.subscribe((data: any) => {
// console.log('角色列表', data.result.items)
this.listOfData = data.result.items;
});
}
//获取角色列表
getAllRoles2() {
let params = {
SkipCount: '0',
MaxResultCount: '999',
IsViolationRoles:'true'
}
this.http.get('/api/services/app/Role/GetAll', {
params: params
}).subscribe((data: any) => {
// console.log('角色列表', data.result.items)
this.listOfData2 = data.result.items
})
SkipCount: "0",
MaxResultCount: "999",
IsViolationRoles: "true",
};
this.http
.get("/api/services/app/Role/GetAll", {
params: params,
})
.subscribe((data: any) => {
// console.log('角色列表', data.result.items)
this.listOfData2 = data.result.items;
});
}
//获取所有组织机构
nodes: any = []
nodes: any = [];
getAllOrganization() {
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true"
let userData = null;
if (sessionStorage.getItem("isGasStation") == "true") {
userData = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
} else {
userData = JSON.parse(sessionStorage.getItem("userdata"));
}
this.http.get('/api/services/app/Organization/GetAll', {
params: params
}).subscribe((data: any) => {
data.result.items.forEach(element => {
if (element.id == OrganizationUnitId) {
element.parentId = null
}
element.key = element.id
element.title = element.displayName
let OrganizationUnitId = userData.organization.id;
let OrganizationUnitIds = userData.organizations?.map((v) => v.id);
let params = {
IsContainsChildren: "true",
};
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(element.id)) {
element.parentId = null;
}
} else {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
}
element.key = element.id;
element.title = element.displayName;
});
this.nodes = [...this.toTree.toTree(data.result.items)];
});
this.nodes = [...this.toTree.toTree(data.result.items)]
})
}
}

276
src/app/system-management/user/edituser/edituser.component.ts

@ -1,34 +1,40 @@
import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
import { NzMessageService } from 'ng-zorro-antd/message';
import { Component, OnInit, Input } from "@angular/core";
import { NzModalRef } from "ng-zorro-antd/modal";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { HttpClient } from "@angular/common/http";
import { TreeService } from "src/app/service/tree.service";
import { NzMessageService } from "ng-zorro-antd/message";
@Component({
selector: 'app-edituser',
templateUrl: './edituser.component.html',
styleUrls: ['./edituser.component.scss']
selector: "app-edituser",
templateUrl: "./edituser.component.html",
styleUrls: ["./edituser.component.scss"],
})
export class EdituserComponent implements OnInit {
@Input() data?: any;
@Input() listOfData?: any;
@Input() listOfData2?: any;
@Input() nodes?: any;
@Input() editUrl?: any;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private message: NzMessageService) { }
constructor(
private modal: NzModalRef,
private fb: FormBuilder,
private http: HttpClient,
private toTree: TreeService,
private message: NzMessageService
) {}
isAdmin: boolean;
ngOnInit(): void {
console.log(this.data)
let roleData1 = []
let roleData2 = []
this.data.roleNames.forEach(element => {
if (element.indexOf('LEVEL') != -1) {
roleData2.push(element)
console.log(this.data);
let roleData1 = [];
let roleData2 = [];
this.data.roleNames.forEach((element) => {
if (element.indexOf("LEVEL") != -1) {
roleData2.push(element);
} else {
roleData1.push(element)
roleData1.push(element);
}
});
this.validateForm = this.fb.group({
@ -38,116 +44,158 @@ export class EdituserComponent implements OnInit {
role: [roleData1, [Validators.required]],
role2: [roleData2],
phonenum: [null, [Validators.required]],
note: [null]
note: [null],
});
let userdata = JSON.parse(sessionStorage.getItem("userdata"));
if (userdata.userName == "admin" || userdata.userName == "superadmin") {
//是superadmin,是内部制作账号
this.isAdmin = true;
} else {
this.isAdmin = false;
this.validateForm.get("account").disable();
this.validateForm.get("name").disable();
this.validateForm.get("organization").disable();
this.validateForm.get("phonenum").disable();
}
if (this.listOfData.length == 0) {
this.getAllRoles()
this.getAllRoles();
}
if (this.listOfData2.length == 0) {
this.getAllRoles2()
this.getAllRoles2();
}
if (this.nodes.length == 0) {
this.getAllOrganization()
this.getAllOrganization();
}
}
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
this.modal.destroy({ data: "this the result data" });
}
//获取角色列表
async getAllRoles() {
let params = {
SkipCount: '0',
MaxResultCount: '999'
}
SkipCount: "0",
MaxResultCount: "999",
};
await new Promise<void>((resolve, reject) => {
this.http.get('/api/services/app/Role/GetAll', {
params: params
}).subscribe((data: any) => {
resolve(data)
this.listOfData = data.result.items
})
})
this.http
.get("/api/services/app/Role/GetAll", {
params: params,
})
.subscribe((data: any) => {
resolve(data);
this.listOfData = data.result.items;
});
});
}
//获取角色列表
async getAllRoles2() {
let params = {
SkipCount: '0',
MaxResultCount: '999',
IsViolationRoles: 'true'
}
SkipCount: "0",
MaxResultCount: "999",
IsViolationRoles: "true",
};
await new Promise<void>((resolve, reject) => {
this.http.get('/api/services/app/Role/GetAll', {
params: params
}).subscribe((data: any) => {
resolve(data)
this.listOfData2 = data.result.items
})
})
this.http
.get("/api/services/app/Role/GetAll", {
params: params,
})
.subscribe((data: any) => {
resolve(data);
this.listOfData2 = data.result.items;
});
});
}
//获取所有组织机构
async getAllOrganization() {
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true"
let userData = null;
if (sessionStorage.getItem("isGasStation") == "true") {
userData = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
} else {
userData = JSON.parse(sessionStorage.getItem("userdata"));
}
let OrganizationUnitId = userData.organization.id;
let OrganizationUnitIds = userData.organizations?.map((v) => v.id);
let params = {
IsContainsChildren: "true",
};
await new Promise<void>((resolve, reject) => {
this.http.get('/api/services/app/Organization/GetAll', {
params: params
}).subscribe((data: any) => {
data.result.items.forEach(element => {
if (element.id == OrganizationUnitId) {
element.parentId = null
}
element.key = element.id
element.title = element.displayName
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(element.id)) {
element.parentId = null;
}
} else {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
}
element.key = element.id;
element.title = element.displayName;
});
this.nodes = [...this.toTree.toTree(data.result.items)];
resolve(data);
});
this.nodes = [...this.toTree.toTree(data.result.items)]
resolve(data)
})
})
});
}
isLoading = false
isLoading = false;
//确定
async ok() {
this.isLoading = true
// console.log(this.validateForm);
// return;
this.isLoading = true;
if (this.validateForm.valid) {
return await new Promise(resolve => {
for (let index = 0; index < this.validateForm.value.role2.length; index++) {
return await new Promise((resolve) => {
for (
let index = 0;
index < this.validateForm.value.role2.length;
index++
) {
const element = this.validateForm.value.role2[index];
if (element.indexOf('HANDLE') != -1) {
this.validateForm.value.role2.splice(index, 1)
index--
if (element.indexOf("HANDLE") != -1) {
this.validateForm.value.role2.splice(index, 1);
index--;
}
}
let roleNames = [...this.validateForm.value.role, ...this.validateForm.value.role2]
let roleNames = [
...this.validateForm.value.role,
...this.validateForm.value.role2,
];
let body = {
id: this.data.id,
userName: this.validateForm.value.account,
name: this.validateForm.value.name,
organizationUnitId: this.validateForm.value.organization,
userName: this.validateForm.controls.account.value,
name: this.validateForm.controls.name.value,
organizationUnitId: this.validateForm.controls.organization.value,
roleNames: roleNames,
phoneNumber: this.validateForm.value.phonenum,
note:this.validateForm.value.note,
isActive: true
}
this.http.put(this.editUrl, body).subscribe((data:any) => {
resolve(data)
this.data.auditStatus = data.result.auditStatus
this.isLoading = false
this.message.create('success', '保存成功!');
}, err => {
resolve(err)
this.isLoading = false
this.message.create('warning', '保存失败');
})
})
phoneNumber: this.validateForm.controls.phonenum.value,
note: this.validateForm.controls.note.value,
isActive: true,
};
this.http.put(this.editUrl, body).subscribe(
(data: any) => {
resolve(data);
this.data.auditStatus = data.result.auditStatus;
this.isLoading = false;
this.message.create("success", "保存成功!");
},
(err) => {
resolve(err);
this.isLoading = false;
this.message.create("warning", "保存失败");
}
);
});
} else {
this.message.create('warning', '请填写完整!');
this.message.create("warning", "请填写完整!");
}
}
//取消
@ -156,28 +204,38 @@ export class EdituserComponent implements OnInit {
}
//提交审核
async audit(type) {
if (type && this.data.auditStatus == 5) {//提交审核
this.message.create('warning', '审核完成的不能重复提交,请编辑后提交');
return
if (type && this.data.auditStatus == 5) {
//提交审核
this.message.create("warning", "审核完成的不能重复提交,请编辑后提交");
return;
}
if(type){
await this.ok()
if (type) {
await this.ok();
}
this.isLoading = true
let url
type ? url = '/api/services/app/EdittingUser/Commit' : url = '/api/services/app/EdittingUser/Uncommit'
this.http.post(url, '', {
params: {
id: this.data.id
}
}).subscribe((data: any) => {
this.data.auditStatus = data.result.auditStatus
this.isLoading = false
this.message.create('success', type ? '提交审核成功' : '撤销审核成功');
}, err => {
this.isLoading = false
this.message.create('error', type ? '提交审核失败' : '撤销审核失败');
})
this.isLoading = true;
let url;
type
? (url = "/api/services/app/EdittingUser/Commit")
: (url = "/api/services/app/EdittingUser/Uncommit");
this.http
.post(url, "", {
params: {
id: this.data.id,
},
})
.subscribe(
(data: any) => {
this.data.auditStatus = data.result.auditStatus;
this.isLoading = false;
this.message.create(
"success",
type ? "提交审核成功" : "撤销审核成功"
);
},
(err) => {
this.isLoading = false;
this.message.create("error", type ? "提交审核失败" : "撤销审核失败");
}
);
}
}

16
src/app/system-management/user/user.component.html

@ -82,11 +82,11 @@
<button style="display: none;" type="submit"></button>
</nz-form-item>
</form>
<button nz-button nzType="primary" (click)="addUser()"><i nz-icon nzType="plus-circle"
<button *ngIf="isAdmin" nz-button nzType="primary" (click)="addUser()"><i nz-icon nzType="plus-circle"
nzTheme="outline"></i>新增</button>
</div>
</div>
<div class="tablebox">
<div class="tablebox" #tablebox>
<nz-table #basicTable [nzLoading]="loading" [nzData]="usersLIst" [nzShowPagination]='false' [nzPageSize]='16'>
<thead>
<tr>
@ -129,7 +129,7 @@
<td class="operation">
<i class="blueColor" nz-icon nzType="form" nzTheme="outline" (click)="editUser(data)" nz-tooltip
nzTooltipTitle="编辑"></i>
<i nz-icon nz-tooltip nzTooltipTitle="重置密码" (click)="resetPassword(data)">
<i *ngIf="isAdmin" nz-icon nz-tooltip nzTooltipTitle="重置密码" (click)="resetPassword(data)">
<svg width="14" height="14">
<path
d="M766.598 75.624c-112.55-65.312-250.07-87.553-385.693-51.212C110.437 96.883-50.07 374.89 22.4 645.357c72.472 270.468 350.479 430.975 620.946 358.504 270.467-72.472 430.975-350.479 358.503-620.946-0.211-0.789-0.424-1.577-0.639-2.363h-62.505a454.786 454.786 0 0 1 5.189 17.892c63.895 238.46-77.618 483.566-316.077 547.461-238.46 63.895-483.566-77.617-547.461-316.077-63.895-238.46 77.617-483.566 316.077-547.46 119.62-32.053 240.912-12.416 340.164 45.217l-42.383 73.409 217.66-6.997L809.104 2l-42.507 73.624z"
@ -139,12 +139,12 @@
fill="#36A2FF" p-id="2328"></path>
</svg>
</i>
<i *ngIf="!data.isActive" class="greenColor2" nz-icon nzType="stop" nzTheme="outline" nz-tooltip
nzTooltipTitle="启用" (click)="cancel(data,true)"></i>
<i *ngIf="data.isActive" class="redColor" nz-icon nzType="stop" nzTheme="outline" nz-tooltip
<i *ngIf="!data.isActive && isAdmin" class="greenColor2" nz-icon nzType="stop" nzTheme="outline"
nz-tooltip nzTooltipTitle="启用" (click)="cancel(data,true)"></i>
<i *ngIf="data.isActive && isAdmin" class="redColor" nz-icon nzType="stop" nzTheme="outline" nz-tooltip
nzTooltipTitle="停用" (click)="cancel(data,false)"></i>
<i class="redColor" nz-icon nzType="poweroff" nzTheme="outline" nz-tooltip nzTooltipTitle="注销"
(click)="delete(data)"></i>
<i *ngIf="isAdmin" class="redColor" nz-icon nzType="poweroff" nzTheme="outline" nz-tooltip
nzTooltipTitle="注销" (click)="delete(data)"></i>
</td>
</tr>
</tbody>

38
src/app/system-management/user/user.component.ts

@ -46,7 +46,16 @@ export class UserComponent implements OnInit {
editUrl;
deleteUrl;
CountsByOrganizations;
isAdmin: boolean;
ngOnInit(): void {
let userdata = JSON.parse(sessionStorage.getItem("userdata"));
if (userdata.userName == "admin" || userdata.userName == "superadmin") {
//是superadmin,是内部制作账号
this.isAdmin = true;
} else {
this.isAdmin = false;
}
this.validateForm = this.fb.group({
search: [null],
});
@ -152,13 +161,7 @@ export class UserComponent implements OnInit {
nodes: any = [];
organization;
async getAllOrganization() {
let OrganizationUnitId =
sessionStorage.getItem("isGasStation") == "true"
? JSON.parse(sessionStorage.getItem("userdataOfgasstation"))
.organization.id
: JSON.parse(sessionStorage.getItem("userdata")).organization.id;
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true",
};
await new Promise<void>((resolve, reject) => {
@ -175,11 +178,14 @@ export class UserComponent implements OnInit {
});
}
async getuser(e) {
let OrganizationUnitId =
sessionStorage.getItem("isGasStation") == "true"
? JSON.parse(sessionStorage.getItem("userdataOfgasstation"))
.organization.id
: JSON.parse(sessionStorage.getItem("userdata")).organization.id;
let userData = null;
if (sessionStorage.getItem("isGasStation") == "true") {
userData = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
} else {
userData = JSON.parse(sessionStorage.getItem("userdata"));
}
let OrganizationUnitId = userData.organization.id;
let OrganizationUnitIds = userData.organizations?.map((v) => v.id);
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true",
@ -204,8 +210,14 @@ export class UserComponent implements OnInit {
});
for (let index = 0; index < arrs.length; index++) {
if (arrs[index].id == OrganizationUnitId) {
arrs[index].parentId = null;
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) {
if (OrganizationUnitIds.includes(arrs[index].id)) {
arrs[index].parentId = null;
}
} else {
if (arrs[index].id == OrganizationUnitId) {
arrs[index].parentId = null;
}
}
arrs[index].title = arrs[index].displayName;
arrs[index].key = arrs[index].id;

BIN
src/assets/sound/chouyan.mp3

Binary file not shown.

BIN
src/assets/sound/chuangru.mp3

Binary file not shown.

BIN
src/assets/sound/dadianhua.mp3

Binary file not shown.

BIN
src/assets/sound/gongzhuang.mp3

Binary file not shown.

BIN
src/assets/sound/jinchukou.mp3

Binary file not shown.

BIN
src/assets/sound/minghuo.mp3

Binary file not shown.

BIN
src/assets/sound/xychaichuxyguan.mp3

Binary file not shown.

BIN
src/assets/sound/xygeli.mp3

Binary file not shown.

BIN
src/assets/sound/xyjianxie.mp3

Binary file not shown.

BIN
src/assets/sound/xyjiedi.mp3

Binary file not shown.

BIN
src/assets/sound/xymiehuoqi.mp3

Binary file not shown.

BIN
src/assets/sound/xywuren.mp3

Binary file not shown.

BIN
src/assets/sound/xyxianchang.mp3

Binary file not shown.

BIN
src/assets/sound/xyxieyouguan.mp3

Binary file not shown.

BIN
src/assets/sound/yanwu.mp3

Binary file not shown.

61
src/styles.scss

@ -104,8 +104,8 @@ h1 {
//三维场景
.dropDown {
border: 1px solid #23D9FF;
background: linear-gradient(180deg, #000D21 0%, #006E85 100%);
border: 1px solid #23d9ff;
background: linear-gradient(180deg, #000d21 0%, #006e85 100%);
li:hover {
background-color: transparent;
@ -121,8 +121,8 @@ h1 {
}
.dropDownPlan {
background: linear-gradient(360deg, #000D21 0%, rgba(0, 59, 110, 0.8) 100%);
box-shadow: 0px 0px 6px #2399FF;
background: linear-gradient(360deg, #000d21 0%, rgba(0, 59, 110, 0.8) 100%);
box-shadow: 0px 0px 6px #2399ff;
li {
color: #fff;
@ -131,10 +131,9 @@ h1 {
//任务弹窗
.taskDialog {
.ant-modal-header,
.ant-modal-content {
background: radial-gradient(circle, #004988 0%, #00122D 100%);
background: radial-gradient(circle, #004988 0%, #00122d 100%);
}
.ant-modal-header,
@ -143,26 +142,26 @@ h1 {
}
.ant-modal-title,
.ant-form-item-label>label,
.ant-form-item-label > label,
.ant-input {
color: #C4E2FC;
color: #c4e2fc;
}
.ant-modal-footer .ant-btn:first-child {
color: #C4E2FC;
background: #000D21;
border: 1px solid #C4E2FC;
color: #c4e2fc;
background: #000d21;
border: 1px solid #c4e2fc;
}
.ant-modal-footer .ant-btn:last-child {
color: #C4E2FC;
color: #c4e2fc;
background: rgba(0, 129, 255, 0.6);
border: 1px solid #36A2FF;
border: 1px solid #36a2ff;
}
.ant-input {
background: rgba(145, 204, 255, 0.41);
border: 1px solid #91CCFF;
border: 1px solid #91ccff;
}
textarea {
@ -181,7 +180,11 @@ h1 {
.ant-modal-body,
.ant-modal-content {
height: 100%;
background: radial-gradient(closest-side at 50% 55%, #004988 0%, #00122D 100%);
background: radial-gradient(
closest-side at 50% 55%,
#004988 0%,
#00122d 100%
);
}
}
@ -214,7 +217,6 @@ h1 {
//bbl 内置color
#threeDimensional {
//可展开面板
#disposalPlan {
font-size: 15px;
@ -223,7 +225,7 @@ h1 {
width: 100%;
height: 35px;
line-height: 35px;
color: #23D9FF;
color: #23d9ff;
padding: 0px;
background: rgba(35, 153, 255, 0.41);
border: 1px solid rgba(35, 217, 255, 0.4);
@ -235,12 +237,12 @@ h1 {
.ant-collapse-content {
background-color: transparent;
width: 100%
width: 100%;
}
}
.ant-tree {
color: #C4E2FC;
color: #c4e2fc;
}
//tree
@ -257,7 +259,8 @@ h1 {
//tree
.ant-select-disabled.ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
.ant-select-disabled.ant-select-single:not(.ant-select-customize-input)
.ant-select-selector {
color: #fff;
}
@ -296,9 +299,9 @@ h1 {
padding-left: 5px;
height: 30px;
line-height: 28px;
background: linear-gradient(360deg, #000D21 0%, rgba(0, 59, 110, 0.8) 100%);
background: linear-gradient(360deg, #000d21 0%, rgba(0, 59, 110, 0.8) 100%);
border: 1px solid rgba(35, 217, 255, 0.4);
color: #23D9FF;
color: #23d9ff;
.ant-collapse-arrow {
left: 5px;
@ -320,7 +323,7 @@ h1 {
}
::-webkit-scrollbar-thumb {
background-image: linear-gradient(#2495f8, #1c73c2, #02233f, );
background-image: linear-gradient(#2495f8, #1c73c2, #02233f);
}
::-webkit-scrollbar-track {
@ -366,7 +369,7 @@ ul {
}
.btn {
color: #36A2FF;
color: #36a2ff;
span {
cursor: pointer;
@ -380,7 +383,6 @@ ul {
margin-right: 40px;
}
}
}
.spin {
@ -395,3 +397,12 @@ ul {
left: 0;
top: 0;
}
#progressBar {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 5px;
background-color: #ccc; /* 进度条默认颜色 */
}

18
src/theme.less

@ -419,13 +419,13 @@
}
nz-tree {
nz-tree-node {
margin-left: 20px;
}
// nz-tree-node {
// margin-left: 20px;
// }
nz-tree-node:nth-child(1) {
margin-left: 0px;
}
// nz-tree-node:nth-child(1) {
// margin-left: 0px;
// }
}
.ant-table table {
@ -665,9 +665,11 @@
}
}
#userBox {
.ant-modal-close-x {
color: #000;
}
.ant-modal-close-x {
color: #fff;
}
.maxHeightTreeSelect {

Loading…
Cancel
Save