diff --git a/src/app/babylon/controller/serve-manager.ts b/src/app/babylon/controller/serve-manager.ts index a6de083..5e8c3f0 100644 --- a/src/app/babylon/controller/serve-manager.ts +++ b/src/app/babylon/controller/serve-manager.ts @@ -245,6 +245,22 @@ export class ServeManager { + //#region 本地json 加载 + + /** + * 加载Json + * @param path 例如: "assets/configs/markplan-1.json" + * @param onSuccess + */ + loadJson(path: string, onSuccess: (data) => void) { + this.buildingBISrv.http.get(path) + .subscribe(data => { + console.log("loadJson", data); + onSuccess(data); + }); + } + + //#endregion diff --git a/src/app/babylon/view/mark-window/mark-window.ts b/src/app/babylon/view/mark-window/mark-window.ts index ac974dd..a63925d 100644 --- a/src/app/babylon/view/mark-window/mark-window.ts +++ b/src/app/babylon/view/mark-window/mark-window.ts @@ -11,6 +11,7 @@ import { Event_KeyboardInput } from "../../controller/event-manager/events/event import { Event_MarkInfoChange, MarkInfoChangeType } from "../../controller/event-manager/events/event-mark-info-change"; import { InputController } from "../../controller/inputController"; import { SceneManager } from "../../controller/scene-manager"; +import { ServeManager } from "../../controller/serve-manager"; import { BuildingStatus } from "../../controller/status/building-status"; import { IndoorStatus } from "../../controller/status/indoor-status"; import { StatusManager } from "../../controller/status/status-manager"; @@ -125,6 +126,7 @@ export class MarkWindow extends UIBase { onInit() { super.onInit(); + MarkWindow.instance = this; let instance = this; instance.initPickEvent(); @@ -141,6 +143,7 @@ export class MarkWindow extends UIBase { instance.onGetAllMarkPlanData(data); MarkWindow.instance.selectMarkNode(null, null, true); //模拟选中空节点,创建游离节点 console.log("标绘信息", data); + console.log(JSON.stringify(data)); }); this.weatherTool = new WeatherTool(SceneManager.Instance.defaultCamera, SceneManager.Instance.scene); 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 0fe3c51..63587fa 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 @@ -246,30 +246,30 @@ export class CriminalRecordsAdminComponent implements OnInit { bottom: '3px', top: '20px' }, - dataZoom: [ //Y轴滑动条 - { - type: 'slider', //滑动条 - show: true, //开启 - yAxisIndex: 0,//表示控制第几个y轴 - left: '97%', //滑动条位置 - start: 1, //初始化时,滑动条宽度开始标度 - end: 100, //初始化时,滑动条宽度结束标度
- maxValueSpan: 10,//显示数据的条数(默认显示10个) - showDataShadow: false,//是否显示数据阴影 默认auto - showDetail: false,//即拖拽时候是否显示详细数值信息 默认true - realtime: true, //是否实时更新 - filterMode: 'filter', - backgroundColor: '#001735', - width: '18' - }, - { - type: 'inside', - yAxisIndex: 0, - zoomOnMouseWheel: false, //滚轮是否触发缩放 - moveOnMouseMove: true, //鼠标滚轮触发滚动 - moveOnMouseWheel: true - } - ] + // dataZoom: [ //Y轴滑动条 + // { + // type: 'slider', //滑动条 + // show: true, //开启 + // yAxisIndex: 0,//表示控制第几个y轴 + // left: '97%', //滑动条位置 + // start: 1, //初始化时,滑动条宽度开始标度 + // end: 100, //初始化时,滑动条宽度结束标度
+ // maxValueSpan: 10,//显示数据的条数(默认显示10个) + // showDataShadow: false,//是否显示数据阴影 默认auto + // showDetail: false,//即拖拽时候是否显示详细数值信息 默认true + // realtime: true, //是否实时更新 + // filterMode: 'filter', + // backgroundColor: '#001735', + // width: '18' + // }, + // { + // type: 'inside', + // yAxisIndex: 0, + // zoomOnMouseWheel: false, //滚轮是否触发缩放 + // moveOnMouseMove: true, //鼠标滚轮触发滚动 + // moveOnMouseWheel: true + // } + // ] } isEcharts: boolean = true isEchartsShow() { diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts index e579706..1b591ad 100644 --- a/src/app/pages/plan/plan.component.ts +++ b/src/app/pages/plan/plan.component.ts @@ -71,25 +71,30 @@ export class PlanComponent implements OnInit { ngAfterViewInit(): void { let simpleData: InsitutionDataSimple = new InsitutionDataSimple(); - simpleData.id = 1; - simpleData.key = "ceshi"; - simpleData.name = "测试"; + simpleData.id = 1; //来自选中的单位的信息 ,测试:1 + simpleData.key = "ceshi"; //正式: id.tostring(),测试:"ceshi" + simpleData.name = "测试"; //来自选中的单位的信息 ,测试:"测试" + + let has3dData = true;//是否有三维数据,来自选中单位的信息 let loginStatus = StatusManager.getStatus(LoginSatus); - //loginStatus.getInstitutionListFromServe((result: InsitutionDataSimple[], data: any) => { if (ModeManager.institutionDemoKey == ModeManager.c_demoKey_null) { //无指定测试单位,则为正式启动,根据当前单位key寻找 - let key = 'ceshi'; - //let find = data.find(item => { return item.key === key }) - let find = simpleData; - if (find) { //如果在data中找到了对应的单位key,则表示已经有三维数据,直接进入 + if (has3dData) { //如果已经有三维数据,直接进入 this.beforeOneSatus = StatusManager.getStatus(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