diff --git a/package-lock.json b/package-lock.json index 1b64b40..0732f81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9843,6 +9843,11 @@ } } }, + "js-base64": { + "version": "3.7.2", + "resolved": "https://registry.npmmirror.com/js-base64/download/js-base64-3.7.2.tgz", + "integrity": "sha1-gW0R2BqK/yQWA9Gc5XYeE+Qdd0U=" + }, "js-levenshtein": { "version": "1.1.6", "resolved": "https://registry.npm.taobao.org/js-levenshtein/download/js-levenshtein-1.1.6.tgz", diff --git a/package.json b/package.json index 3c370ef..0eef8fd 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "echarts": "^4.9.0", "firebase": "^7.6.2", "install": "^0.13.0", + "js-base64": "^3.7.2", "linqjs": "^1.0.2", "moment": "^2.29.1", "ng-zorro-antd": "^9.3.0", diff --git a/src/app/pages/criminal-records-admin/criminal-records-admin.component.html b/src/app/pages/criminal-records-admin/criminal-records-admin.component.html index 36f92e9..b74d32b 100644 --- a/src/app/pages/criminal-records-admin/criminal-records-admin.component.html +++ b/src/app/pages/criminal-records-admin/criminal-records-admin.component.html @@ -14,7 +14,7 @@ - + @@ -57,8 +57,9 @@
+
-
+
diff --git a/src/app/pages/criminal-records-admin/criminal-records-admin.component.scss b/src/app/pages/criminal-records-admin/criminal-records-admin.component.scss index b92d1fd..4f9b0d3 100644 --- a/src/app/pages/criminal-records-admin/criminal-records-admin.component.scss +++ b/src/app/pages/criminal-records-admin/criminal-records-admin.component.scss @@ -52,6 +52,13 @@ box-sizing: border-box; padding: 0 28px; margin: 13px 0; + position: relative; + .packup { + position: absolute; + right: 33px; + top: 16px; + cursor: pointer; + } } .chartsbox { diff --git a/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts b/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts index 8d024e8..33eee80 100644 --- a/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts +++ b/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts @@ -255,24 +255,44 @@ export class CriminalRecordsAdminComponent implements OnInit { showDetail: false,//即拖拽时候是否显示详细数值信息 默认true realtime: true, //是否实时更新 filterMode: 'filter', - backgroundColor:'#001735', - width:'18' + backgroundColor: '#001735', + width: '18' }, { - type:'inside', - yAxisIndex:0, - zoomOnMouseWheel:false, //滚轮是否触发缩放 - moveOnMouseMove:true, //鼠标滚轮触发滚动 - moveOnMouseWheel:true + type: 'inside', + yAxisIndex: 0, + zoomOnMouseWheel: false, //滚轮是否触发缩放 + moveOnMouseMove: true, //鼠标滚轮触发滚动 + moveOnMouseWheel: true } ] } + isEcharts: boolean = true + isEchartsShow() { + this.isEcharts = !this.isEcharts + } + startdate + enddate ngOnInit(): void { + + //当前日期 + let myDate: any = new Date(); + 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);//当前日期 + //获取三十天前日期 + let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 30);//最后一个数字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.validateForm = this.fb.group({ level: [null], type: [null], site: [null], - datePicker: [null] + datePicker: [[this.startdate, this.enddate]] }); //饼图 @@ -332,6 +352,15 @@ export class CriminalRecordsAdminComponent implements OnInit { this.validateForm.controls[i].markAsDirty(); this.validateForm.controls[i].updateValueAndValidity(); } + console.log(this.validateForm.value) + + + let ViolationIds = [] + if (this.validateForm.value.type) { + this.warningTypesDetails.forEach(item => { + item.id ? ViolationIds.push(item.id) : null + }); + } } resetForm(e: MouseEvent): void { e.preventDefault(); @@ -351,6 +380,18 @@ export class CriminalRecordsAdminComponent implements OnInit { 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, + }); + } + + list: any = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] look() { this.router.navigate(['/records/petrolStation']) diff --git a/src/app/pages/criminal-records/criminal-records.component.html b/src/app/pages/criminal-records/criminal-records.component.html index a457144..bc2ccf9 100644 --- a/src/app/pages/criminal-records/criminal-records.component.html +++ b/src/app/pages/criminal-records/criminal-records.component.html @@ -57,8 +57,9 @@
+
-
+
diff --git a/src/app/pages/criminal-records/criminal-records.component.scss b/src/app/pages/criminal-records/criminal-records.component.scss index ec459a9..13599ab 100644 --- a/src/app/pages/criminal-records/criminal-records.component.scss +++ b/src/app/pages/criminal-records/criminal-records.component.scss @@ -52,6 +52,14 @@ height: 64px; box-sizing: border-box; padding: 0 28px; + position: relative; + + .packup { + position: absolute; + right: 33px; + top: 16px; + cursor: pointer; + } } .chartsbox { diff --git a/src/app/pages/criminal-records/criminal-records.component.ts b/src/app/pages/criminal-records/criminal-records.component.ts index e80e752..5f6eb7f 100644 --- a/src/app/pages/criminal-records/criminal-records.component.ts +++ b/src/app/pages/criminal-records/criminal-records.component.ts @@ -272,6 +272,11 @@ export class CriminalRecordsComponent implements OnInit { } return dateList; } + + isEcharts:boolean = true + isEchartsShow(){ + this.isEcharts = !this.isEcharts + } ngOnInit(): void { this.validateForm = this.fb.group({ level: [null], diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index 2252ca7..acaee6c 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -5,7 +5,7 @@ import { CacheTokenService } from '../../service/cache-token.service'//引入服 import { CookieService } from 'ngx-cookie-service';//cookie插件 import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { NzMessageService } from 'ng-zorro-antd/message'; - +import { Base64 } from 'js-base64'; @Component({ selector: 'app-login', templateUrl: './login.component.html', @@ -30,8 +30,8 @@ export class LoginComponent implements OnInit { let password = localStorage.getItem('password') if (account && password) { this.validateForm.patchValue({ - userName: localStorage.getItem('account'), - password: localStorage.getItem('password') + userName: Base64.decode(localStorage.getItem('account')), + password: Base64.decode(localStorage.getItem('password')) }); this.remember = true //这一步是回显后让勾选框为选中状态 } @@ -40,7 +40,7 @@ export class LoginComponent implements OnInit { this.submitForm() this.autologin = true //这一步是回显后让勾选框为选中状态 } - + } errmsg: string = ''; //错误信息 @@ -57,8 +57,8 @@ export class LoginComponent implements OnInit { rememberInfo() { // 判断用户是否勾选记住密码,如果勾选,在本地储存中储存登录信息 if (this.remember) { - localStorage.setItem("account", this.validateForm.value.userName) - localStorage.setItem("password", this.validateForm.value.password) + localStorage.setItem("account", Base64.encode(this.validateForm.value.userName)) + localStorage.setItem("password", Base64.encode(this.validateForm.value.password)) } } //自动登陆 @@ -80,7 +80,7 @@ export class LoginComponent implements OnInit { localStorage.removeItem("account") localStorage.removeItem("password") } - if(!this.autologin){ + if (!this.autologin) { localStorage.removeItem("isautologin") } diff --git a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts index e9921ac..e0c7ef5 100644 --- a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts +++ b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts @@ -26,7 +26,14 @@ export class AnalysisOfTheHostComponent implements OnInit { nzExpandAll = false; totalCount: string getAllOrganization() { - this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => { + 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.get('/api/services/app/Organization/GetAll', { + params: params + }).subscribe((data: any) => { this.totalCount = data.result.totalCount data.result.items.forEach(element => { element.key = element.id diff --git a/src/app/system-management/navigation/navigation.component.html b/src/app/system-management/navigation/navigation.component.html index 43a4f69..02cd2a6 100644 --- a/src/app/system-management/navigation/navigation.component.html +++ b/src/app/system-management/navigation/navigation.component.html @@ -17,6 +17,7 @@
  • 用户管理
  • 角色管理
  • 分析主机管理
  • +
  • 推送管理
  • diff --git a/src/app/system-management/organization/organization.component.ts b/src/app/system-management/organization/organization.component.ts index 65ba6a8..88c42df 100644 --- a/src/app/system-management/organization/organization.component.ts +++ b/src/app/system-management/organization/organization.component.ts @@ -36,7 +36,14 @@ export class OrganizationComponent implements OnInit { nzExpandAll = false; totalCount: string getAllOrganization() { - this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => { + 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.get('/api/services/app/Organization/GetAll', { + params: params + }).subscribe((data: any) => { this.totalCount = data.result.totalCount // console.log('组织机构',data.result.totalCount) data.result.items.forEach(element => { diff --git a/src/app/system-management/push/edit-push-item/edit-push-item.component.html b/src/app/system-management/push/edit-push-item/edit-push-item.component.html new file mode 100644 index 0000000..6302b64 --- /dev/null +++ b/src/app/system-management/push/edit-push-item/edit-push-item.component.html @@ -0,0 +1 @@ +

    edit-push-item works!

    diff --git a/src/app/system-management/push/edit-push-item/edit-push-item.component.scss b/src/app/system-management/push/edit-push-item/edit-push-item.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/system-management/push/edit-push-item/edit-push-item.component.spec.ts b/src/app/system-management/push/edit-push-item/edit-push-item.component.spec.ts new file mode 100644 index 0000000..4a3f2cd --- /dev/null +++ b/src/app/system-management/push/edit-push-item/edit-push-item.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditPushItemComponent } from './edit-push-item.component'; + +describe('EditPushItemComponent', () => { + let component: EditPushItemComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EditPushItemComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditPushItemComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/system-management/push/edit-push-item/edit-push-item.component.ts b/src/app/system-management/push/edit-push-item/edit-push-item.component.ts new file mode 100644 index 0000000..d6ab49f --- /dev/null +++ b/src/app/system-management/push/edit-push-item/edit-push-item.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-edit-push-item', + templateUrl: './edit-push-item.component.html', + styleUrls: ['./edit-push-item.component.scss'] +}) +export class EditPushItemComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/system-management/push/push.component.html b/src/app/system-management/push/push.component.html new file mode 100644 index 0000000..f30a031 --- /dev/null +++ b/src/app/system-management/push/push.component.html @@ -0,0 +1,46 @@ +
    +
    +
    + 通知推送权限配置 +
    +
    +
    + + + + + + + + +
    + +
    +
    +
    + + + + + + + + + + + + + + + +
    预警类别预警/分析事件预警推送范围预警处置范围操作
    {{item.violationType}}{{item.violationName}}34 + 编辑 +
    +
    + +
    \ No newline at end of file diff --git a/src/app/system-management/push/push.component.scss b/src/app/system-management/push/push.component.scss new file mode 100644 index 0000000..27686f2 --- /dev/null +++ b/src/app/system-management/push/push.component.scss @@ -0,0 +1,81 @@ +.pushbox { + width: 100%; + height: 100%; + background: #FFFFFF; + box-sizing: border-box; + padding: 20px; + overflow: hidden; + display: flex; + flex-direction: column; + +} + +.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; + + //滚动条样式 + ::-webkit-scrollbar { + display: none; + } + table{ + width: 100%; + tr{ + height: 40px; + line-height: 40px; + font-size: 14px; + } + tr:nth-child(1) th{ + font-weight: 600; + font-size: 15px; + } + tr,tr th,td{ + border: 0px; + color: #000D21; + font-family: synormal; + font-weight: 400; + } + tr:nth-child(odd) { + background-color:rgba(145, 204, 255, 0.16); + } + tr:nth-child(even) { + background-color:#fff; + } + tr th:nth-child(1),td:nth-child(1){ + box-sizing: border-box; + padding-left: 5%; + } + } +} diff --git a/src/app/system-management/push/push.component.ts b/src/app/system-management/push/push.component.ts new file mode 100644 index 0000000..5bd9804 --- /dev/null +++ b/src/app/system-management/push/push.component.ts @@ -0,0 +1,46 @@ +import { HttpClient } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +@Component({ + selector: 'app-push', + templateUrl: './push.component.html', + styleUrls: ['./push.component.scss'] +}) + +export class PushComponent implements OnInit { + + validateForm!: FormGroup; + constructor(private fb: FormBuilder, private http: HttpClient) { } + + ngOnInit(): void { + this.validateForm = this.fb.group({ + search: [null] + }); + this.getViolation() + } + + + //获取预警类型 + list:any + getViolation() { + this.http.get('/api/services/app/Violation/GetAllList').subscribe((data:any) => { + this.list = data.result + console.log('预警类型', data) + }) + } + + + edititem(item){ + + } + + + + //搜索框提交 + submitForm(): void { + for (const i in this.validateForm.controls) { + this.validateForm.controls[i].markAsDirty(); + this.validateForm.controls[i].updateValueAndValidity(); + } + } +} diff --git a/src/app/system-management/system-management-routing.module.ts b/src/app/system-management/system-management-routing.module.ts index c0bbef7..c21a207 100644 --- a/src/app/system-management/system-management-routing.module.ts +++ b/src/app/system-management/system-management-routing.module.ts @@ -6,12 +6,14 @@ import { RoleComponent } from './role/role.component'; import { OrganizationComponent } from './organization/organization.component'; import { UserComponent } from './user/user.component'; import { AnalysisOfTheHostComponent } from './analysis-of-the-host/analysis-of-the-host.component'; +import { PushComponent } from './push/push.component'; const routes: Routes = [ { path: 'organization', component: OrganizationComponent }, { path: 'user', component: UserComponent }, { path: 'role', component: RoleComponent }, - { path: 'host', component: AnalysisOfTheHostComponent } + { path: 'host', component: AnalysisOfTheHostComponent }, + { path: 'push', component: PushComponent } ]; @NgModule({ diff --git a/src/app/system-management/system-management.module.ts b/src/app/system-management/system-management.module.ts index 77f63bb..58a2bda 100644 --- a/src/app/system-management/system-management.module.ts +++ b/src/app/system-management/system-management.module.ts @@ -32,8 +32,10 @@ import { AddhostComponent } from './analysis-of-the-host/addhost/addhost.compone 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'; +import { PushComponent } from './push/push.component'; +import { EditPushItemComponent } from './push/edit-push-item/edit-push-item.component'; @NgModule({ - declarations: [OrganizationComponent, UserComponent, RoleComponent, NavigationComponent, AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent], + declarations: [OrganizationComponent, UserComponent, RoleComponent, NavigationComponent, AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, PushComponent, EditPushItemComponent], imports: [ CommonModule, SystemRoutingModule, diff --git a/src/app/system-management/user/adduser/adduser.component.ts b/src/app/system-management/user/adduser/adduser.component.ts index 4320adf..ed57586 100644 --- a/src/app/system-management/user/adduser/adduser.component.ts +++ b/src/app/system-management/user/adduser/adduser.component.ts @@ -43,7 +43,14 @@ export class AdduserComponent implements OnInit { //获取所有组织机构 nodes:any = [] getAllOrganization() { - this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => { + 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.get('/api/services/app/Organization/GetAll', { + params: params + }).subscribe((data: any) => { data.result.items.forEach(element => { element.key = element.id element.title = element.displayName diff --git a/src/app/system-management/user/edituser/edituser.component.ts b/src/app/system-management/user/edituser/edituser.component.ts index c39c449..c20d1c4 100644 --- a/src/app/system-management/user/edituser/edituser.component.ts +++ b/src/app/system-management/user/edituser/edituser.component.ts @@ -45,7 +45,14 @@ export class EdituserComponent implements OnInit { //获取所有组织机构 nodes:any = [] getAllOrganization() { - this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => { + 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.get('/api/services/app/Organization/GetAll', { + params: params + }).subscribe((data: any) => { data.result.items.forEach(element => { element.key = element.id element.title = element.displayName diff --git a/src/assets/images/icon/push.png b/src/assets/images/icon/push.png new file mode 100644 index 0000000..f52e818 Binary files /dev/null and b/src/assets/images/icon/push.png differ diff --git a/src/assets/images/packup.png b/src/assets/images/packup.png new file mode 100644 index 0000000..04530c7 Binary files /dev/null and b/src/assets/images/packup.png differ