Browse Source

[新增]综合统计

master
邵佳豪 4 months ago
parent
commit
647cac21c2
  1. BIN
      dist.zip
  2. 45
      src/app/pages/home-page-comprehensive/home-page-comprehensive.component.html
  3. 933
      src/app/pages/home-page-comprehensive/home-page-comprehensive.component.ts
  4. 10
      src/app/pages/home-page/home-page.component.html
  5. 10
      src/app/pages/home-page/home-page.component.ts
  6. 16
      src/app/pages/home/home.component.html
  7. 1
      src/app/pages/home/home.component.ts
  8. 121
      src/app/pages/singlelogin/singlelogin.component.html
  9. 234
      src/app/pages/singlelogin/singlelogin.component.scss
  10. 54
      src/app/pages/singlelogin/singlelogin.component.ts

BIN
dist.zip

Binary file not shown.

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

@ -44,7 +44,7 @@
<nz-spin *ngIf="isSpin" nzSimple class="nzspin"></nz-spin>
</div>
<div class="leftitem ranking">
<span class="itemname">近30天事件排名</span>
<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">
@ -134,14 +134,15 @@
</div>
<div class="content_box">
<div class="leftitem leftitemlimit">
<div class="eventechartpieAll" id="eventechartpieAll">
<div class="eventechartpieAll" id="eventechartpieAll_YK">
</div>
<nz-spin *ngIf="isSpin" nzSimple class="nzspin"></nz-spin>
<nz-spin *ngIf="isSpin_YK" nzSimple class="nzspin"></nz-spin>
</div>
<div class="leftitem ranking">
<span class="itemname">近30天事件排名</span>
<span class="itemname">油库近30天事件排名</span>
<div class="box eventbox">
<div class="eventboxitem" *ngFor="let item of HomeAggregatioData.violationNameAgg;let key = index">
<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">
@ -156,7 +157,7 @@
<div class="progressbox">
<div class="progress">
<div class="colorbar"
[ngStyle]="width(item.count,HomeAggregatioData.violationNameAgg[0].count)"
[ngStyle]="width(item.count,HomeAggregatioData_YK.violationNameAgg[0].count)"
[ngClass]="{'yellow': key < 3,'blue': key > 2}">
</div>
</div>
@ -167,12 +168,12 @@
</div>
</div>
<nz-spin *ngIf="isSpin" nzSimple class="nzspin"></nz-spin>
<nz-spin *ngIf="isSpin_YK" nzSimple class="nzspin"></nz-spin>
</div>
<div class="leftitem ranking" style="margin-left: 50px;">
<span class="itemname">近30天油排名</span>
<span class="itemname">近30天油排名</span>
<div class="box eventbox">
<div class="eventboxitem" *ngFor="let item of HomeAggregatioData.stationAgg;let key = index">
<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">
@ -187,7 +188,7 @@
<div class="progressbox">
<div class="progress">
<div class="colorbar"
[ngStyle]="width(item.count,HomeAggregatioData.stationAgg[0].count)"
[ngStyle]="width(item.count,HomeAggregatioData_YK.stationAgg[0].count)"
[ngClass]="{'yellow': key < 3,'blue': key > 2}">
</div>
</div>
@ -198,28 +199,28 @@
</div>
</div>
<nz-spin *ngIf="isSpin" nzSimple class="nzspin"></nz-spin>
<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.dev.stationCount}}</span>
<span>接入油(个)</span>
<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.dev.violationCount}}</span>
<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.dev.cameraCount}}</span>
<span class="lightspan lightspan3">{{HomeAggregatioData_YK.dev.cameraCount}}</span>
<span>摄像头(个)</span>
</div>
</div>
@ -252,15 +253,15 @@
<div class="bottomitemcontent bottomitemcontent2">
<div class="bottomitemchartboxspecial">
<span class="bartitle">油库近30天预警事件统计</span>
<div class="eventechartpie" id="eventechartpie"></div>
<div class="eventechartline" id="eventechartline"></div>
<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" nzSimple class="nzspin"></nz-spin>
<nz-spin *ngIf="isSpinOfEventWarning_YK" nzSimple class="nzspin"></nz-spin>
</div>
</div>
</div>
</div>
<div class="bottomitem">
<div class="title">
@ -297,13 +298,13 @@
<div class="bottomitemcontent bottomitemcontent4">
<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="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" nzSimple class="nzspin"></nz-spin>
<nz-spin *ngIf="isSpinOfOilDischarge_YK" nzSimple class="nzspin"></nz-spin>
<div class="oilNum">
<div class="oilNumItem">
<div class="pointbox">

933
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>

10
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(() => {

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

@ -3,13 +3,25 @@
<div class="boxleft">
<img *ngIf="isProd" src="../../../assets/images/logo2.png" alt="">
</div>
<div class="libox" *ngIf="!isGasStationNav">
<div class="libox" *ngIf="!isGasStationNav && isComprehensive == 'true'">
<li class="router-link-active">
AI视频预警统计
</li>
</div>
<div class="libox" *ngIf="!isGasStationNav && isComprehensive == 'false'">
<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 == 'true'">
<li class="router-link-active">
AI视频预警统计
</li>
</div>
<div class="libox" *ngIf="isGasStationNav && isComprehensive == 'false'">
<ng-container *ngIf="isGasStationBack; else elseTemplate">
<li [routerLink]="['/plan/petrolStation']" routerLinkActive="router-link-active">
数字油站

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

@ -102,6 +102,7 @@ export class HomeComponent implements OnInit {
selectedItem;
isZT = sessionStorage.getItem("isZT") || "false";
isComprehensive = sessionStorage.getItem("isComprehensive") || "false";
routerChange(item) {
if (
JSON.parse(sessionStorage.getItem("isGasStation")) &&

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

@ -1,121 +0,0 @@
<!-- <nz-modal nzWidth="1300px" [(nzVisible)]="isVisible" nzMaskClosable="false" nzTitle="请绑定用户"
(nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()" :nzFooter=" " nzClosable="false" nzKeyboard="false">
<ng-container *nzModalContent>
<div class="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="blue">绑定</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>
</ng-container>
</nz-modal> -->

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

@ -1,234 +0,0 @@
.userBox {
width: 100%;
height: 100%;
min-height: 600px;
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;
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;
}
.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;
}
}
}

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

@ -25,11 +25,6 @@ export class SingleloginComponent implements OnInit {
async ngOnInit(): Promise<void> {
console.log("查询参数", this.route.snapshot.queryParams.page);
this.pageType = this.route.snapshot.queryParams.page;
// let obj = {
// SAG_USER_TOKEN:
// "hrtwsc5737z6LYr67e2e0PvinLXvo0Pk8ffAp8qxOLXt9CtSLGg61cZv9IDjKybQ%3D%3D",
// };
// this.setCookie(obj);
let token = this.getCookie("SAG_USER_TOKEN");
if (!token) {
@ -128,27 +123,6 @@ export class SingleloginComponent implements OnInit {
});
}
//确认中化是否绑定了我们的用户
// getSinochemUsers(Keyword) {
// return new Promise<void>((resolve, reject) => {
// this.http
// .get("/api/services/app/User/GetSinochemUsers", {
// params: {
// Keyword: Keyword,
// },
// })
// .subscribe(
// (data: any) => {
// console.log("中化用户信息", data);
// resolve(data);
// },
// (err) => {
// reject();
// }
// );
// });
// }
//中化用户登录获得自己的token信息
SinochemLogin() {
return new Promise<void>((resolve, reject) => {
@ -163,6 +137,8 @@ export class SingleloginComponent implements OnInit {
(data: any) => {
if (this.pageType == "ai") {
this.enterPage(data);
} else if (this.pageType == "comprehensive") {
this.enterComprehensive(data);
} else {
this.enterPageSystem(data);
}
@ -298,6 +274,32 @@ export class SingleloginComponent implements OnInit {
}
);
}
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("isZT", "true");
sessionStorage.setItem("isComprehensive", "true");
//跳转页面
sessionStorage.setItem("isGasStation", "false");
this.router.navigate(["/comprehensive"]);
},
(err) => {
alert("获取用户信息错误");
}
);
}
menu1 = [
{ name: "首页", url: "/homepage" },

Loading…
Cancel
Save