Browse Source

[新增]完成管理级今日预警接口;新增分析主机管理

dev
邵佳豪 3 years ago
parent
commit
08ecb6c60f
  1. 5
      package-lock.json
  2. 1
      package.json
  3. 2
      src/app/app.component.html
  4. 11
      src/app/http-interceptors/base-interceptor.ts
  5. 20
      src/app/pages/criminal-records-admin/criminal-records-admin.component.html
  6. 24
      src/app/pages/criminal-records/criminal-records.component.html
  7. 97
      src/app/pages/criminal-records/criminal-records.component.ts
  8. 6
      src/app/pages/equipment-info/equipment-info.component.ts
  9. 10
      src/app/pages/home/home.component.html
  10. 32
      src/app/pages/home/home.component.ts
  11. 23
      src/app/pages/login/login.component.ts
  12. 4
      src/app/pages/oil-station-info/oil-station-info.component.ts
  13. 4
      src/app/pages/pages-routing.module.ts
  14. 3
      src/app/pages/pages.module.ts
  15. 14
      src/app/pages/plan-admin/plan-admin.component.html
  16. 5
      src/app/pages/plan-admin/plan-admin.component.scss
  17. 25
      src/app/pages/plan-admin/plan-admin.component.ts
  18. 120
      src/app/pages/today-warning-admin/today-warning-admin.component.html
  19. 7
      src/app/pages/today-warning-admin/today-warning-admin.component.scss
  20. 150
      src/app/pages/today-warning-admin/today-warning-admin.component.ts
  21. 0
      src/app/pages/today-warning-admin/warning-details/warning-details.component.html
  22. 0
      src/app/pages/today-warning-admin/warning-details/warning-details.component.scss
  23. 25
      src/app/pages/today-warning-admin/warning-details/warning-details.component.spec.ts
  24. 15
      src/app/pages/today-warning-admin/warning-details/warning-details.component.ts
  25. 119
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html
  26. 165
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
  27. 9
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts
  28. 17
      src/app/pages/today-warning/today-warning.component.html
  29. 32
      src/app/pages/today-warning/today-warning.component.ts
  30. 22
      src/app/service/navChange.service.ts
  31. 18
      src/app/system-management/analysis-of-the-host/addcamera/addcamera.component.html
  32. 0
      src/app/system-management/analysis-of-the-host/addcamera/addcamera.component.scss
  33. 22
      src/app/system-management/analysis-of-the-host/addcamera/addcamera.component.ts
  34. 43
      src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html
  35. 1
      src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.scss
  36. 143
      src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts
  37. 1
      src/app/system-management/analysis-of-the-host/editcamera/editcamera.component.html
  38. 0
      src/app/system-management/analysis-of-the-host/editcamera/editcamera.component.scss
  39. 15
      src/app/system-management/analysis-of-the-host/editcamera/editcamera.component.ts
  40. 12
      src/app/system-management/analysis-of-the-host/edithost/edithost.component.html
  41. 14
      src/app/system-management/analysis-of-the-host/edithost/edithost.component.ts
  42. 2
      src/app/system-management/navigation/navigation.component.html
  43. 2
      src/app/system-management/navigation/navigation.component.ts
  44. 4
      src/app/system-management/organization/addor/addor.component.html
  45. 2
      src/app/system-management/organization/addor/addor.component.ts
  46. 4
      src/app/system-management/organization/editor/editor.component.html
  47. 2
      src/app/system-management/organization/editor/editor.component.ts
  48. 11
      src/app/system-management/organization/organization.component.ts
  49. 6
      src/app/system-management/system-management.module.ts
  50. 2
      src/app/system-management/user/adduser/adduser.component.ts
  51. 2
      src/app/system-management/user/edituser/edituser.component.html
  52. 8
      src/app/system-management/user/user.component.ts
  53. 2
      src/app/ui/tabbar/tabbar.component.html
  54. 5
      src/app/ui/tabbar/tabbar.component.ts
  55. BIN
      src/assets/images/left.png
  56. BIN
      src/assets/images/left2.png
  57. BIN
      src/assets/images/right.png
  58. BIN
      src/assets/images/right2.png
  59. BIN
      src/assets/images/warning1.png
  60. BIN
      src/assets/images/warning2.png
  61. BIN
      src/assets/images/warning3.png
  62. BIN
      src/assets/images/warning4.png

5
package-lock.json generated

@ -10828,6 +10828,11 @@
"resolved": "https://registry.npm.taobao.org/lineclip/download/lineclip-1.1.5.tgz",
"integrity": "sha1-K/JgZ9lDVP6r+R5CdoI221YW/RM="
},
"linqjs": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/linqjs/download/linqjs-1.0.2.tgz",
"integrity": "sha1-u6n9aUvvP7DmTLfAvNlfzbxHD+w="
},
"loader-runner": {
"version": "2.4.0",
"resolved": "https://registry.npm.taobao.org/loader-runner/download/loader-runner-2.4.0.tgz?cache=0&sync_timestamp=1574712695617&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Floader-runner%2Fdownload%2Floader-runner-2.4.0.tgz",

1
package.json

@ -40,6 +40,7 @@
"echarts": "^4.9.0",
"firebase": "^7.6.2",
"install": "^0.13.0",
"linqjs": "^1.0.2",
"moment": "^2.29.1",
"ng-zorro-antd": "^9.3.0",
"ngx-cookie-service": "^3.0.2",

2
src/app/app.component.html

@ -8,7 +8,7 @@
<img src="../assets/images/AnXinQQ.jpg" alt="">
</div>
<div class="text">
<span>您有一条新的违规事件!</span>
<span>您有一条新的预警提醒!</span>
<span>这是详细描述这是详细描述这是详细描述...</span>
</div>
</div>

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

@ -18,7 +18,16 @@ export class BaseInterceptor implements HttpInterceptor {
constructor(private router: Router, public token: CacheTokenService, private cookieService: CookieService, private message: NzMessageService) { }
intercept(req, next: HttpHandler) {
let params = req.params;
for (const key of req.params.keys()) {
if (params.get(key) === undefined || params.get(key) === null) {
params = params.delete(key, undefined);
}
}
req = req.clone({ params });
// debugger
// console.log('xxxxxx',req)
let newReq = req.clone({
url: req.hadBaseurl ? `${req.url}` : `${req.url}`,
});

20
src/app/pages/criminal-records-admin/criminal-records-admin.component.html

@ -54,17 +54,17 @@
</div>
<div class="content">
<div class="title">
<app-title [name]="'违规类型统计'"></app-title>
<app-title [name]="'预警类型统计'"></app-title>
</div>
<div class="chartsbox">
<div class="chart">
<div class="leftbox">
<span class="chartname">
<img src="../../../assets/images/flower.png" alt="">
违规事件统计
预警事件统计
</span>
<div class="centerContent">
<div class="numname">违规事件总数</div>
<div class="numname">预警事件总数</div>
<div class="num">206</div>
</div>
<div class="piechart" id="piechart">
@ -74,14 +74,14 @@
<div class="rightbox">
<span class="chartname">
<img src="../../../assets/images/flower.png" alt="">
违规趋势
预警趋势
</span>
<div class="btnbox">
<button class="rankingBtn" *ngIf="selectedType == '排名'" nz-button (click)="echartClick2('站点排名')"
[ngClass]="{'selectedbtn': selectedRankingType == '站点排名'}">站点排名</button>
[ngClass]="{'selectedbtn': selectedRankingType == '站点排名'}"></button>
<button class="rankingBtn" *ngIf="selectedType == '排名'" nz-button (click)="echartClick2('事件排名')"
[ngClass]="{'selectedbtn': selectedRankingType == '事件排名'}">事件排名</button>
<button nz-button (click)="echartClick('分布')" [ngClass]="{'selectedbtn': selectedType == '分布'}">分布</button>
[ngClass]="{'selectedbtn': selectedRankingType == '事件排名'}">事件</button>
<button nz-button (click)="echartClick('分布')" [ngClass]="{'selectedbtn': selectedType == '分布'}">统计</button>
<button nz-button (click)="echartClick('排名')" [ngClass]="{'selectedbtn': selectedType == '排名'}">排名</button>
</div>
<div class="barchart" id="barchart">
@ -92,7 +92,7 @@
</div>
<div class="title">
<app-title [name]="'违规类型统计'"></app-title>
<app-title [name]="'预警类型统计'"></app-title>
</div>
<div class="tablebox">
<div class="table">
@ -119,7 +119,7 @@
摄像头
</div>
<div nz-col nzSpan="3">
违规时间
预警时间
</div>
<div nz-col nzSpan="1">
操作
@ -131,7 +131,7 @@
Ⅰ级
</div>
<div nz-col nzSpan="4">
日常违规行为
日常预警行为
</div>
<div nz-col nzSpan="4">
中化某某省公司

24
src/app/pages/criminal-records/criminal-records.component.html

@ -54,17 +54,17 @@
</div>
<div class="content">
<div class="title">
<app-title [name]="'违规类型统计'"></app-title>
<app-title [name]="'预警类型统计'"></app-title>
</div>
<div class="chartsbox">
<div class="chart">
<div class="leftbox">
<span class="chartname">
<img src="../../../assets/images/flower.png" alt="">
违规事件统计
预警事件统计
</span>
<div class="centerContent">
<div class="numname">违规事件总数</div>
<div class="numname">预警事件总数</div>
<div class="num">206</div>
</div>
<div class="piechart" id="piechart">
@ -74,8 +74,16 @@
<div class="rightbox">
<span class="chartname">
<img src="../../../assets/images/flower.png" alt="">
违规趋势
预警趋势
</span>
<div class="btnbox">
<!-- <button class="rankingBtn" *ngIf="selectedType == '排名'" nz-button (click)="echartClick2('站点排名')"
[ngClass]="{'selectedbtn': selectedRankingType == '站点排名'}">油站</button>
<button class="rankingBtn" *ngIf="selectedType == '排名'" nz-button (click)="echartClick2('事件排名')"
[ngClass]="{'selectedbtn': selectedRankingType == '事件排名'}">事件</button> -->
<button nz-button (click)="echartClick('分布')" [ngClass]="{'selectedbtn': selectedType == '分布'}">统计</button>
<button nz-button (click)="echartClick('排名')" [ngClass]="{'selectedbtn': selectedType == '排名'}">排名</button>
</div>
<div class="barchart" id="barchart">
</div>
@ -84,7 +92,7 @@
</div>
<div class="title">
<app-title [name]="'违规类型统计'"></app-title>
<app-title [name]="'预警类型统计'"></app-title>
</div>
<div class="tablebox">
<div class="table">
@ -96,13 +104,13 @@
预警类型
</div>
<div nz-col nzSpan="5">
违规信息
预警信息
</div>
<div nz-col nzSpan="4">
摄像头
</div>
<div nz-col nzSpan="4">
违规时间
预警时间
</div>
<div nz-col nzSpan="2">
操作
@ -114,7 +122,7 @@
Ⅰ级
</div>
<div nz-col nzSpan="5">
日常违规行为
日常预警行为
</div>
<div nz-col nzSpan="5">
工作人员倚靠加油机或立柱

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

@ -89,6 +89,86 @@ export class CriminalRecordsComponent implements OnInit {
top: '45px'
}
};
baroption2 = {
xAxis: {
type: 'value',
show: false
},
yAxis: {
type: 'category',
data: ['预警事件名', '预警事件名', '预警事件名', '预警事件名', '预警事件名', '预警事件名', '预警事件名', '预警事件名', '预警事件名', '预警事件名'],
axisLine: {
show: false,
lineStyle: {
color: '#91CCFF',
}
},
axisTick: {//刻度线
show: false
},
axisLabel: {
formatter: function (value, index) {
// 格式化成月/日,只在第一个刻度显示年份
return '{s|·}' + `{a|${value}}`;
},
rich: {
a: {
color: '#C4E2FC',
padding: [0, 0, 0, 8],
},
s: {
color: '#fff',
borderWidth: 1,
borderColor: '#23D9FF',
backgroundColor: '#fff',
width: 4,
height: 4,
shadowBlur: 3,
shadowColor: "#fff"
}
}
}
},
series:
{
label: {
// 柱图头部显示值
show: true,
position: "right",
color: "#fff",
fontSize: 12,
formatter: '{c}',
offset: [6, 0]
},
data: [40, 36, 30, 25, 19, 15, 14, 11, 10, 8].reverse(),
type: 'bar',
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 1,
y2: 0,
colorStops: [{
offset: 0, color: '#063d72' // 0% 处的颜色
}, {
offset: 1, color: '#FF9963' // 100% 处的颜色
}],
global: false // 缺省为 false
}
},
barWidth: '36%',
}
,
grid: {
left: '100px',
right: '60px',
bottom: '3px',
top: '20px'
}
}
getThirtyDays() {
//获取当前日期
let myDate = new Date();
@ -219,4 +299,21 @@ export class CriminalRecordsComponent implements OnInit {
list: any = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
selectedType = '分布'
selectedRankingType = '站点排名'
echartClick(type) {
this.selectedType = type
this.mybarChart.dispose()
this.mybarChart = echarts.init(document.getElementById('barchart'));
if (type == '排名') {
this.mybarChart.setOption(this.baroption2);
} else {
this.mybarChart.setOption(this.baroption);
}
}
// echartClick2(type) {
// this.selectedRankingType = type
// }
}

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

@ -29,7 +29,7 @@ export class EquipmentInfoComponent implements OnInit {
this.http.get('/api/services/app/FireEquipment/GetAll', {
params: {
Name:this.validateForm.value.search ? this.validateForm.value.search : '',
OrganizationId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
organizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
SkipCount: String(this.SkipCount),
MaxResultCount: String(this.MaxResultCount)
}
@ -75,7 +75,7 @@ export class EquipmentInfoComponent implements OnInit {
productionDate: instance.validateForm.value.prodtime,
purchaseDate: instance.validateForm.value.buytime,
validityEndTime: instance.validateForm.value.validitytime,
organizationId: JSON.parse(sessionStorage.getItem('userdata')).organization.id
organizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id
}
this.http.post('/api/services/app/FireEquipment/Create', body).subscribe(data => {
resolve(data)
@ -121,7 +121,7 @@ export class EquipmentInfoComponent implements OnInit {
productionDate: instance.validateForm.value.prodtime,
purchaseDate: instance.validateForm.value.buytime,
validityEndTime: instance.validateForm.value.validitytime,
organizationId: item.organizationId
organizationUnitId: item.organizationUnitId
}
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe(data => {
resolve(data)

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

@ -4,13 +4,13 @@
</div>
<div class="menu">
<li *ngIf="!isGasStationNav" [routerLink]="['/plan']" routerLinkActive="router-link-active">
站点预案
数字站点
</li>
<li *ngIf="!isGasStationNav" [routerLink]="['/warning']" routerLinkActive="router-link-active">
今日预警
</li>
<li *ngIf="!isGasStationNav" [routerLink]="['/records']" routerLinkActive="router-link-active">
违规记录
预警记录
</li>
<li *ngIf="isGasStationNav" [routerLink]="['/plan/petrolStation']" routerLinkActive="router-link-active">
@ -20,15 +20,15 @@
今日预警
</li>
<li *ngIf="isGasStationNav" [routerLink]="['/records/petrolStation']" routerLinkActive="router-link-active">
违规记录
预警记录
</li>
<div class="backbtn" *ngIf="isGasStation">
<button nz-button (click)="goback()">返回</button>
</div>
<div class="warningnumber" *ngIf="isWarning">
<img src="../../../assets/images/warningnum.png" alt="">
<span class="num">39</span>
<span class="today">今日违规</span>
<span class="num">{{num}}</span>
<span class="today">今日预警</span>
</div>
</div>
<div class="content">

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

@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
import { Title } from '@angular/platform-browser'
import { filter } from 'rxjs/operators';
import { NavChangeService } from 'src/app/service/navChange.service';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
@ -9,15 +10,33 @@ import { filter } from 'rxjs/operators';
})
export class HomeComponent implements OnInit {
constructor(private router: Router) { }
constructor(private router: Router, private navChangeService: NavChangeService) { }
isGasStationNav: boolean
isGasStation: boolean
isWarning: boolean = false//是否是今日预警页面
num
ngOnInit(): void {
if(sessionStorage.getItem('isGasStation') == 'true'){
this.navChangeService.getMessage().subscribe((message: any) => {
console.log(message);//send a message
if(message.name == 'oilstation'){
this.isGasStationNav = true
}
if(message.name == '改变数量'){
this.isWarning = true
this.num = message.num
}
});
if (this.router.url.indexOf('petrolStation') != -1 && sessionStorage.getItem('isGasStation') == 'false') {//控制返回按钮显示
this.isGasStation = true
} else {
this.isGasStation = false
}
if (sessionStorage.getItem('isGasStation') == 'true') {
this.isGasStationNav = true
}else{
} else {
this.isGasStationNav = false
}
@ -31,15 +50,16 @@ export class HomeComponent implements OnInit {
}
if (event.url.indexOf('petrolStation') != -1 && sessionStorage.getItem('isGasStation') == 'false') {//控制返回按钮显示
this.isGasStation = true
}else{
} else {
this.isGasStation = false
}
});
}
goback(){
history.go(-1)
goback() {
this.router.navigate(['/plan'])
this.isGasStationNav = false
}
}

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

@ -43,37 +43,40 @@ export class LoginComponent implements OnInit {
this.message.create('error', `请输入账号密码`);
return
}
// if (!this.selectedRole) {
// 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);
this.cookieService.set("token", data.result.accessToken, null, '/');
this.cookieService.set("refreshToken", data.result.encryptedAccessToken, null, '/');
this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe((data: any) => {
sessionStorage.setItem('userdata', JSON.stringify(data.result.user))
sessionStorage.setItem('userdataOfgasstation', JSON.stringify(data.result.user))
this.isLoading = false;
if (data.result.user.organization.isGasStation) {
sessionStorage.setItem("isGasStation", 'true');
this.router.navigate(['/plan/petrolStation'])
if (data.result.user.userName == 'admin') {
this.router.navigate(['/system/organization'])
} else {
sessionStorage.setItem("isGasStation", 'false');
this.router.navigate(['/plan'])
if (data.result.user.organization.isGasStation) {
sessionStorage.setItem("isGasStation", 'true');
this.router.navigate(['/plan/petrolStation'])
} else {
sessionStorage.setItem("isGasStation", 'false');
this.router.navigate(['/plan'])
}
}
this.message.create('success', `登陆成功`);
}, err => {
this.isLoading = false;
})
//调用服务中的function刷新token
// this.token.startUp()
},
(err) => {
this.isLoading = false;
this.message.create('error', err.error.error.details);
}
)

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

@ -62,7 +62,7 @@ export class OilStationInfoComponent implements OnInit {
getInfo() {
this.http.get('/api/services/app/GasStation/Get', {
params: {
organizationId: this.userdata.organization.id
organizationUnitId: this.userdata.organization.id
}
}).subscribe((data: any) => {
console.log('油站信息', data)
@ -112,7 +112,7 @@ export class OilStationInfoComponent implements OnInit {
httpBody = {
id: null,
stationName: JSON.parse(sessionStorage.getItem('userdata')).organization.displayName,
organizationId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
organizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
validityStartTime: '',
validityEndTime: '',
openTime: '',

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

@ -11,8 +11,8 @@ import { EquipmentInfoComponent } from './equipment-info/equipment-info.componen
import { PlanAdminComponent } from './plan-admin/plan-admin.component';
const routes: Routes = [
{ path: 'plan', component: PlanAdminComponent , data: { permission: 'xxxx' },canActivate: [AuthGuard]},
{ path: 'plan/petrolStation', component: PlanComponent , data: { permission: 'xxxx' },canActivate: [AuthGuard]},
{ path: 'plan', component: PlanAdminComponent },
{ path: 'plan/petrolStation', component: PlanComponent },
{ path: 'warning', component: TodayWarningAdminComponent },
{ path: 'warning/petrolStation', component: TodayWarningComponent },
{ path: 'records', component: CriminalRecordsAdminComponent },

3
src/app/pages/pages.module.ts

@ -41,13 +41,14 @@ import { EditequipmentComponent } from './equipment-info/editequipment/editequip
import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select';
import { PlanAdminComponent } from './plan-admin/plan-admin.component';
import { GetOutOfLineDetailsComponent } from './today-warning/get-out-of-line-details/get-out-of-line-details.component';
import { WarningDetailsComponent } from './today-warning-admin/warning-details/warning-details.component';
@NgModule({
declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent,
TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent,
AddequipmentComponent, EditequipmentComponent,PlanAdminComponent, GetOutOfLineDetailsComponent],
AddequipmentComponent, EditequipmentComponent,PlanAdminComponent, GetOutOfLineDetailsComponent, WarningDetailsComponent],
imports: [

14
src/app/pages/plan-admin/plan-admin.component.html

@ -37,7 +37,7 @@
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<!-- <nz-form-item class="searchParams">
<nz-form-control>
<nz-input-group>
<input required nz-input type="text" formControlName="linkman" placeholder="请输入联系人" />
@ -51,7 +51,7 @@
<input required nz-input type="text" formControlName="phone" placeholder="请输入电话" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</nz-form-item> -->
<nz-form-item class="btn">
<nz-form-control>
@ -70,13 +70,13 @@
<div class="tablebox">
<div class="table">
<div nz-row class="th">
<div nz-col nzSpan="2" style="text-align: right;box-sizing: border-box;padding-right: 20px;">
<div nz-col nzSpan="1" style="text-align: right;box-sizing: border-box;padding-right: 20px;">
</div>
<div nz-col nzSpan="6">
加油站名称
</div>
<div nz-col nzSpan="3">
<div nz-col nzSpan="4">
区域
</div>
<div nz-col nzSpan="4">
@ -94,13 +94,13 @@
</div>
<div class="tbody">
<div nz-row class="tr" *ngFor="let item of list">
<div nz-col nzSpan="2" style="text-align: right;box-sizing: border-box;padding-right: 20px;">
<span class="ziying">自营</span>
<div nz-col nzSpan="1" style="text-align: right;box-sizing: border-box;padding-right: 20px;">
<!-- <span class="ziying">自营</span> -->
</div>
<div nz-col nzSpan="6">
中化山东省淄博市第6加油站
</div>
<div nz-col nzSpan="3">
<div nz-col nzSpan="4">
山东-淄博
</div>
<div nz-col nzSpan="4">

5
src/app/pages/plan-admin/plan-admin.component.scss

@ -53,7 +53,7 @@
width: 100%;
height: 32px;
display: flex;
justify-content: space-around;
justify-content: flex-end;
input {
background: none;
@ -62,11 +62,12 @@
}
.searchParams {
width: 28%;
width: 22%;
}
.btn {
width: 5%;
margin-left: 16px;
}
}

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

@ -5,6 +5,7 @@ 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';
@Component({
selector: 'app-plan-admin',
templateUrl: './plan-admin.component.html',
@ -13,7 +14,7 @@ import { Router } from '@angular/router';
export class PlanAdminComponent implements OnInit {
validateForm!: FormGroup;
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
constructor(private http: HttpClient, private toTree: TreeService, private fb: FormBuilder, private nzContextMenuService: NzContextMenuService, private router: Router) { }
constructor(private navChangeService: NavChangeService, private http: HttpClient, private toTree: TreeService, private fb: FormBuilder, private nzContextMenuService: NzContextMenuService, private router: Router) { }
list: any = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
ngOnInit(): void {
this.validateForm = this.fb.group({
@ -41,11 +42,22 @@ export class PlanAdminComponent implements OnInit {
nodes: any = []
nzExpandAll = false
getAllOrganization() {
this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => {
data.result.items.forEach(element => {
this.http.get('/api/services/app/Organization/GetAll', {
params: {
SkipCount: '0',
MaxResultCount: '9999'
}
}).subscribe((data: any) => {
data.result.items = data.result.items.filter((item, i) => {
return !item.isGasStation
})
for (let index = 0; index < data.result.items.length; index++) {
const element = data.result.items[index];
element.key = element.id
element.title = element.displayName
});
}
this.nodes = [...this.toTree.toTree(data.result.items)]
this.nzExpandAll = true
})
@ -53,6 +65,11 @@ export class PlanAdminComponent implements OnInit {
look() {
this.router.navigate(['/plan/petrolStation'])
let obj = {
name: 'oilstation'
}
this.navChangeService.sendMessage(obj);//发布一条消息
}
nzExpandedKeys: any = []
activatedNode?: NzTreeNode;

120
src/app/pages/today-warning-admin/today-warning-admin.component.html

@ -1,6 +1,6 @@
<div class="warningbox" id="warningboxadmin">
<div class="title">
<app-title [name]="'当日违规事件列表'"></app-title>
<app-title [name]="'当日预警事件列表'"></app-title>
</div>
<div class="search">
<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
@ -17,43 +17,45 @@
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select id="type" formControlName="type" nzPlaceHolder="请选择预警类型">
<nz-option *ngFor="let item of yujingTypes" [nzValue]="item.id" [nzLabel]="item.violationName"></nz-option>
<nz-select formControlName="type" (ngModelChange)="typeChange($event)" nzPlaceHolder="请选择预警类型">
<nz-option *ngFor="let item of warningTypes" [nzValue]="item.key" [nzLabel]="item.key"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-control>
<!-- <nz-select id="company" formControlName="company" nzPlaceHolder="请选择所属机构">
</nz-select> -->
<nz-tree-select id="company" formControlName="company" [nzNodes]="nodes" nzPlaceHolder="请选择所属机构">
</nz-tree-select>
<nz-select formControlName="event" nzPlaceHolder="请选择预警事件">
<nz-option *ngFor="let item of warningTypesDetails" [nzValue]="item.id" [nzLabel]="item.violationName">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<!-- <nz-form-item class="searchParams">
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select id="area" formControlName="area" nzPlaceHolder="请选择区域">
<nz-option nzValue="1" nzLabel="一级"></nz-option>
<nz-option nzValue="2" nzLabel="二级"></nz-option>
<nz-option nzValue="3" nzLabel="三级"></nz-option>
</nz-select>
<nz-tree-select [(ngModel)]="defaultOrId" formControlName="organization" [nzNodes]="nodes"
nzPlaceHolder="请选择所属机构">
</nz-tree-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select id="site" formControlName="site" nzPlaceHolder="请选择站点">
<nz-option nzValue="1" nzLabel="一级"></nz-option>
<nz-option nzValue="2" nzLabel="二级"></nz-option>
<nz-option nzValue="3" nzLabel="三级"></nz-option>
<nz-select id="area" formControlName="area" nzPlaceHolder="请选择区域">
<nz-option nzValue="出入口" nzLabel="出入口"></nz-option>
<nz-option nzValue="加油区" nzLabel="加油区"></nz-option>
<nz-option nzValue="油罐区" nzLabel="油罐区"></nz-option>
<nz-option nzValue="便利店" nzLabel="便利店"></nz-option>
<nz-option nzValue="办公区" nzLabel="办公区"></nz-option>
<nz-option nzValue="其他区域" nzLabel="其他区域"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item> -->
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-control [nzSm]="16" [nzXs]="24">
<nz-date-picker id="datePicker" formControlName="datePicker" nzPlaceHolder="请选择时间"></nz-date-picker>
<nz-form-control>
<nz-range-picker formControlName="datePicker"></nz-range-picker>
</nz-form-control>
</nz-form-item>
@ -71,84 +73,70 @@
</nz-form-item>
</form>
</div>
<!-- <div class="warningnumber">
<span class="num">39</span>
<span class="today">今日违规</span>
</div> -->
<div class="listbox">
<div nz-row class="listitem listitemhead">
<div nz-col nzSpan="2" style="box-sizing: border-box;padding-left: 10px;">
<div nz-col nzSpan="3" style="box-sizing: border-box;padding-left: 10px;">
预警级别
</div>
<div nz-col nzSpan="2">
预警类型
</div>
<div nz-col nzSpan="4">
违规信息
</div>
<div nz-col nzSpan="3">
所属公司
预警类型
</div>
<div nz-col nzSpan="2">
区域
<div nz-col nzSpan="6">
预警事件
</div>
<div nz-col nzSpan="3">
站点
油站名称
</div>
<div nz-col nzSpan="3">
摄像头
区域
</div>
<div nz-col nzSpan="3">
违规时间
<div nz-col nzSpan="4">
预警时间
</div>
<div nz-col nzSpan="2">
操作
</div>
</div>
<div nz-row class="listitem" *ngFor="let item of list">
<div nz-col nzSpan="2">
<span *ngIf="item.level === 1" style="color: #FF4B65;">
<img src="../../../assets/images/level1.png">
<div nz-col nzSpan="3">
<span *ngIf="item.violation.violationType == '卸油作业检查'">
<img src="../../../assets/images/warning2.png">
Ⅰ级
</span>
<span *ngIf="item.level === 2" style="color: #FFBD4B;">
<img src="../../../assets/images/level2.png">
<span
*ngIf="item.violation.violationType != '卸油作业检查' && item.violation.violationType != '证件临期' && item.violation.violationType != '器材临期' ">
<img src=" ../../../assets/images/warning1.png">
Ⅱ级
</span>
<span *ngIf="item.level === 3" style="color: #23D9FF;">
<img src="../../../assets/images/level3.png">
<span *ngIf="item.violation.violationType === '证件临期'">
<img src="../../../assets/images/warning3.png">
Ⅲ级
</span>
</div>
<div nz-col nzSpan="2">
加油站违规
</div>
<div nz-col nzSpan="4">
工作人员倚靠加油机或立柱
<span *ngIf="item.violation.violationType === '器材临期'">
<img src="../../../assets/images/warning3.png">
Ⅳ级
</span>
</div>
<div nz-col nzSpan="3">
中化北京分公司
{{item.violation.violationType}}
</div>
<div nz-col nzSpan="2">
北京-朝阳
<div nz-col nzSpan="6">
{{item.violation.violationName}}
</div>
<div nz-col nzSpan="3">
北京市第十九加油站
<span class="propsm propsm1" *ngIf="item.prop == 1">自营</span>
<span class="propsm propsm2" *ngIf="item.prop == 2">加盟</span>
{{item.gasStation.stationName}}
</div>
<div nz-col nzSpan="3">
加油区2号摄像头
{{item.violateArea}}
</div>
<div nz-col nzSpan="3">
2021-10-12 09:28:13
<div nz-col nzSpan="4">
{{item.violateTime | date:"yyyy-MM-dd HH:mm:ss"}}
</div>
<div nz-col nzSpan="2">
<button nz-button (click)="look()">查看</button>
<button nz-button (click)="look(item)">查看</button>
<!-- <img style="margin-left: 24px;cursor: pointer;" src="../../../assets/images/excel.png" alt=""> -->
</div>
</div>
</div>
</div>
</div>

7
src/app/pages/today-warning-admin/today-warning-admin.component.scss

@ -27,7 +27,7 @@
justify-content: space-around;
.searchParams {
width: 22%;
width: 14.6%;
}
.btn {
@ -46,7 +46,10 @@
background-color: rgba(0, 0, 0, 0);
width: 145%;
}
nz-range-picker {
background-color: rgba(0, 0, 0, 0);
width: 100%;
}
}
}

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

@ -1,8 +1,17 @@
import { Component, OnInit } from '@angular/core';
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 { TreeService } from 'src/app/service/tree.service';
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 { NavChangeService } from 'src/app/service/navChange.service';
import 'linqjs';
@Component({
selector: 'app-today-warning-admin',
templateUrl: './today-warning-admin.component.html',
@ -11,49 +20,110 @@ import { TreeService } from 'src/app/service/tree.service';
export class TodayWarningAdminComponent implements OnInit {
validateForm!: FormGroup;
constructor(private http: HttpClient,private fb: FormBuilder, private router: Router, private toTree: TreeService) { }
constructor(private http: HttpClient, private fb: FormBuilder, private router: Router, private toTree: TreeService, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private navChangeService: NavChangeService) { }
ngOnInit(): void {
this.validateForm = this.fb.group({
level: [null],
type: [null],
company: [null],
event: [null],
organization: [null],
area: [null],
site: [null],
datePicker: [null]
});
this.yujingType()
this.warningType()
this.getAllOrganization()
}
//预警类型接口
yujingTypes:any //预警接口数据
yujingType(){
warningTypes: any //预警接口数据
warningTypesDetails:any
warningType() {
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => {
this.yujingTypes=data.result
this.warningTypesDetails = data.result
this.warningTypes = (data.result as any).groupBy((t) => { return t.violationType });
})
}
typeChange(e){
this.warningTypes.forEach(element => {
if(element.key == e){
this.warningTypesDetails = element
}
)
});
this.validateForm.patchValue({
event: null,
});
}
defaultOrId: string
//获取所有组织机构
nodes:any = []
nodes: any = []
getAllOrganization() {
this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => {
data.result.items.forEach(element => {
element.key = element.code
element.key = element.id
element.title = element.displayName
});
this.nodes = [...this.toTree.toTree(data.result.items)]
console.log(this.nodes)
this.defaultOrId = JSON.parse(sessionStorage.getItem('userdata')).organization.id
this.validateForm.value.organization = this.defaultOrId
this.getEarlyWarningList()
})
}
//获得预警列表
list: any = [
]
totalCount: string //预警总数
getEarlyWarningList() {
let ViolationIds = []
if(this.validateForm.value.event){
ViolationIds.push(this.validateForm.value.event)
}
if(this.validateForm.value.type && !this.validateForm.value.event){
this.warningTypesDetails.forEach(item => {
item.id ? ViolationIds.push(item.id) : null
});
}
let params = {
Level: this.validateForm.value.level,
ViolationIds: ViolationIds,
ViolateArea: this.validateForm.value.area,
organizationUnitId: this.validateForm.value.organization,
ViolateTime: this.validateForm.value.datePicker ? [moment(this.validateForm.value.datePicker[0]).format('YYYY-MM-DD'), moment(this.validateForm.value.datePicker[1]).format('YYYY-MM-DD')] : null,
SkipCount: '0',
MaxResultCount: '9999'
}
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)
let obj = {
name: '改变数量',
num: this.totalCount
}
setTimeout(() => {
console.log('走这里了')
this.navChangeService.sendMessage(obj);//发布一条消息
}, 0);
})
}
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
console.log(this.validateForm)
this.getEarlyWarningList()
}
resetForm(e: MouseEvent): void {
e.preventDefault();
this.validateForm.reset();
@ -61,37 +131,33 @@ export class TodayWarningAdminComponent implements OnInit {
this.validateForm.controls[key].markAsPristine();
this.validateForm.controls[key].updateValueAndValidity();
}
this.defaultOrId = JSON.parse(sessionStorage.getItem('userdata')).organization.id
this.validateForm.value.organization = this.defaultOrId
this.getEarlyWarningList()
}
list: any = [
{ level: 1, name: '北京市第十九加油站', prop: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 2, name: '北京市第十九加油站', prop: 2, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 3, name: '北京市第十九加油站', prop: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, name: '北京市第十九加油站', prop: 2, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, name: '北京市第十九加油站', prop: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, name: '北京市第十九加油站', prop: 2, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, name: '北京市第十九加油站', prop: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, name: '北京市第十九加油站', prop: 2, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, name: '北京市第十九加油站', prop: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, name: '北京市第十九加油站', prop: 2, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, name: '北京市第十九加油站', prop: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, name: '北京市第十九加油站', prop: 2, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', company: '中化北京分公司', area: '北京-朝阳', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' }
]
isVisible = false;
showModal(): void {
this.isVisible = true;
}
handleOk(): void {
console.log('Button ok clicked!');
this.isVisible = false;
}
handleCancel(): void {
console.log('Button cancel clicked!');
this.isVisible = false;
}
look() {
this.router.navigate(['warning/petrolStation'])
look(item) {
const modal = this.modal.create({
nzContent: GetOutOfLineDetailsComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1200,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',
'padding': '0px',
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
},
nzComponentParams: {
data: item
},
nzFooter: null,
nzOnOk: async () => {
}
});
const instance = modal.getContentComponent();
}
}

0
src/app/pages/today-warning-admin/warning-details/warning-details.component.html

0
src/app/pages/today-warning-admin/warning-details/warning-details.component.scss

25
src/app/pages/today-warning-admin/warning-details/warning-details.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WarningDetailsComponent } from './warning-details.component';
describe('WarningDetailsComponent', () => {
let component: WarningDetailsComponent;
let fixture: ComponentFixture<WarningDetailsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WarningDetailsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(WarningDetailsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
src/app/pages/today-warning-admin/warning-details/warning-details.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-warning-details',
templateUrl: './warning-details.component.html',
styleUrls: ['./warning-details.component.scss']
})
export class WarningDetailsComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

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

@ -3,21 +3,128 @@
<div class="titlebox">
<div class="title">
<div (click)="contentType('img')" [ngClass]="{'selected': selectedType == 'img'}">
违规截图
预警截图
<div class="border"></div>
</div>
<div (click)="contentType('video')" [ngClass]="{'selected': selectedType == 'video'}">
违规视频
预警视频
<div class="border"></div>
</div>
</div>
<!-- <div class="title" *ngIf="data.type != 0">
<div (click)="contentType('xieyou')" [ngClass]="{'selected': selectedType == 'img'}">
卸油预警
<div class="border"></div>
</div>
</div> -->
</div>
<div class="content">
<div *ngIf="selectedType == 'img'">
违规截图
<div *ngIf="selectedType == 'img'" class="imgbox">
<!-- <div class="imglist">
<span class="imglisttitle">截图列表</span>
<div class="img">
<img src="../../../../assets/images/bgImg.jpg" alt="">
</div>
</div> -->
<div class="bigimg">
<img [src]="imgUrl" alt="">
</div>
</div>
<div *ngIf="selectedType == 'video'">
违规视频
<div style="width: 100%;height: 100%;" *ngIf="selectedType == 'video'" class="vediobox">
<video controls style="width: 100%;height: 100%;" [src]="vedioUrl"></video>
</div>
<!-- <div *ngIf="data.type != 0" class="oilbox">
<div class="imgDetailsbox">
<h1>执行错误</h1>
<div class="bigimage">
<img src="../../../../assets/images/bgImg.jpg" alt="">
</div>
<h3>步骤02</h3>
</div>
<div class="flowpathbox">
<div class="name">
卸油流程
</div>
<div class="flowpathlist">
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤1</span>
</div>
<div class="arrowsbox">
<img src="../../../../assets/images/right.png" alt="">
</div>
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤2</span>
</div>
<div class="arrowsbox">
<img src="../../../../assets/images/right.png" alt="">
</div>
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤3</span>
</div>
<div class="arrowsbox">
<img src="../../../../assets/images/right.png" alt="">
</div>
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤4</span>
</div>
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤8</span>
</div>
<div class="arrowsbox">
<img src="../../../../assets/images/left.png" alt="">
</div>
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤7</span>
</div>
<div class="arrowsbox">
<img src="../../../../assets/images/left.png" alt="">
</div>
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤6</span>
</div>
<div class="arrowsbox">
<img src="../../../../assets/images/left.png" alt="">
</div>
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤5</span>
</div>
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤9</span>
</div>
<div class="arrowsbox">
<img src="../../../../assets/images/right.png" alt="">
</div>
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤10</span>
</div>
<div class="arrowsbox">
<img src="../../../../assets/images/right.png" alt="">
</div>
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤11</span>
</div>
<div class="arrowsbox">
<img src="../../../../assets/images/right.png" alt="">
</div>
<div class="flowpathimgbox">
<img src="../../../../assets/images/bgImg.jpg" alt="">
<span>步骤12</span>
</div>
</div>
<img class="leftimg" src="../../../../assets/images/left2.png" alt="">
<img class="rightimg" src="../../../../assets/images/right2.png" alt="">
</div>
</div> -->
</div>
</div>

165
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss

@ -28,8 +28,9 @@
font-family: sybold;
font-size: 16px;
position: relative;
cursor: pointer;
margin: 0 18px;
cursor: pointer;
margin: 0 18px;
.border {
position: absolute;
bottom: -7px;
@ -58,4 +59,164 @@
flex: 1;
box-sizing: border-box;
padding: 18px;
overflow: hidden;
.imgbox {
display: flex;
width: 100%;
height: 100%;
.imglist {
display: flex;
flex-direction: column;
width: 196px;
height: 100%;
overflow-y: auto;
box-sizing: border-box;
padding-right: 12px;
border-right: 1px solid rgba(145, 204, 255, 0.3);
.imglisttitle {
font-size: 16px;
font-family: sybold;
margin-bottom: 16px;
}
.img {
width: 178px;
height: 108px;
margin-bottom: 8px;
img {
width: 100%;
height: 100%;
cursor: pointer;
}
}
}
.bigimg {
flex: 1;
box-sizing: border-box;
padding-left: 13px;
img {
width: 100%;
height: 100%;
}
}
}
.oilbox {
display: flex;
width: 100%;
height: 100%;
.imgDetailsbox {
width: 280px;
height: 100%;
box-sizing: border-box;
padding-right: 12px;
border-right: 1px solid rgba(145, 204, 255, 0.3);
display: flex;
flex-direction: column;
// justify-content: center;
align-items: center;
.bigimage {
width: 264px;
height: 264px;
border: 1px solid #FF4B65;
box-shadow: 0px 0px 12px #FF4B65;
opacity: 1;
border-radius: 0px;
// margin-top: 40px;
margin-bottom: 24px;
img {
width: 100%;
height: 100%;
}
}
h1 {
font-weight: bold;
font-size: 24px;
color: #FF4B65;
margin-bottom: 32px;
margin-top: 36%;
}
h3 {
font-size: 18px;
font-weight: 400;
color: #FFFFFF;
}
}
.flowpathbox {
flex: 1;
box-sizing: border-box;
padding-left: 73px;
position: relative;
// border: 1px solid red;
.name {
color: rgba(145, 204, 255, 1);
font-size: 15px;
margin-bottom: 12px;
}
.flowpathlist {
display: flex;
flex-wrap: wrap;
.flowpathimgbox {
width: 160px;
height: 200px;
display: flex;
flex-direction: column;
img {
width: 158px;
height: 158px;
border: 1px solid rgba(0,0,0,0);
cursor: pointer;
}
span {
text-align: center;
margin-top: 6px;
}
}
.arrowsbox {
width: 40px;
height: 200px;
display: flex;
justify-content: center;
img {
width: 38px;
height: 38px;
margin-top: 65px;
}
}
}
.leftimg {
display: block;
position: absolute;
left: 20px;
bottom: 76px
}
.rightimg {
display: block;
position: absolute;
right: -3px;
top: 99px;
}
}
}
}

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

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit,Input } from '@angular/core';
@Component({
selector: 'app-get-out-of-line-details',
@ -7,9 +7,16 @@ import { Component, OnInit } from '@angular/core';
})
export class GetOutOfLineDetailsComponent implements OnInit {
@Input() data:any
constructor() { }
imgUrl:string
vedioUrl:string
ngOnInit(): void {
this.imgUrl = this.data.violateImage
this.vedioUrl = this.data.violateVideo
}

17
src/app/pages/today-warning/today-warning.component.html

@ -1,6 +1,6 @@
<div class="warningbox" id="warningbox">
<div class="title">
<app-title [name]="'当日违规事件列表'"></app-title>
<app-title [name]="'当日预警事件列表'"></app-title>
</div>
<div class="search">
<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
@ -25,10 +25,13 @@
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select id="site" formControlName="site" nzPlaceHolder="请选择摄像头">
<nz-option nzValue="1" nzLabel="一级"></nz-option>
<nz-option nzValue="2" nzLabel="二级"></nz-option>
<nz-option nzValue="3" nzLabel="三级"></nz-option>
<nz-select id="site" formControlName="site" nzPlaceHolder="请选择区域">
<nz-option nzValue="0" nzLabel="出入口"></nz-option>
<nz-option nzValue="1" nzLabel="加油区"></nz-option>
<nz-option nzValue="2" nzLabel="油罐区"></nz-option>
<nz-option nzValue="3" nzLabel="便利店"></nz-option>
<nz-option nzValue="4" nzLabel="办公区"></nz-option>
<nz-option nzValue="5" nzLabel="其他区域"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
@ -75,13 +78,13 @@
预警类型: {{item.type}}
</div>
<div nz-col nzSpan="5">
违规信息: {{item.content}}
预警信息: {{item.content}}
</div>
<div nz-col nzSpan="5">
摄像头: {{item.site}}
</div>
<div nz-col nzSpan="5">
违规时间: {{item.time}}
预警时间: {{item.time}}
</div>
<div nz-col nzSpan="2">
<button nz-button (click)="showModal()">查看</button>

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

@ -1,9 +1,9 @@
import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
import { NzModalService } from 'ng-zorro-antd/modal';
import { GetOutOfLineDetailsComponent } from './get-out-of-line-details/get-out-of-line-details.component';
import { TreeService } from 'src/app/service/tree.service';
@Component({
selector: 'app-today-warning',
templateUrl: './today-warning.component.html',
@ -52,18 +52,18 @@ export class TodayWarningComponent implements OnInit {
}
list: any = [
{ level: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 2, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 3, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区违规', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' }
{ level: 1, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 2, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 3, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' },
{ level: 1, type: '加油区预警', content: '工作人员倚靠加油机或者立柱', site: '加油区2号摄像头', time: '2021-10-12 09:28:13' }
]
@ -83,7 +83,11 @@ export class TodayWarningComponent implements OnInit {
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
},
nzComponentParams: {},
nzComponentParams: {
data: {
type: 1
}
},
nzFooter: null,
nzOnOk: async () => {

22
src/app/service/navChange.service.ts

@ -0,0 +1,22 @@
import { Injectable } from '@angular/core';
import { Observable, ReplaySubject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class NavChangeService {
constructor() { }
private _sendMessage: ReplaySubject<any> = new ReplaySubject<any>(1);
/** * **
* @param message *
* @returns {Observavle<any>} */
public sendMessage(message: any) {
this._sendMessage.next(message);
}
public getMessage(): Observable <any> {
return this._sendMessage.asObservable();
}
}

18
src/app/system-management/analysis-of-the-host/addcamera/addcamera.component.html

@ -0,0 +1,18 @@
<div class="box">
<form nz-form [formGroup]="validateForm">
<nz-form-item>
<nz-form-control>
<nz-input-group>
<input nz-input type="text" formControlName="name" placeholder="请输入名称" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control>
<nz-input-group>
<input nz-input type="text" formControlName="code" placeholder="请输入编号" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</form>
</div>

0
src/app/system-management/analysis-of-the-host/addcamera/addcamera.component.scss

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

@ -0,0 +1,22 @@
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';
@Component({
selector: 'app-addcamera',
templateUrl: './addcamera.component.html',
styleUrls: ['./addcamera.component.scss']
})
export class AddcameraComponent implements OnInit {
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
ngOnInit(): void {
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
code: [null, [Validators.required]]
});
}
}

43
src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html

@ -15,8 +15,8 @@
</div>
<div class="treebox">
<nz-tree [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes" [nzExpandAll]="nzExpandAll"
[nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys] = 'nzSelectedKeys' (nzClick)="nzClick($event)" [nzTreeTemplate]="nzTreeTemplate"
[nzExpandedIcon]="multiExpandedIconTpl">
[nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys]='nzSelectedKeys' (nzClick)="nzClick($event)"
[nzTreeTemplate]="nzTreeTemplate" [nzExpandedIcon]="multiExpandedIconTpl">
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="nodebox">
@ -38,13 +38,13 @@
<div class="hostListbox">
<div class="topbox">
<div class="lefttop">
<span>加油站分析主机列表
<span>{{selectedOilStation ? selectedOilStation.displayName : '加油站'}} 分析主机列表
<span class="yellowspan">(请从左侧选择加油站)</span>
</span>
</div>
<div class="righttop" *ngIf="selectedOilStation">
<button nz-button nzType="primary" (click)="addHost()"><i nz-icon nzType="plus-circle"
nzTheme="outline"></i>新增</button>
nzTheme="outline"></i>新增分析主机</button>
</div>
</div>
<div class="tablebox">
@ -57,14 +57,45 @@
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.ip}}</td>
<td>{{data.hostIPAddress}}</td>
<td class="operation">
<a (click)="edit(data)">编辑</a>
<a (click)="edit(data)" style="margin-right: 12px;">编辑</a>
<a (click)="delete(data)">删除</a>
</td>
</tr>
</tbody>
</nz-table>
</div>
<!-- <div class="topbox">
<div class="lefttop">
<span>{{selectedOilStation ? selectedOilStation.displayName : '加油站'}} 摄像头列表
</span>
</div>
<div class="righttop" *ngIf="selectedOilStation">
<button nz-button nzType="primary" (click)="addCamera()"><i nz-icon nzType="plus-circle"
nzTheme="outline"></i>新增摄像头</button>
</div>
</div>
<div class="tablebox">
<nz-table #basicTable2 [nzData]="listOfDataCamera" [nzShowPagination]='false' [nzPageSize]='16'>
<thead>
<tr>
<th>名称</th>
<th>编号</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable2.data">
<td>{{data.name}}</td>
<td>{{data.code}}</td>
<td class="operation">
<a (click)="editCamera(data)">编辑</a>
<a (click)="deleteCamera(data)">删除</a>
</td>
</tr>
</tbody>
</nz-table>
</div> -->
</div>
</div>

1
src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.scss

@ -85,6 +85,7 @@
.hostListbox {
flex: 1;
margin-left: 26px;
overflow-y: auto;
}
.tablebox {

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

@ -6,6 +6,8 @@ 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';
@Component({
selector: 'app-analysis-of-the-host',
templateUrl: './analysis-of-the-host.component.html',
@ -24,7 +26,12 @@ export class AnalysisOfTheHostComponent implements OnInit {
nzExpandAll = false;
totalCount: string
getAllOrganization() {
this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => {
this.http.get('/api/services/app/Organization/GetAll', {
params: {
SkipCount: '0',
MaxResultCount: '9999'
}
}).subscribe((data: any) => {
this.totalCount = data.result.totalCount
data.result.items.forEach(element => {
element.key = element.id
@ -43,30 +50,54 @@ export class AnalysisOfTheHostComponent implements OnInit {
nodes: any[] = []
nzSelectedKeys: any[] = []
selectedOilStation:any
selectedOilStation: any
nzClick(event: NzFormatEmitEvent): void {
console.log(event.node.origin);
if(event.node.origin.isGasStation){//如果点击的是加油站才生效
if (event.node.origin.isGasStation) {//如果点击的是加油站才生效
this.nzSelectedKeys[0] = event.node.origin.id
this.nzSelectedKeys = [...this.nzSelectedKeys]
this.selectedOilStation = event.node.origin
this.getHost()
}else{
} else {
this.message.info('只有加油站才可以增加主机');
}
}
//获得加油站的主机
getHost(){
listOfData: any[] = [];
getHost() {
this.http.get('/api/services/app/EdgeDevice/GetAll', {
params: {
organizationUnitId: this.selectedOilStation.id
}
}).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
}
}).subscribe((data: any) => {
console.log('摄像头列表', data)
this.listOfDataCamera = data
})
}
ngAfterViewInit(): void {
}
//新增分析主机
addHost() {
console.log(this.selectedOilStation)
const modal = this.modal.create({
nzTitle: '新增加油站主机',
nzContent: AddhostComponent,
@ -77,16 +108,14 @@ export class AnalysisOfTheHostComponent implements OnInit {
if (instance.validateForm.valid) {
await new Promise(resolve => {
console.log('表单信息', instance.validateForm)
let body = {
// name: instance.validateForm.value.name,
// DisplayName: instance.validateForm.value.name,
// grantedPermissions: arr
hostIPAddress: instance.validateForm.value.ip,
organizationUnitId: this.selectedOilStation.id
}
this.http.post('/api/services/app/Role/Create', body).subscribe(data => {
this.http.post('/api/services/app/EdgeDevice/Create', body).subscribe(data => {
resolve(data)
this.message.create('success', '创建成功!');
// this.getAllRoles()
this.getHost()
return true
})
})
@ -99,10 +128,96 @@ export class AnalysisOfTheHostComponent implements OnInit {
const instance = modal.getContentComponent();
}
edit(data) {
console.log(data)
const modal = this.modal.create({
nzTitle: '编辑加油站主机',
nzContent: EdithostComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 288,
nzComponentParams: {
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
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
}
delete(item) {
console.log(item)
this.modal.confirm({
nzTitle: `确定要删除${item.name}这个主机吗?`,
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
this.http.delete('/api/services/app/EdgeDevice/Delete', {
params: {
Id: item.id
}
}).subscribe(data => {
this.message.create('success', '删除成功!');
this.getHost()
})
},
nzCancelText: '取消'
});
}
//摄像头
addCamera() {
console.log(this.selectedOilStation)
const modal = this.modal.create({
nzTitle: '新增加油站摄像头',
nzContent: AddcameraComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 288,
nzComponentParams: {},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
console.log('表单信息', instance.validateForm)
let body = {
organizationUnitId: this.selectedOilStation.id,
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
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
}
delete(data) {
editCamera(data) {
}
deleteCamera(data) {
}
listOfData: any[] = [];
}

1
src/app/system-management/analysis-of-the-host/editcamera/editcamera.component.html

@ -0,0 +1 @@
<p>editcamera works!</p>

0
src/app/system-management/analysis-of-the-host/editcamera/editcamera.component.scss

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

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-editcamera',
templateUrl: './editcamera.component.html',
styleUrls: ['./editcamera.component.scss']
})
export class EditcameraComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

12
src/app/system-management/analysis-of-the-host/edithost/edithost.component.html

@ -1 +1,11 @@
<p>edithost works!</p>
<div class="box">
<form nz-form [formGroup]="validateForm">
<nz-form-item>
<nz-form-control>
<nz-input-group>
<input [(ngModel)]="ip" nz-input type="text" formControlName="ip" placeholder="请输入ip" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</form>
</div>

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

@ -1,4 +1,7 @@
import { Component, OnInit } from '@angular/core';
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';
@Component({
selector: 'app-edithost',
@ -7,9 +10,14 @@ import { Component, OnInit } from '@angular/core';
})
export class EdithostComponent implements OnInit {
constructor() { }
@Input() ip: any
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
ngOnInit(): void {
this.validateForm = this.fb.group({
ip: [null, [Validators.required]]
});
}
}

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

@ -22,7 +22,7 @@
</nz-sider>
<nz-layout>
<nz-header>
<span>Hey,欢迎登录中化油站可视化智能安全管理系统</span>
<span>Hey,欢迎登陆加油站可视化智能安全管理系统</span>
<a nz-dropdown [nzDropdownMenu]="menu" [nzTrigger]="'click'" [nzBackdrop]='false'>
<i nz-icon nzType="setting"></i>
</a>

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

@ -13,6 +13,6 @@ export class NavigationComponent implements OnInit {
ngOnInit(): void {
}
signOut() {
this.router.navigate(['/plan'])
this.router.navigate(['/login'])
}
}

4
src/app/system-management/organization/addor/addor.component.html

@ -7,13 +7,13 @@
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<!-- <nz-form-item>
<nz-form-control>
<nz-input-group>
<input nz-input type="text" formControlName="code" placeholder="请输入编码" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</nz-form-item> -->
<nz-form-item>
<nz-form-control>
<label nz-checkbox formControlName="isGasStation">是否为加油站</label>

2
src/app/system-management/organization/addor/addor.component.ts

@ -15,7 +15,7 @@ export class AddorComponent implements OnInit {
ngOnInit(): void {
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
code: [null, [Validators.required]],
// code: [null, [Validators.required]],
isGasStation: [false]
});
}

4
src/app/system-management/organization/editor/editor.component.html

@ -7,13 +7,13 @@
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<!-- <nz-form-item>
<nz-form-control>
<nz-input-group>
<input [(ngModel)]="datacopy.code" nz-input type="text" formControlName="code" placeholder="请输入编码" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</nz-form-item> -->
<nz-form-item>
<nz-form-control>
<label [(ngModel)]="datacopy.isGasStation" nz-checkbox formControlName="isGasStation">是否为加油站</label>

2
src/app/system-management/organization/editor/editor.component.ts

@ -17,7 +17,7 @@ export class EditorComponent implements OnInit {
ngOnInit(): void {
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
code: [null, [Validators.required]],
// code: [null, [Validators.required]],
isGasStation: []
});
this.datacopy = JSON.parse(JSON.stringify(this.data))

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

@ -36,7 +36,12 @@ export class OrganizationComponent implements OnInit {
nzExpandAll = false;
totalCount: string
getAllOrganization() {
this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => {
this.http.get('/api/services/app/Organization/GetAll',{
params:{
SkipCount:'0',
MaxResultCount:'9999'
}
}).subscribe((data: any) => {
this.totalCount = data.result.totalCount
// console.log('组织机构',data.result.totalCount)
data.result.items.forEach(element => {
@ -98,7 +103,7 @@ export class OrganizationComponent implements OnInit {
await new Promise(resolve => {
let body = {
parentId: node ? Number(node.key) : null,
code: instance.validateForm.value.code,
// code: instance.validateForm.value.code,
displayName: instance.validateForm.value.name,
isGasStation: instance.validateForm.value.isGasStation
}
@ -142,7 +147,7 @@ export class OrganizationComponent implements OnInit {
let body = {
id: node.origin.id,
parentId: node.origin.parentId,
code: instance.validateForm.value.code,
// code: instance.validateForm.value.code,
displayName: instance.validateForm.value.name,
isGasStation: instance.validateForm.value.isGasStation
}

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

@ -30,8 +30,10 @@ import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { AnalysisOfTheHostComponent } from './analysis-of-the-host/analysis-of-the-host.component';
import { AddhostComponent } from './analysis-of-the-host/addhost/addhost.component';
import { EdithostComponent } from './analysis-of-the-host/edithost/edithost.component';
import { AddcameraComponent } from './analysis-of-the-host/addcamera/addcamera.component';
import { EditcameraComponent } from './analysis-of-the-host/editcamera/editcamera.component';
@NgModule({
declarations: [OrganizationComponent, UserComponent, RoleComponent, NavigationComponent, AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent],
declarations: [OrganizationComponent, UserComponent, RoleComponent, NavigationComponent, AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent],
imports: [
CommonModule,
SystemRoutingModule,
@ -53,7 +55,7 @@ import { EdithostComponent } from './analysis-of-the-host/edithost/edithost.comp
NzTreeSelectModule,
NzCheckboxModule
],
entryComponents :[AdduserComponent,EdituserComponent,AddroleComponent,EditroleComponent,AddorComponent,EditorComponent,AddhostComponent,EdithostComponent]
entryComponents :[AdduserComponent,EdituserComponent,AddroleComponent,EditroleComponent,AddorComponent,EditorComponent,AddhostComponent,EdithostComponent,AddcameraComponent,EditcameraComponent]
})
export class SystemManagementModule { }

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

@ -45,7 +45,7 @@ export class AdduserComponent implements OnInit {
getAllOrganization() {
this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => {
data.result.items.forEach(element => {
element.key = element.code
element.key = element.id
element.title = element.displayName
});
this.nodes = [...this.toTree.toTree(data.result.items)]

2
src/app/system-management/user/edituser/edituser.component.html

@ -16,7 +16,7 @@
</nz-form-item>
<nz-form-item>
<nz-form-control>
<nz-tree-select [(ngModel)]="data.organizationId" formControlName="organization" [nzNodes]="nodes" nzPlaceHolder="请选择所属机构">
<nz-tree-select [(ngModel)]="data.organizationUnitId" formControlName="organization" [nzNodes]="nodes" nzPlaceHolder="请选择所属机构">
</nz-tree-select>
</nz-form-control>

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

@ -76,7 +76,7 @@ export class UserComponent implements OnInit {
let body = {
userName: instance.validateForm.value.account,
name: instance.validateForm.value.name,
organizationId: Number(instance.validateForm.value.organization),
organizationUnitId: Number(instance.validateForm.value.organization),
roleNames: instance.validateForm.value.role,
phoneNumber: instance.validateForm.value.phonenum,
isActive: true
@ -108,6 +108,7 @@ export class UserComponent implements OnInit {
//编辑用户
editUser(data): void {
console.log(data)
const modal = this.modal.create({
nzTitle: '编辑用户',
nzContent: EdituserComponent,
@ -121,14 +122,15 @@ export class UserComponent implements OnInit {
if (instance.validateForm.valid) {
await new Promise(resolve => {
let body = {
id:data.id,
userName: instance.validateForm.value.account,
name: instance.validateForm.value.name,
organizationId: instance.validateForm.value.organization,
organizationUnitId: instance.validateForm.value.organization,
roleNames: instance.validateForm.value.role,
phoneNumber: instance.validateForm.value.phonenum,
isActive: true
}
this.http.post('/api/services/app/User/Create', body).subscribe(data => {
this.http.put('/api/services/app/User/Update', body).subscribe(data => {
resolve(data)
this.message.create('success', '创建成功!');
this.getAllUsers()

2
src/app/ui/tabbar/tabbar.component.html

@ -18,7 +18,7 @@
<ul nz-menu nzSelectable>
<li nz-menu-item (click)="navChange('/oliStationInfo')">基本信息</li>
<li nz-menu-item (click)="navChange('/equipmentInfo')">器材信息</li>
<li nz-menu-item (click)="navChange('/system/organization')">系统管理</li>
<!-- <li nz-menu-item (click)="navChange('/system/organization')">系统管理</li> -->
<li nz-menu-item (click)="signOut()">退出系统</li>
</ul>
</nz-dropdown-menu>

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

@ -21,10 +21,7 @@ export class TabbarComponent implements OnInit {
setInterval(() => {
this.getTime()
}, 1000);
this.surname = JSON.parse(sessionStorage.getItem('userdata')).surname
// this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe((data: any) => {
// this.surname = data.result.user.surname
// })
this.surname = JSON.parse(sessionStorage.getItem('userdata')).name
}
//获得时间

BIN
src/assets/images/left.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/assets/images/left2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
src/assets/images/right.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/assets/images/right2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
src/assets/images/warning1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
src/assets/images/warning2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
src/assets/images/warning3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
src/assets/images/warning4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Loading…
Cancel
Save