diff --git a/src/app/babylon/controller/inputController.ts b/src/app/babylon/controller/inputController.ts index 35b8b0e..3fea861 100644 --- a/src/app/babylon/controller/inputController.ts +++ b/src/app/babylon/controller/inputController.ts @@ -1304,8 +1304,11 @@ export class Keyboard { private constructor() { // 添加快捷键 document.addEventListener('keydown', (e: KeyboardEvent) => { + if (e.key == null) { + return; + } let key = e.key.toLocaleLowerCase(); - console.log(key); + // console.log(key); if (key == "w" && e.shiftKey) { this.W = true; } else if (key == "w") { diff --git a/src/app/babylon/controller/mode-manager.ts b/src/app/babylon/controller/mode-manager.ts index 4f3c9fd..27cb259 100644 --- a/src/app/babylon/controller/mode-manager.ts +++ b/src/app/babylon/controller/mode-manager.ts @@ -23,12 +23,12 @@ export class ModeManager { /** * 制作模式代表内部编辑人员,可新增单位、上传模型,查看模式代表交付的模式 */ - public static s_isMakeMode = true; + public static s_isMakeMode = false; /** * 调试模式 */ - public static isDebug = true; + public static isDebug = false; @@ -63,7 +63,7 @@ export class ModeManager { */ static set currentMode(modeType: ModeType) { ModeManager.s_currentMode = modeType; - ModeManager.log("currentMode" + modeType); + } //封装打印 diff --git a/src/app/babylon/controller/scene-manager.ts b/src/app/babylon/controller/scene-manager.ts index 9586ce5..9a3fc03 100644 --- a/src/app/babylon/controller/scene-manager.ts +++ b/src/app/babylon/controller/scene-manager.ts @@ -58,6 +58,7 @@ import { MarkData_multiArrow_CT, MarkData_multiArrow_JG } from '../model/data/ma import { ModelInfo_mark_multiArrow } from '../model/info/mark/other/mark-plan-multi-arrow'; import { ModelInfo_mark_particle } from '../model/info/mark/other/mark-plan-particle-info'; import { FacilityPosType, ModelData_facility } from '../model/data/model-data/model-data-facility'; +import { LoadTool } from '../tool/load-tool'; //场景管理器 export class SceneManager { @@ -556,7 +557,7 @@ export class SceneManager { } SceneManager.endLoadMesh(modelData.resPath, modelData.resName); let box = SceneManager.importMeshSuccess(newMeshes, particleSystems, skeletons, animationGroups, modelInfo, needBox, modelData); - console.log("加载模型完成", modelData.resName); + //console.log("加载模型完成", modelData.resName); onSuccess(newMeshes, box, modelInfo); }, null, function (scene: Scene, message: string, exception?: any) { @@ -568,14 +569,14 @@ export class SceneManager { SceneManager.createModel(modelType, modelData, needBox, isNew, tag, onSuccess, onError, l_index); - console.log("重新开始加载" + l_index, modelData); + //console.log("重新开始加载" + l_index, modelData); console.log(exception); } else { modelInfo.dispose(); - console.log(message); - console.log(exception); - // alert("模型加载失败: " + message + "==" + exception); + LoadTool.remove(modelData.resPath + modelData.resName); + console.log(message, exception); + alert("模型加载失败,请刷新页面重试: " + message + "==" + exception); // alert(exception); if (onError) { onError(message) diff --git a/src/app/babylon/controller/serve-manager.ts b/src/app/babylon/controller/serve-manager.ts index 90cd9ea..b0e2e72 100644 --- a/src/app/babylon/controller/serve-manager.ts +++ b/src/app/babylon/controller/serve-manager.ts @@ -53,7 +53,7 @@ export class ServeManager { let l_data = classToPlain(institutionData); console.log("保存单位", l_data); - this.buildingBISrv.postBuildingBasicInfos(key, l_data) + this.buildingBISrv.postBuildingBasicInfos(key, 1, l_data) .subscribe(data => { console.log("保存单位成功:" + key, l_data); if (onSuccess) { diff --git a/src/app/babylon/controller/status/status-manager.ts b/src/app/babylon/controller/status/status-manager.ts index bb85945..642d7cb 100644 --- a/src/app/babylon/controller/status/status-manager.ts +++ b/src/app/babylon/controller/status/status-manager.ts @@ -54,6 +54,11 @@ export class StatusManager { newStatus.onEnter(); return newStatus; } + + static dispose() { + StatusManager.s_allStatus = []; + StatusManager.s_currentStatus = null; + } } diff --git a/src/app/babylon/game.ts b/src/app/babylon/game.ts index c331dd7..ac79b57 100644 --- a/src/app/babylon/game.ts +++ b/src/app/babylon/game.ts @@ -54,6 +54,7 @@ export class Game { dispose() { SceneManager.Instance.dispose(); + StatusManager.dispose(); this.scene.dispose() this.scene = null; this.engine.dispose(); diff --git a/src/app/babylon/tool/gizmo-tool.ts b/src/app/babylon/tool/gizmo-tool.ts index 632c872..d407671 100644 --- a/src/app/babylon/tool/gizmo-tool.ts +++ b/src/app/babylon/tool/gizmo-tool.ts @@ -83,6 +83,10 @@ export class GizmoTool { GizmoTool.onTransformUITypeChange(TransformUIType.Hide); } + static dispose() { + + } + static onBeforeRender( eventData: Scene, eventState: EventState @@ -195,7 +199,6 @@ export class GizmoTool { //改变Gizmo目标 static changeGizmoAim(mesh: AbstractMesh, x: boolean = true, y = true, z = true) { - GizmoTool.s_nowPickAim_mesh = mesh; GizmoTool.s_gizmoManager.attachToMesh(mesh); GizmoTool.s_gizmoManager.gizmos.positionGizmo.xGizmo.isEnabled = x; @@ -427,6 +430,7 @@ export class GizmoTool { if (uiType == TransformUIType.Hide || !ModeManager.s_isMakeMode) { //隐藏选中框 GizmoTool.s_boundingBoxGizmo.attachedMesh = null; + } } diff --git a/src/app/babylon/tool/load-tool.ts b/src/app/babylon/tool/load-tool.ts index d135607..a92efea 100644 --- a/src/app/babylon/tool/load-tool.ts +++ b/src/app/babylon/tool/load-tool.ts @@ -1,3 +1,4 @@ +import { PlanComponent } from "src/app/pages/plan/plan.component"; /** * 加载管理器 @@ -49,16 +50,16 @@ export class LoadTool { * 开始加载 */ static onStart() { - console.log("开始加载"); - //ThreeDimensionalHomeComponent.instance.maskLayerService.sendMessage(true) + // console.log("开始加载"); + PlanComponent.instance.showLoading(true); } /** * 全部加载结束 */ static onEnd() { - console.log("结束加载"); - //ThreeDimensionalHomeComponent.instance.maskLayerService.sendMessage(false) + // console.log("结束加载"); + PlanComponent.instance.showLoading(false); } } \ No newline at end of file diff --git a/src/app/babylon/view/building-window/building-ui-item.ts b/src/app/babylon/view/building-window/building-ui-item.ts index d7ab98e..53b3f47 100644 --- a/src/app/babylon/view/building-window/building-ui-item.ts +++ b/src/app/babylon/view/building-window/building-ui-item.ts @@ -3,6 +3,7 @@ import { AbstractMesh, Mesh, TransformNode } from "@babylonjs/core"; import { ConfigManager } from "../../controller/config-manager"; import { InfoManager } from "../../controller/info-manager"; +import { ModeManager, ModeType } from "../../controller/mode-manager"; import { SceneManager } from "../../controller/scene-manager"; import { IndoorStatus } from "../../controller/status/indoor-status"; import { StatusManager } from "../../controller/status/status-manager"; @@ -161,7 +162,7 @@ export class BuildingUIItem { */ onSelect(select: boolean, animMove = true) { if (select) { - if (this.buildingInfo.ModelInfo != null && this.buildingInfo.ModelInfo.modelBox != null) { + if (this.buildingInfo.ModelInfo != null && this.buildingInfo.ModelInfo.modelBox != null && ModeManager.currentMode == ModeType.Edit) { GizmoTool.onPickMeshInfoObservable.notifyObservers(this.buildingInfo.ModelInfo); //BabylonTool.changeCameraTarget(SceneManager.Instance.defaultCamera, this.buildingInfo.ModelInfo.modelBox, animMove); } diff --git a/src/app/babylon/view/building-window/building-window.ts b/src/app/babylon/view/building-window/building-window.ts index 485c347..94c793e 100644 --- a/src/app/babylon/view/building-window/building-window.ts +++ b/src/app/babylon/view/building-window/building-window.ts @@ -128,7 +128,7 @@ export class BuildingWindow extends UIBase { file.push(manifestFile); //临时关闭缓存文件 } - + PlanComponent.instance.showLoading(true); ServeManager.instance.uploadFile(0, file, resPath_out, (name: string, path: string, currentfile) => { if (TsTool.stringContain(name, ".gltf")) { if (TsTool.stringContain(name, ".gltf.manifest")) { @@ -150,6 +150,7 @@ export class BuildingWindow extends UIBase { } } , () => { + PlanComponent.instance.showLoading(false); let buildingInfo = buildingWindow.getBuildingInfo(buildingData.normalData.key); buildingWindow.updateBuildingModel(buildingInfo, true); // buildingWindow.three = ThreeDimensionalHomeComponent.instance; @@ -372,7 +373,7 @@ export class BuildingWindow extends UIBase { } } - console.log("选中建筑", modelInfo); + // console.log("选中建筑", modelInfo); this.showJYZModules(JYZInfoMoudleType.AQSS, false); this.showJYZModules(JYZInfoMoudleType.YQHSGX, false); this.showJYZModules(JYZInfoMoudleType.YQHSGX, false); @@ -506,7 +507,7 @@ export class BuildingWindow extends UIBase { if (firstType == BuildingType.Environment) { instance.createOneBuildingItem(firstItem, 0, (uiItem, index) => { instance.onChangeCurrentBuildingItem(uiItem, false); - uiItem.lookAt(false); + // uiItem.lookAt(false); if (buildingDatas_Environment.length > 1) { instance.addBuildings(BuildingType.Environment, 1); } @@ -519,7 +520,7 @@ export class BuildingWindow extends UIBase { else { instance.createOneBuildingItem(firstItem, 0, (uiItem, index) => { instance.onChangeCurrentBuildingItem(uiItem, false); - uiItem.lookAt(false); + // uiItem.lookAt(false); if (buildingDatas_mormal.length > 1) { instance.addBuildings(BuildingType.Normal, 1); } diff --git a/src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts b/src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts index 49ff7d9..bc28516 100644 --- a/src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts +++ b/src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts @@ -178,31 +178,31 @@ export class FacilityInfoInSceneWindow extends UIBase { */ showFacilityByType(facilityType: FacilityType, show: boolean) { - if (ModeManager.currentMode == ModeType.Look) { - for (let i = 0; i < this.facilityInfoUIItemes.length; i++) { - let l_facilityData = (this.facilityInfoUIItemes[i].modelInfo.modelData) as ModelData_facility; - if (facilityType == null || facilityType == l_facilityData.facilityType) { - this.facilityInfoUIItemes[i].modelInfo.setEnable(show); - } - else if (show) { - this.facilityInfoUIItemes[i].modelInfo.setEnable(false); - } - } - // for (let i = 0; i < this.facilityInfoUIItemes.length; i++) { - // let l_facilityData = (this.facilityInfoUIItemes[i].modelInfo.modelData) as ModelData_facility; - // if (facilityType == null || facilityType == l_facilityData.facilityType) { - // this.facilityInfoUIItemes[i].modelInfo.setIconEnable(show); - // } - // } - } - else { - for (let i = 0; i < this.facilityInfoUIItemes.length; i++) { - let l_facilityData = (this.facilityInfoUIItemes[i].modelInfo.modelData) as ModelData_facility; - if (facilityType == null || facilityType == l_facilityData.facilityType) { - this.facilityInfoUIItemes[i].modelInfo.setIconEnable(show); - } + // if (ModeManager.currentMode == ModeType.Look) { + // for (let i = 0; i < this.facilityInfoUIItemes.length; i++) { + // let l_facilityData = (this.facilityInfoUIItemes[i].modelInfo.modelData) as ModelData_facility; + // if (facilityType == null || facilityType == l_facilityData.facilityType) { + // this.facilityInfoUIItemes[i].modelInfo.setEnable(show); + // } + // else if (show) { + // this.facilityInfoUIItemes[i].modelInfo.setEnable(false); + // } + // } + // // for (let i = 0; i < this.facilityInfoUIItemes.length; i++) { + // // let l_facilityData = (this.facilityInfoUIItemes[i].modelInfo.modelData) as ModelData_facility; + // // if (facilityType == null || facilityType == l_facilityData.facilityType) { + // // this.facilityInfoUIItemes[i].modelInfo.setIconEnable(show); + // // } + // // } + // } + // else { + for (let i = 0; i < this.facilityInfoUIItemes.length; i++) { + let l_facilityData = (this.facilityInfoUIItemes[i].modelInfo.modelData) as ModelData_facility; + if (facilityType == null || facilityType == l_facilityData.facilityType) { + this.facilityInfoUIItemes[i].modelInfo.setIconEnable(show); } } + // } } @@ -483,7 +483,6 @@ export class FacilityInfoInSceneWindow extends UIBase { if (this.currentSelectJYJInfo != null) { let facilityItem: FacilityInfoUIItem = FacilityInfoInSceneWindow.instance.getFacilityItem(this.currentSelectJYJInfo); facilityItem.onSelect(false); - // this.playJYJSelectEffect(false, this.currentSelectJYJInfo); this.currentSelectJYJInfo = null; } @@ -496,8 +495,6 @@ export class FacilityInfoInSceneWindow extends UIBase { try { let facilityInfosByType = BuildingWindow.instance.currentBuidngItem.buildingInfo.ModelInfo.facilityInfos; - - for (let i = 0; i < facilityInfosByType.length; i++) { if ((currentMoudle == null || currentMoudle == JYZInfoMoudleType.JYJ) && facilityInfosByType[i].type == FacilityType.JY_JYJ || (currentMoudle == null || currentMoudle == JYZInfoMoudleType.YG) && facilityInfosByType[i].type == FacilityType.JY_YG) { @@ -519,28 +516,18 @@ export class FacilityInfoInSceneWindow extends UIBase { for (let j = 0; j < childMesh.length; j++) { if (pickInfo.pickedMesh == childMesh[j]) { result = allJYJInfo[i]; - console.log("通过点击,找到加油机了"); - break; } } } - if (result != null) { - - //this.playJYJSelectEffect(true, result); - if ((result.modelData as ModelData_facility).facilityType == FacilityType.JY_JYJ && currentMoudle == null) { PlanComponent.instance.toggleHeaderFence(1);//在空状态下,点击加油机,跳转到加油机页签 } let facilityItem: FacilityInfoUIItem = FacilityInfoInSceneWindow.instance.getFacilityItem(result); - console.log("场景中选中设备", facilityItem); //通知前端 this.selectFacilityItem(facilityItem); - // facilityItem.onSelect(true); - //FacilityInfoInSceneWindow.instance.selectFacilityItemToThree([facilityItem], true); - //console.log(facilityItem.getHeadUIPos()); } } diff --git a/src/app/babylon/view/mark-window/mark-window.ts b/src/app/babylon/view/mark-window/mark-window.ts index 3143d2e..e82d75e 100644 --- a/src/app/babylon/view/mark-window/mark-window.ts +++ b/src/app/babylon/view/mark-window/mark-window.ts @@ -189,6 +189,7 @@ export class MarkWindow extends UIBase { * 开启界面 */ static openWindow(): MarkWindow { + console.log("进入沙盘"); if (MarkWindow.instance == null) { SceneManager.s_markWindow = UIManager.open(MarkWindow); } diff --git a/src/app/pages/left-domain/left-domain.component.ts b/src/app/pages/left-domain/left-domain.component.ts index c00ffb3..f0014c3 100644 --- a/src/app/pages/left-domain/left-domain.component.ts +++ b/src/app/pages/left-domain/left-domain.component.ts @@ -10,11 +10,12 @@ import { Event_GetAllMarkPlanData } from 'src/app/babylon/controller/event-manag import { AllMarkPlanData, MarkNodeData, MarkPlanData } from 'src/app/babylon/model/data/mark/mark-plan-data'; import { MarkWindow } from 'src/app/babylon/view/mark-window/mark-window'; import { NzMessageService } from 'ng-zorro-antd/message'; +import { ModeManager, ModeType } from 'src/app/babylon/controller/mode-manager'; @Component({ selector: 'app-left-domain', templateUrl: './left-domain.component.html', - styleUrls: ['./left-domain.component.scss','../plan/publicPop.scss'] + styleUrls: ['./left-domain.component.scss', '../plan/publicPop.scss'] }) export class LeftDomainComponent implements OnInit { @@ -49,24 +50,24 @@ export class LeftDomainComponent implements OnInit { //处理 设备data handleFacility() { if (this.beforeFence === 7) { //应急预案 - MarkWindow.instance? this.allMarkPlanData= MarkWindow.instance.allMarkPlanData : null - EventManager.addListener(Event_GetAllMarkPlanData, (data: Event_GetAllMarkPlanData)=>{ + MarkWindow.instance ? this.allMarkPlanData = MarkWindow.instance.allMarkPlanData : null + EventManager.addListener(Event_GetAllMarkPlanData, (data: Event_GetAllMarkPlanData) => { this.allMarkPlanData = data.data }) return } let list: FacilityInfoUIItem[] = [] - FacilityInfoInSceneWindow.instance.facilityInfoUIItemes.forEach(item=>{ + FacilityInfoInSceneWindow.instance.facilityInfoUIItemes.forEach(item => { if (this.beforeFence === 1) { //加油机 - item.getType() === "JY_JYJ"? list.push(item) : null + item.getType() === "JY_JYJ" ? list.push(item) : null } else if (this.beforeFence === 2) { //油罐设备 - item.getType() === "JY_YG"? list.push(item) : null + item.getType() === "JY_YG" ? list.push(item) : null } else if (this.beforeFence === 3) { //消防设施 - (item.getType()).slice(0,3) === "XF_"? list.push(item) : null + (item.getType()).slice(0, 3) === "XF_" ? list.push(item) : null } else if (this.beforeFence === 5) { //输油管线 - item.getType() === "JY_SYGX"? list.push(item) : null - }else if (this.beforeFence === 6) { //油气回收 - item.getType() === "JY_YQHSGX"? list.push(item) : null + item.getType() === "JY_SYGX" ? list.push(item) : null + } else if (this.beforeFence === 6) { //油气回收 + item.getType() === "JY_YQHSGX" ? list.push(item) : null } }) this.FacilityList = list @@ -93,8 +94,8 @@ export class LeftDomainComponent implements OnInit { //处理 treeData handleTreeData(list: FacilityInfoUIItem[]) { this.treeData = [] - list.forEach(item=>{ - let isFind = this.treeData.find(element=>{ return (item.getType()).includes(element.key) }) + list.forEach(item => { + let isFind = this.treeData.find(element => { return (item.getType()).includes(element.key) }) if (!isFind) { //不存在 if (item.getType().includes('XF_MHQ')) { //灭火器 let primaryNode = { title: '灭火器', key: 'XF_MHQ', selectable: false, expanded: true, children: [], } @@ -106,7 +107,7 @@ export class LeftDomainComponent implements OnInit { this.treeData.push(primaryNode) } } else { //存在 - if (item.getType().includes('XF_MHQ') && !isFind.children.find(elements=>{ return elements.key === item.getType() })) { //灭火器 + if (item.getType().includes('XF_MHQ') && !isFind.children.find(elements => { return elements.key === item.getType() })) { //灭火器 let treeNode = { title: ConfigManager.getFacilityTypeName(item.getType()), key: item.getType(), selectable: false, } isFind.children.push(treeNode) } @@ -120,8 +121,8 @@ export class LeftDomainComponent implements OnInit { this.treeData.push(primaryNode) } for (let facility in FacilityType) { - if (facility.slice(0,3) === "XF_" && !facility.includes('XF_MHQ')) { - let isFind = this.treeData.find(item=>{ return item.key === facility }) + if (facility.slice(0, 3) === "XF_" && !facility.includes('XF_MHQ')) { + let isFind = this.treeData.find(item => { return item.key === facility }) if (!isFind) { let primaryNode = { title: ConfigManager.getFacilityTypeName(FacilityType[facility]), key: facility, selectable: false, } this.treeData.push(primaryNode) @@ -135,8 +136,8 @@ export class LeftDomainComponent implements OnInit { //获取设备 数量 getFacilityNum(type: string): number { let num = 0 - this.FacilityList.forEach(item=>{ - item.getType().includes(type)? num = num + 1 : null + this.FacilityList.forEach(item => { + item.getType().includes(type) ? num = num + 1 : null }) return num } @@ -149,11 +150,11 @@ export class LeftDomainComponent implements OnInit { FacilityInfoInSceneWindow.instance.showFacilityByType(null, false) FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[event.node.key], event.node.isSelected) } else { //显示所有 - this.treeData.forEach(item=>{ + this.treeData.forEach(item => { if (item.key != 'XF_MHQ') { FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[item.key], true) } else { - item.children.forEach(element=>{ FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[element.key], true) }) + item.children.forEach(element => { FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[element.key], true) }) } }) } @@ -172,7 +173,7 @@ export class LeftDomainComponent implements OnInit { MarkWindow.instance.createMarkPlaneData(e.name) this.addDisposalPop = false } else { //创建节点 - MarkWindow.instance.createMarkNodeData(this.addNodePop,e.name) + MarkWindow.instance.createMarkNodeData(this.addNodePop, e.name) this.addNodePop = null } } @@ -195,21 +196,28 @@ export class LeftDomainComponent implements OnInit { if (!MarkWindow.instance.currentMarkNodeInfo) { //未选中节点 this.selectPlanId = item.id this.selectNodeId = e.id - MarkWindow.instance.selectMarkNode(item.id,e.id) + MarkWindow.instance.selectMarkNode(item.id, e.id) } else { //已选中节点 - let isTrue = confirm('切换节点后,没保存的信息将会丢失!') + let isTrue = true; + if (ModeManager.currentMode == ModeType.Edit) { + isTrue = confirm('切换节点后,没保存的信息将会丢失!') + } + if (isTrue) { this.selectPlanId = item.id this.selectNodeId = e.id - MarkWindow.instance.selectMarkNode(item.id,e.id) + MarkWindow.instance.selectMarkNode(item.id, e.id) } } } else if (this.selectPlanId === item.id && this.selectNodeId === e.id) { //取消选中 - let isTrue = confirm('切换节点后,没保存的信息将会丢失!') + let isTrue = true; + if (ModeManager.currentMode == ModeType.Edit) { + isTrue = confirm('切换节点后,没保存的信息将会丢失!') + } if (isTrue) { this.selectPlanId = null this.selectNodeId = null - MarkWindow.instance.selectMarkNode(null,null) + MarkWindow.instance.selectMarkNode(null, null) } } } @@ -228,10 +236,10 @@ export class LeftDomainComponent implements OnInit { this.saveDisposalDialog = true } else { if (this.selectPlanId === markPlanId && this.selectNodeId === nodeId) { - MarkWindow.instance.saveToOldNode(markPlanId,nodeId) + MarkWindow.instance.saveToOldNode(markPlanId, nodeId) } else { let isTrue = confirm('是否覆盖要保存的节点?') - isTrue? MarkWindow.instance.saveToOldNode(markPlanId,nodeId) : null + isTrue ? MarkWindow.instance.saveToOldNode(markPlanId, nodeId) : null } } } @@ -246,7 +254,7 @@ export class LeftDomainComponent implements OnInit { this.saveType = 2 this.allNodeList = [] MarkWindow.instance.allMarkPlanData.datas.forEach(item => { - item.nodes.forEach(element=>{ + item.nodes.forEach(element => { let node = { id: element.id, parrentId: item.id, @@ -265,14 +273,14 @@ export class LeftDomainComponent implements OnInit { this.message.info('请完善表单') return } - MarkWindow.instance.createNewNodeAndSave(e.root.id,e.name) + MarkWindow.instance.createNewNodeAndSave(e.root.id, e.name) this.saveType = null } else { //保存到已有节点 if (!e.node) { this.message.info('请完善表单') return } - MarkWindow.instance.saveToOldNode(e.node.parrentId,e.node.id) + MarkWindow.instance.saveToOldNode(e.node.parrentId, e.node.id) this.saveType = null } } diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts index b3e8b17..63f9f7d 100644 --- a/src/app/pages/plan/plan.component.ts +++ b/src/app/pages/plan/plan.component.ts @@ -77,9 +77,9 @@ export class PlanComponent implements OnInit { this.beforeOneSatus = StatusManager.getStatus(LoginSatus); this.beforeOneSatus.onSelectInsSuccess(find) } else { //如果没有找到对应的单位key,则调用新建单位 - let isAdd = confirm('没有单位name,是否进行初始化?') + let isAdd = confirm('没有单位' + key + ',是否进行初始化?') if (isAdd) { - let name = 'ceshi'; + let name = key; loginStatus.createInsitution(key, name); } } @@ -375,14 +375,21 @@ export class PlanComponent implements OnInit { this.message.info(title); } + /** + * 展示加载遮罩 + * @param show + */ + showLoading(show: boolean) { + this.isShowLoading = show; + } } // 处置预案 所有图标 export class planIcons { - iconsName: string[] = ["灾情","内部力量","外部力量","其他"] - icons: MarkData[][] = [AllMarkData.CreateAllMarkData().marks_Disaster,AllMarkData.CreateAllMarkData().marks_Inside,AllMarkData.CreateAllMarkData().marks_Outside,AllMarkData.CreateAllMarkData().marks_Other,] + iconsName: string[] = ["灾情", "内部力量", "外部力量", "其他"] + icons: MarkData[][] = [AllMarkData.CreateAllMarkData().marks_Disaster, AllMarkData.CreateAllMarkData().marks_Inside, AllMarkData.CreateAllMarkData().marks_Outside, AllMarkData.CreateAllMarkData().marks_Other,] } //创建/编辑 建筑dataType export class modelBuilding { diff --git a/src/app/service/babylon/building-basic-infos.service.ts b/src/app/service/babylon/building-basic-infos.service.ts index 8245839..61f8e45 100644 --- a/src/app/service/babylon/building-basic-infos.service.ts +++ b/src/app/service/babylon/building-basic-infos.service.ts @@ -35,8 +35,8 @@ export class BuildingBasicInfosService { * @param name * @param data */ - postBuildingBasicInfos(name: string, data: object): Observable { - return this.postInfos(this.api_buildingInfo, name, data); + postBuildingBasicInfos(name: string, gasstationId: number, data: object): Observable { + return this.postInfos(this.api_buildingInfo, data, { name: name, gasstationId: gasstationId }); } /** @@ -53,7 +53,7 @@ export class BuildingBasicInfosService { * @param data */ postMarkData(name: string, data: object): Observable { - return this.postInfos(this.api_sandBox, name, data); + return this.postInfos(this.api_sandBox, data, { name: name }); } @@ -92,14 +92,11 @@ export class BuildingBasicInfosService { * @param name * @param data */ - postInfos(api: string, name: string, data: object) { - let params = { - name: name, - }; + postInfos(api: string, body: object, params = {}) { let headers = this.headers; - return this.http.post(api + this.c_post, `'${JSON.stringify(data)}'`, { headers, params }) + return this.http.post(api + this.c_post, `'${JSON.stringify(body)}'`, { headers, params }) .pipe( catchError((err) => this.handleError(err)) );