diff --git a/src/app/babylon/controller/config-manager.ts b/src/app/babylon/controller/config-manager.ts index 1db46f5..a8801b0 100644 --- a/src/app/babylon/controller/config-manager.ts +++ b/src/app/babylon/controller/config-manager.ts @@ -87,6 +87,7 @@ export class ConfigManager { case FacilityType.XF_MHQ_PT_35: result = "35kg普通灭火器"; break; case FacilityType.XF_MHQ_GF_4: result = "4kg干粉灭火器"; break; case FacilityType.XF_MHQ_GF_8: result = "8kg干粉灭火器"; break; + case FacilityType.XF_MHQ_GF_25: result = "25kg干粉灭火器"; break; case FacilityType.XF_MHQ_GF_35: result = "35kg干粉灭火器"; break; case FacilityType.XF_MHT: result = "灭火毯"; break; case FacilityType.XF_XFQ: result = "消防锹"; break; diff --git a/src/app/babylon/controller/data-manager.ts b/src/app/babylon/controller/data-manager.ts index de28f8a..c83168a 100644 --- a/src/app/babylon/controller/data-manager.ts +++ b/src/app/babylon/controller/data-manager.ts @@ -305,6 +305,25 @@ export class DataManager { return result; } + /** + * 获取 上传标绘物所需文件时,保存的路径 (无法区分节点) + * @param institutionKey 单位id + * @param resType 资源类型 + * @param key 唯一key + */ + static getResPath_mark(institutionKey: string, resType: ResType, key: string) { + let result = + institutionKey.toLocaleLowerCase() + + '/' + + ServeManager.ngAssetsPath + + "mark/" + //表示是应急标绘下的 + resType + + '/' + + key + + '/'; + return result; + } + // //获取设备资源完整路径 // static getResPath_facility(facilityPosType: FacilityPosType, type: FacilityType): string { // let result = "mesh/facilities/"; @@ -442,9 +461,10 @@ export class DataManager { case FacilityType.XF_MHQ_PT_35: case FacilityType.XF_MHQ_GF_4: case FacilityType.XF_MHQ_GF_8: + case FacilityType.XF_MHQ_GF_25: case FacilityType.XF_MHQ_GF_35: result = new PropertyData_MHQ(key, facilityType); break; - case FacilityType.JY_JYJ: result = new PropertyData_JYJ(key,"", "","", "","",); break; - case FacilityType.JY_YG: result = new PropertyData_YG(key,"", "","", "","",""); break; + case FacilityType.JY_JYJ: result = new PropertyData_JYJ(key, "", "", "", "", "",); break; + case FacilityType.JY_YG: result = new PropertyData_YG(key, "", "", "", "", "", ""); break; case FacilityType.JY_SYGX: result = new PropertyData_SYGX(key); break; case FacilityType.JY_YQHSGX: result = new PropertyData_YQHSGX(key); break; @@ -586,5 +606,12 @@ export enum ModelChangeType { Update, } +/** + * 资源类型 + */ +export enum ResType { + Texture = "texture", + Video = "video", +} diff --git a/src/app/babylon/controller/serve-manager.ts b/src/app/babylon/controller/serve-manager.ts index a6de083..87a3a9e 100644 --- a/src/app/babylon/controller/serve-manager.ts +++ b/src/app/babylon/controller/serve-manager.ts @@ -158,7 +158,14 @@ export class ServeManager { //#region 文件上传 - //队列性,批量上传 + /** + * 队列性,批量上传 + * @param index + * @param files + * @param resPath_out + * @param onOneSuccess + * @param onEnd + */ uploadFile(index: number, files: File[], resPath_out, onOneSuccess: (name: string, path: string, file: File) => void, onEnd: () => void) { if (index < files.length) { console.log("上传文件", files[index].name); @@ -245,6 +252,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/model/data/model-data/model-data-facility.ts b/src/app/babylon/model/data/model-data/model-data-facility.ts index aa080af..9cd43be 100644 --- a/src/app/babylon/model/data/model-data/model-data-facility.ts +++ b/src/app/babylon/model/data/model-data/model-data-facility.ts @@ -181,6 +181,10 @@ export enum FacilityType { * 干粉灭火器 - 36kg(手推) */ XF_MHQ_GF_35 = "XF_MHQ_GF_35", + /** + * 干粉灭火器 - 36kg(手推) + */ + XF_MHQ_GF_25 = "XF_MHQ_GF_25", /** * 灭火毯 */ diff --git a/src/app/babylon/tool/speaking-tool.ts b/src/app/babylon/tool/speaking-tool.ts index eb33fd5..2516888 100644 --- a/src/app/babylon/tool/speaking-tool.ts +++ b/src/app/babylon/tool/speaking-tool.ts @@ -20,6 +20,7 @@ export class SpeakingTool { * @param msg */ speak(msg: string) { + console.log("阅读" + msg); if (this.isIE()) { } diff --git a/src/app/babylon/view/facility-window/facility-window.ts b/src/app/babylon/view/facility-window/facility-window.ts index 619f341..bce8d59 100644 --- a/src/app/babylon/view/facility-window/facility-window.ts +++ b/src/app/babylon/view/facility-window/facility-window.ts @@ -577,6 +577,9 @@ export class FacilityWindow extends UIBase { else if (TsTool.stringContain(mesh.name, FacilityType.XF_MHQ_GF_8)) { this.createNewFacilityByMesh(mesh, FacilityType.XF_MHQ_GF_8); } + else if (TsTool.stringContain(mesh.name, FacilityType.XF_MHQ_GF_25)) { + this.createNewFacilityByMesh(mesh, FacilityType.XF_MHQ_GF_25); + } else if (TsTool.stringContain(mesh.name, FacilityType.XF_MHQ_GF_35)) { this.createNewFacilityByMesh(mesh, FacilityType.XF_MHQ_GF_35); } 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/left-domain/left-domain.component.html b/src/app/pages/left-domain/left-domain.component.html index 37a8d9f..9c4dca5 100644 --- a/src/app/pages/left-domain/left-domain.component.html +++ b/src/app/pages/left-domain/left-domain.component.html @@ -157,12 +157,12 @@ - +
预案/节点名称 - +
diff --git a/src/app/pages/left-domain/left-domain.component.ts b/src/app/pages/left-domain/left-domain.component.ts index 58efc2c..0de4d11 100644 --- a/src/app/pages/left-domain/left-domain.component.ts +++ b/src/app/pages/left-domain/left-domain.component.ts @@ -213,6 +213,8 @@ export class LeftDomainComponent implements OnInit { if (!MarkWindow.instance.currentMarkNodeInfo) { //未选中节点 PlanComponent.instance.beforeEmergencyPlan = item PlanComponent.instance.beforePlanNode = e + PlanComponent.instance.nzCurrent = -1 + PlanComponent.instance.timer? window.clearTimeout(PlanComponent.instance.timer) : null //清除定时器 this.selectPlanId = item.id this.selectNodeId = e.id MarkWindow.instance.selectMarkNode(item.id, e.id) @@ -224,6 +226,8 @@ export class LeftDomainComponent implements OnInit { if (isTrue) { PlanComponent.instance.beforeEmergencyPlan = item PlanComponent.instance.beforePlanNode = e + PlanComponent.instance.nzCurrent = -1 + PlanComponent.instance.timer? window.clearTimeout(PlanComponent.instance.timer) : null //清除定时器 this.selectPlanId = item.id this.selectNodeId = e.id MarkWindow.instance.selectMarkNode(item.id, e.id) @@ -235,8 +239,10 @@ export class LeftDomainComponent implements OnInit { isTrue = confirm('切换节点后,没保存的信息将会丢失!') } if (isTrue) { - PlanComponent.instance.beforeEmergencyPlan = null - PlanComponent.instance.beforePlanNode = null + PlanComponent.instance.beforeEmergencyPlan = new MarkPlanData(-99, "请选择节点") + PlanComponent.instance.beforePlanNode = new MarkNodeData(-99, "请选择节点") + PlanComponent.instance.nzCurrent = -1 + PlanComponent.instance.timer? window.clearTimeout(PlanComponent.instance.timer) : null //清除定时器 this.selectPlanId = null this.selectNodeId = null MarkWindow.instance.selectMarkNode(null, null) diff --git a/src/app/pages/plan/plan.component.html b/src/app/pages/plan/plan.component.html index e19ccfb..0217cb3 100644 --- a/src/app/pages/plan/plan.component.html +++ b/src/app/pages/plan/plan.component.html @@ -143,33 +143,35 @@
-

灾情描述

- +

+
- +
diff --git a/src/app/pages/plan/plan.component.scss b/src/app/pages/plan/plan.component.scss index 4dcc908..de97d92 100644 --- a/src/app/pages/plan/plan.component.scss +++ b/src/app/pages/plan/plan.component.scss @@ -332,6 +332,7 @@ flex: 1; font-size: 14px; p{ margin: 0; height: 20px; line-height: 18px; } + input{ border: none; outline: none; background-color: transparent; width: 100%; height: 100%; } textarea{ width: 100%; height: 50px; background: rgba(145, 204, 255, 0.41); border: 1px solid #91CCFF; padding: 0; resize: none; outline: none; } } .planHeaderImg{ width: 100px; height: 100%; text-align: center; } @@ -359,7 +360,12 @@ border: 1px solid rgba(35, 217, 255, 0.4); } } - label:nth-child(2){ flex: 1; overflow: hidden; img{ height: 35px; width: auto; vertical-align: top; } } + label:nth-child(2){ + flex: 1; + overflow: hidden; + //.anticon{ font-size: 16px; color: #23D9FF; } + img{ height: 35px; width: auto; vertical-align: top; } + } label:last-child{ width: 15%; height: 100%; diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts index 8741d4b..73877d9 100644 --- a/src/app/pages/plan/plan.component.ts +++ b/src/app/pages/plan/plan.component.ts @@ -69,27 +69,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 +106,6 @@ export class PlanComponent implements OnInit { //this.modelInit(data) //开发模式 选择单位 弹窗 } } - //}); } ngOnDestroy(): void { //组件销毁前 销毁canvas @@ -128,6 +130,9 @@ export class PlanComponent implements OnInit { let fenceType: JYZInfoMoudleType = this.getFenceType(type) this.isShowNature = false //隐藏属性栏 if (this.selectFence != type) { + if (this.selectFence === 7) { //初始化 应急预案模块 + this.initializePlan() + } this.isShowChildComponent && this.leftDomain && type != 4 ? this.leftDomain.initComponent(type) : null; //手动初始化子组件 this.selectFence = type this.isShowChildComponent = true @@ -136,6 +141,9 @@ export class PlanComponent implements OnInit { this.selectFence = -1 this.isShowChildComponent = false buildingWindow.changeJYZInfoModel(fenceType, false) + if (type === 7) { //初始化 应急预案模块 + this.initializePlan() + } } } @@ -326,8 +334,134 @@ export class PlanComponent implements OnInit { } allMarkPlanData: AllMarkPlanData; //处置预案节点 数据 - beforeEmergencyPlan: MarkPlanData = null; //当前选择 应急预案 - beforePlanNode: MarkNodeData = null; //当前选择 预案节点 + beforeEmergencyPlan: MarkPlanData = new MarkPlanData(-99, "请选择节点"); //当前选择 应急预案 + beforePlanNode: MarkNodeData = new MarkNodeData(-99, "请选择节点"); //当前选择 预案节点 + nzCurrent: number = -1; //当前选择 预案节点Index + isSuspend: boolean = false; //是否暂停 自动切换节点 + timer: any; //定时器 + + //初始化 应急预案模块 + initializePlan() { + this.beforeEmergencyPlan = new MarkPlanData(-99, "请选择节点") + this.beforePlanNode = new MarkNodeData(-99, "请选择节点") + this.isSuspend = false //初始化暂停状态 + window.clearTimeout(this.timer) //清除定时器 + } + + //公用 切换选中节点 + publicToggleNode() { + this.beforePlanNode = this.beforeEmergencyPlan.nodes[this.nzCurrent] + this.leftDomain.selectPlanId = this.beforeEmergencyPlan.id + this.leftDomain.selectNodeId = this.beforePlanNode.id + MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id, false, true) + } + + //选中 底部一级节点 开启自动播放 + selectChildNode(item: MarkPlanData) { + if (this.isShowChildComponent && this.leftDomain) { + if (item.nodes.length) { + let isTrue = confirm("即将开始播放节点") + if (isTrue) { + this.timer? window.clearTimeout(this.timer) : null //清除定时器 + this.nzCurrent = 0 + this.beforeEmergencyPlan = item + this.publicToggleNode() + !this.isSuspend? this.autoPlay() : null + } + } else { + this.message.info('暂无数据节点'); + } + } + } + + //自动播放-切换接点 + autoPlay() { + if (this.nzCurrent >= this.beforeEmergencyPlan.nodes.length - 1) { + this.nzCurrent = this.nzCurrent + 1 + this.isSuspend = false //初始化暂停状态 + window.clearTimeout(this.timer) //清除定时器 + this.message.info('已播放至最后一节点'); + return + } + let time: number = this.beforePlanNode.getShowTime() + console.log(`所需${time}s`) + this.timer = window.setTimeout(()=>{ + this.nzCurrent = this.nzCurrent + 1 + this.publicToggleNode() + !this.isSuspend? this.autoPlay() : null + },time * 1000) + } + + //切换预案节点 + changePlanNode(event){ + if (event === this.beforeEmergencyPlan.nodes.length) { + return + } + this.timer? window.clearTimeout(this.timer) : null //清除定时器 + this.nzCurrent = event + this.publicToggleNode() + } + + //切换预案节点 上一个 + toLast() { + if (this.beforeEmergencyPlan.id === -99 || this.beforePlanNode.id === -99) { + this.message.info('请选择节点'); + return + } + if (this.nzCurrent <= 0) { + this.message.info('目前已经是第一节点'); + return + } + this.timer? window.clearTimeout(this.timer) : null //清除定时器 + this.nzCurrent = this.nzCurrent - 1 + this.publicToggleNode() + !this.isSuspend? this.autoPlay() : null + } + + //切换预案节点 暂停 + suspend(isSuspend: boolean) { + if (this.beforeEmergencyPlan.id === -99 || this.beforePlanNode.id === -99) { + this.message.info('请选择节点'); + return + } + this.isSuspend = isSuspend + let msg: string = this.isSuspend? "目前已暂停" : "目前已开始播放" + this.message.info(msg); + if (this.isSuspend) { //暂停 + window.clearTimeout(this.timer) //清除定时器 + } else { //开启 + MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id, false, true) + this.autoPlay() + } + } + + //切换预案节点 初始化 + initialize() { + if (this.beforeEmergencyPlan.id === -99 || this.beforePlanNode.id === -99) { + this.message.info('请选择节点'); + return + } + this.timer? window.clearTimeout(this.timer) : null //清除定时器 + this.nzCurrent = 0 + this.publicToggleNode() + !this.isSuspend? this.autoPlay() : null + } + + //切换预案节点 下一个 + toNext() { + if (this.beforeEmergencyPlan.id === -99 || this.beforePlanNode.id === -99) { + this.message.info('请选择节点'); + return + } + if (this.nzCurrent >= this.beforeEmergencyPlan.nodes.length - 1) { + this.message.info('目前已经是最后一个节点'); + return + } + this.timer? window.clearTimeout(this.timer) : null //清除定时器 + this.nzCurrent = this.nzCurrent + 1 + this.publicToggleNode() + !this.isSuspend? this.autoPlay() : null + } //选中应急预案 设备 selectSandTableMark(markData: MarkData, select: boolean) { 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/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/facility/in/XF_MHQ_GF_25.png b/src/assets/images/facility/in/XF_MHQ_GF_25.png new file mode 100644 index 0000000..1814a11 Binary files /dev/null and b/src/assets/images/facility/in/XF_MHQ_GF_25.png differ 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 diff --git a/src/styles.scss b/src/styles.scss index 79eb5e9..500789c 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -136,6 +136,8 @@ h1 { .ant-collapse-arrow{ left: 5px; } //可展开面板 } + .ant-steps-dot .ant-steps-item-tail, .ant-steps-dot.ant-steps-small .ant-steps-item-tail{ top: 15px; } //步骤条 + //滚动条样式 ::-webkit-scrollbar { width: 5px;