(LoginSatus);
- this.beforeOneSatus.onSelectInsSuccess(find)
- } else { //如果没有找到对应的单位key,则调用新建单位
- let isAdd = confirm('没有单位' + key + ',是否进行初始化?')
- if (isAdd) {
- let name = key;
- let id = 2;// 单位id
- loginStatus.createInsitution(key, name, id);
+ this.beforeOneSatus.onSelectInsSuccess(simpleData)
+ } else { //如果没有三维数据
+ if (ModeManager.s_isMakeMode) //内部制作模式下,询问新建
+ {
+ let isAdd = confirm('没有单位' + simpleData.key + ',是否进行初始化?')
+ if (isAdd) {
+ let name = simpleData.key;
+ let id = 2;// 单位id
+ loginStatus.createInsitution(simpleData.key, name, id);
+ }
+ }
+ else //非内部制作模式,不开启
+ {
+ console.log("没有单位" + simpleData.key);
}
}
} else {
@@ -103,7 +108,6 @@ export class PlanComponent implements OnInit {
//this.modelInit(data) //开发模式 选择单位 弹窗
}
}
- //});
}
ngOnDestroy(): void { //组件销毁前 销毁canvas
diff --git a/src/app/service/babylon/building-basic-infos.service.ts b/src/app/service/babylon/building-basic-infos.service.ts
index 61f8e45..5b54c29 100644
--- a/src/app/service/babylon/building-basic-infos.service.ts
+++ b/src/app/service/babylon/building-basic-infos.service.ts
@@ -9,7 +9,7 @@ import { catchError, retry } from 'rxjs/operators';
export class BuildingBasicInfosService {
constructor(
- private http: HttpClient
+ public http: HttpClient
) { }
@@ -103,6 +103,10 @@ export class BuildingBasicInfosService {
}
//#endregion
+
+
+
+
//#region 错误捕捉
private handleError(error: HttpErrorResponse) {
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
index 6302b64..77d5669 100644
--- 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
@@ -1 +1,20 @@
-edit-push-item works!
+
+
+
\ No newline at end of file
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
deleted file mode 100644
index 4a3f2cd..0000000
--- a/src/app/system-management/push/edit-push-item/edit-push-item.component.spec.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-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
index d6ab49f..e94cce6 100644
--- 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
@@ -1,5 +1,7 @@
-import { Component, OnInit } from '@angular/core';
-
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { Component, OnInit, Input } from '@angular/core';
+import { NzModalRef } from 'ng-zorro-antd/modal';
+import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-edit-push-item',
templateUrl: './edit-push-item.component.html',
@@ -7,9 +9,28 @@ import { Component, OnInit } from '@angular/core';
})
export class EditPushItemComponent implements OnInit {
- constructor() { }
+ @Input() data?: any;
+ @Input() pushRoleIds?: any;
+ @Input() handleRoleIds?: any;
+
+ validateForm!: FormGroup;
+ constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
+ multiplePushValue: any
+ multipleHandleValue: any
+ pushList
+ handleList
ngOnInit(): void {
- }
+ this.pushList = this.pushRoleIds;
+ this.handleList = this.handleRoleIds;
+ console.log(this.pushRoleIds)
+ console.log(this.handleRoleIds)
+ this.multiplePushValue = this.data.pushRoleIds
+ this.multipleHandleValue = this.data.handleRoleIds
+ this.validateForm = this.fb.group({
+ push: [null, [Validators.required]],
+ handle: [null, [Validators.required]]
+ });
+ }
}
diff --git a/src/app/system-management/push/push.component.html b/src/app/system-management/push/push.component.html
index f30a031..5ecc8f2 100644
--- a/src/app/system-management/push/push.component.html
+++ b/src/app/system-management/push/push.component.html
@@ -29,8 +29,12 @@
{{item.violationType}} |
{{item.violationName}} |
- 3 |
- 4 |
+
+ {{i}}
+ |
+
+ {{i}}
+ |
编辑
|
diff --git a/src/app/system-management/push/push.component.scss b/src/app/system-management/push/push.component.scss
index 27686f2..ced49f2 100644
--- a/src/app/system-management/push/push.component.scss
+++ b/src/app/system-management/push/push.component.scss
@@ -77,5 +77,8 @@
box-sizing: border-box;
padding-left: 5%;
}
+ .name{
+ margin-right: 8px;
+ }
}
}
diff --git a/src/app/system-management/push/push.component.ts b/src/app/system-management/push/push.component.ts
index 5bd9804..6f09bcc 100644
--- a/src/app/system-management/push/push.component.ts
+++ b/src/app/system-management/push/push.component.ts
@@ -1,6 +1,9 @@
import { HttpClient } from '@angular/common/http';
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { NzModalService } from 'ng-zorro-antd/modal';
+import { NzMessageService } from 'ng-zorro-antd/message';
+import { EditPushItemComponent } from './edit-push-item/edit-push-item.component';
@Component({
selector: 'app-push',
templateUrl: './push.component.html',
@@ -10,28 +13,104 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
export class PushComponent implements OnInit {
validateForm!: FormGroup;
- constructor(private fb: FormBuilder, private http: HttpClient) { }
+ constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef, private fb: FormBuilder, private http: HttpClient, private message: NzMessageService) { }
- ngOnInit(): void {
+ async ngOnInit(): Promise {
this.validateForm = this.fb.group({
search: [null]
});
+
+ await this.getPutRoles()
+ await this.getHandleRoles()
this.getViolation()
}
//获取预警类型
- list:any
+ list: any
getViolation() {
- this.http.get('/api/services/app/Violation/GetAllList').subscribe((data:any) => {
+ this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => {
+
+ data.result.forEach(element => {
+ element.pushRoleNames = []
+ element.pushRoleIds.forEach(item => {
+ this.pushRoleIds.forEach(i => {
+ if (i.id == item) {
+ element.pushRoleNames.push(i.displayName)
+ }
+ });
+ });
+ element.handleRoleNames = []
+ element.handleRoleIds.forEach(item => {
+ this.handleRoleIds.forEach(i => {
+ if (i.id == item) {
+ element.handleRoleNames.push(i.displayName)
+ }
+ });
+ });
+ });
this.list = data.result
- console.log('预警类型', data)
+ console.log('预警类型', this.list)
+ })
+ }
+ //获取推送的角色列表
+ pushRoleIds
+ async getPutRoles() {
+ await new Promise((resolve, reject) => {
+ this.http.get('/api/services/app/Violation/GetPutRoles').subscribe((data: any) => {
+ this.pushRoleIds = data.result
+ resolve(data)
+ console.log('推送角色', data)
+ })
})
}
+ handleRoleIds
+ //获取处置的角色列表
+ async getHandleRoles() {
+ await new Promise((resolve, reject) => {
+ this.http.get('/api/services/app/Violation/GetHandleRoles').subscribe((data: any) => {
+ this.handleRoleIds = data.result
+ resolve(data)
+ console.log('处置角色', data)
+ })
+ })
+ }
- edititem(item){
-
+ edititem(item) {
+ const modal = this.modal.create({
+ nzTitle: '编辑推送设置',
+ nzContent: EditPushItemComponent,
+ nzViewContainerRef: this.viewContainerRef,
+ nzWidth: 300,
+ nzComponentParams: {
+ data: item,
+ pushRoleIds: this.pushRoleIds,
+ handleRoleIds: this.handleRoleIds
+ },
+ nzOnOk: async () => {
+ if (instance.validateForm.valid) {
+ await new Promise(resolve => {
+ console.log('表单信息', instance.validateForm)
+ let body = {
+ id: item.id,
+ pushRoleIds: instance.validateForm.value.push,
+ handleRoleIds: instance.validateForm.value.handle,
+ }
+ this.http.put('/api/services/app/Violation/UpdateRoles', body).subscribe(data => {
+ resolve(data)
+ this.message.create('success', '修改成功!');
+ this.getViolation()
+ return true
+ })
+ })
+ } else {
+ this.message.create('warning', '请填写完整!');
+ return false
+ }
+ }
+ });
+ const instance = modal.getContentComponent();
}
diff --git a/src/app/system-management/system-management.module.ts b/src/app/system-management/system-management.module.ts
index 58a2bda..f5d4321 100644
--- a/src/app/system-management/system-management.module.ts
+++ b/src/app/system-management/system-management.module.ts
@@ -57,7 +57,7 @@ import { EditPushItemComponent } from './push/edit-push-item/edit-push-item.comp
NzTreeSelectModule,
NzCheckboxModule
],
- entryComponents :[AdduserComponent,EdituserComponent,AddroleComponent,EditroleComponent,AddorComponent,EditorComponent,AddhostComponent,EdithostComponent,AddcameraComponent,EditcameraComponent]
+ entryComponents :[AdduserComponent,EdituserComponent,AddroleComponent,EditroleComponent,AddorComponent,EditorComponent,AddhostComponent,EdithostComponent,AddcameraComponent,EditcameraComponent,EditPushItemComponent]
})
export class SystemManagementModule { }
diff --git a/src/assets/configs/markplan-1.json b/src/assets/configs/markplan-1.json
new file mode 100644
index 0000000..44a2407
--- /dev/null
+++ b/src/assets/configs/markplan-1.json
@@ -0,0 +1,99 @@
+{
+ "datas": [
+ {
+ "index": 0,
+ "nodes": [
+ {
+ "index": 0,
+ "id": 1,
+ "name": "333",
+ "cameraData": {
+ "target": {
+ "_isDirty": true,
+ "_x": 10.469921166171673,
+ "_y": -4.215635415935357,
+ "_z": 2.8616421593814403
+ },
+ "beta": 0.9213049244407263,
+ "alpha": 0.7991533333147679,
+ "radius": 21.332012959053195
+ },
+ "environmentData": [
+ {
+ "markDatas": [],
+ "id": 0,
+ "buildingId": null,
+ "isOutdoor": true,
+ "floorId": null,
+ "isNow": true
+ },
+ {
+ "markDatas": [],
+ "id": 1,
+ "buildingId": null,
+ "isOutdoor": true,
+ "floorId": null
+ }
+ ],
+ "natureData": {
+ "weather": "Sun",
+ "temperature": 26,
+ "windDirection": "East",
+ "windPower": 3
+ },
+ "showZP": false
+ },
+ {
+ "index": 0,
+ "id": 2,
+ "name": "444",
+ "cameraData": {
+ "target": {
+ "_isDirty": true,
+ "_x": 10.469921166171673,
+ "_y": -4.215635415935357,
+ "_z": 2.8616421593814403
+ },
+ "beta": 0.9213049244407263,
+ "alpha": 0.7991533333147679,
+ "radius": 21.332012959053195
+ },
+ "environmentData": [
+ {
+ "markDatas": [],
+ "id": 0,
+ "buildingId": null,
+ "isOutdoor": true,
+ "floorId": null,
+ "isNow": true
+ },
+ {
+ "markDatas": [],
+ "id": 1,
+ "buildingId": null,
+ "isOutdoor": true,
+ "floorId": null
+ },
+ {
+ "markDatas": [],
+ "id": 2,
+ "buildingId": null,
+ "isOutdoor": true,
+ "floorId": null
+ }
+ ],
+ "natureData": {
+ "weather": "Sun",
+ "temperature": 26,
+ "windDirection": "East",
+ "windPower": 3
+ },
+ "showZP": false
+ }
+ ],
+ "id": 0,
+ "name": "111"
+ }
+ ],
+ "institutionID": "ceshi"
+}
\ No newline at end of file
diff --git a/src/assets/images/mark/inside/stcmhq.png b/src/assets/images/mark/inside/tcmhq.png
similarity index 100%
rename from src/assets/images/mark/inside/stcmhq.png
rename to src/assets/images/mark/inside/tcmhq.png