邵佳豪 3 years ago
parent
commit
ca4b942b59
  1. 12
      src/app/babylon/controller/data-manager.ts
  2. 2
      src/app/babylon/controller/mode-manager.ts
  3. 23
      src/app/babylon/controller/serve-manager.ts
  4. 6
      src/app/babylon/controller/status/login-status.ts
  5. 2
      src/app/babylon/game.ts
  6. 11
      src/app/babylon/model/data/mark/mark-plan-data.ts
  7. 5
      src/app/babylon/model/info/mark/model-info-mark.ts
  8. 2
      src/app/babylon/model/info/mark/other/mark-plan-particle-info.ts
  9. 2
      src/app/babylon/model/info/model/model-info.ts
  10. 26
      src/app/babylon/tool/babylon-tool.ts
  11. 7
      src/app/babylon/tool/particle-system-tool.ts
  12. 2
      src/app/babylon/tool/speaking-tool.ts
  13. 37
      src/app/babylon/view/building-window/building-window.ts
  14. 7
      src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts
  15. 40
      src/app/babylon/view/mark-window/mark-window.ts
  16. 39
      src/app/pages/init3D.guard.ts
  17. 30
      src/app/pages/left-domain/left-domain.component.html
  18. 6
      src/app/pages/left-domain/left-domain.component.scss
  19. 36
      src/app/pages/left-domain/left-domain.component.ts
  20. 2
      src/app/pages/oil-station-info/oil-station-info.component.html
  21. 3
      src/app/pages/pages-routing.module.ts
  22. 28
      src/app/pages/plan/plan.component.html
  23. 19
      src/app/pages/plan/plan.component.scss
  24. 137
      src/app/pages/plan/plan.component.ts
  25. 19
      src/app/pages/plan/publicPop.scss
  26. 19
      src/app/service/babylon/building-basic-infos.service.ts
  27. 4
      src/app/service/objects.service.ts
  28. BIN
      src/assets/images/mark/disaster/dt.png
  29. BIN
      src/assets/images/mark/disaster/lyd.png
  30. BIN
      src/assets/images/mark/disaster/lyx.png
  31. BIN
      src/assets/images/mark/inside/jyy.png
  32. BIN
      src/assets/images/mark/inside/syy.png
  33. BIN
      src/assets/images/mark/inside/xfsd.png
  34. BIN
      src/assets/images/mark/inside/xfsq.png
  35. BIN
      src/assets/images/mark/inside/xyy.png
  36. BIN
      src/assets/images/mark/inside/ygc.png
  37. BIN
      src/assets/images/mark/inside/ygcsj.png
  38. BIN
      src/assets/images/mark/inside/zymbrq.png
  39. 5
      src/assets/mesh/mark/disaster/dt/DT.gltf.manifest
  40. 5
      src/assets/mesh/mark/disaster/lyd/LYD.gltf.manifest
  41. 5
      src/assets/mesh/mark/disaster/lyx/LYX.gltf.manifest
  42. 5
      src/assets/mesh/mark/disaster/sy/SY.gltf.manifest
  43. 5
      src/assets/mesh/mark/inside/gfmhq/GFMHQ.gltf.manifest
  44. 5
      src/assets/mesh/mark/inside/jyy/JYY.gltf.manifest
  45. 5
      src/assets/mesh/mark/inside/ptmhq/PTMHQ.gltf.manifest
  46. 5
      src/assets/mesh/mark/inside/syy/SYY.gltf.manifest
  47. 5
      src/assets/mesh/mark/inside/tcmhq/TCMHQ.gltf.manifest
  48. 5
      src/assets/mesh/mark/inside/xfsd/XFSD.gltf.manifest
  49. 5
      src/assets/mesh/mark/inside/xfsq/XFSQ.gltf.manifest
  50. 5
      src/assets/mesh/mark/inside/xyy/XYY.gltf.manifest
  51. 5
      src/assets/mesh/mark/inside/ygc/YGC.gltf.manifest
  52. 5
      src/assets/mesh/mark/inside/ygcsj/YGCSJ.gltf.manifest
  53. 5
      src/assets/mesh/mark/inside/yzzg/YZZG.gltf.manifest
  54. 5
      src/assets/mesh/mark/inside/zymbrq/ZYMBRQ.gltf.manifest
  55. 5
      src/assets/mesh/mark/outside/XFC/XFC.gltf.manifest
  56. 5
      src/assets/mesh/mark/outside/XFY/XFY.gltf.manifest
  57. 5
      src/styles.scss

12
src/app/babylon/controller/data-manager.ts

@ -63,7 +63,7 @@ export class DataManager {
*/
static allMarkPlanData: AllMarkPlanData;
static initDebugData(institutionKey: string, onSuccess?: (key: string) => void, onError?: (key: string, error: string) => void) {
static initDebugData(institutionID: number, onSuccess?: (key: string) => void, onError?: (key: string, error: string) => void) {
//本地捏造消防设备列表信息
DataManager.initDebugData_facility();
@ -75,7 +75,7 @@ export class DataManager {
if (dataFromServe) {
ServeManager.instance.getInstitutionData(institutionKey, (key, result) => {
ServeManager.instance.getInstitutionData(institutionID, (key, result) => {
if (onSuccess) {
DataManager.institutionData = plainToClass(InstitutionData, result);
DataManager.institutionData.normalData.name = DataManager.institutionData_simple.name;
@ -352,7 +352,7 @@ export class DataManager {
static init(simpleData: InsitutionDataSimple, onSuccess?: (key: string) => void) {
DataManager.institutionData_simple = simpleData;
DataManager.initDebugData(simpleData.key, onSuccess);
DataManager.initDebugData(simpleData.id, onSuccess);
}
/**
@ -360,7 +360,7 @@ export class DataManager {
*/
static initAllMarkPlaneData() {
DataManager.allMarkPlanData = new AllMarkPlanData();
DataManager.allMarkPlanData.institutionID = DataManager.institutionData.normalData.key;
DataManager.allMarkPlanData.institutionID = DataManager.institutionData_simple.key;
DataManager.allMarkPlanData.datas = [];
return DataManager.allMarkPlanData;
}
@ -369,7 +369,7 @@ export class DataManager {
*
*/
static initMarkData(onSuccess?: (data: AllMarkPlanData) => void) {
ServeManager.instance.getMarkData(DataManager.institutionData.normalData.key, (institutionID: string, data: string) => {
ServeManager.instance.getMarkData(DataManager.institutionData_simple.id, (institutionID: number, data: string) => {
if (data == null) //新建单位的标绘信息
{
DataManager.initAllMarkPlaneData();
@ -381,7 +381,7 @@ export class DataManager {
if (onSuccess != null) {
onSuccess(DataManager.allMarkPlanData);
}
}, (institutionID: string, data: any) => {
}, (institutionID: number, data: any) => {
if (data instanceof HttpErrorResponse && data.status == 404) {
//404,新增单位标绘数据,不算错误
}

2
src/app/babylon/controller/mode-manager.ts

@ -23,7 +23,7 @@ export class ModeManager {
/**
*
*/
public static s_isMakeMode = true;
public static s_isMakeMode = false;
/**
*

23
src/app/babylon/controller/serve-manager.ts

@ -5,6 +5,7 @@ import { BuildingBasicInfosService } from "src/app/service/babylon/building-basi
import { ObjectsService } from "src/app/service/objects.service";
import { InsitutionDataSimple } from "../model/data/institution/institution-data-simple";
import { AllMarkPlanData } from "../model/data/mark/mark-plan-data";
import { DataManager } from "./data-manager";
import { ModeManager, ModeType } from "./mode-manager";
//服务器通信
@ -29,19 +30,19 @@ export class ServeManager {
}
//从服务器获取单位信息
getInstitutionData(key: string = 'test', onSuccess?: (key: string,
getInstitutionData(id: number = 1, onSuccess?: (key: string,
data: string
) => void, onError?: (key: string, error: any) => void) {
this.buildingBISrv.getBuildingBasicInfos(key)
this.buildingBISrv.getBuildingBasicInfos(id)
.subscribe(data => {
//console.log("得到单位信息" + key, data);
if (onSuccess) {
onSuccess(key, JSON.parse((data as any).result));
onSuccess(id.toString(), JSON.parse((data as any).result));
}
}, error => {
console.error("From serve" + key + "===" + error);
console.error("From serve:" + id, error);
if (onError) {
onError(key, error);
onError(id.toString(), error);
}
})
}
@ -89,9 +90,9 @@ export class ServeManager {
* @param onSuccess
* @param onError
*/
getMarkData(institutionID: string,
onSuccess?: (institutionID: string, data: string) => void,
onError?: (institutionID: string, error: any) => void) {
getMarkData(institutionID: number,
onSuccess?: (institutionID: number, data: string) => void,
onError?: (institutionID: number, error: any) => void) {
this.buildingBISrv.getMarkData(institutionID)
.subscribe(data => {
@ -102,7 +103,7 @@ export class ServeManager {
}, (error) => {
if (error instanceof HttpErrorResponse) {
if (error.status === 404) {
console.log("没有标绘数据,新建:" + error.error);
console.log("没有标绘数据,新建:", error.error);
if (ModeManager.currentMode == ModeType.Edit) {
onSuccess(institutionID, null); //data 为null ,表示新建
}
@ -136,9 +137,9 @@ export class ServeManager {
}
else {
let data = classToPlain(allMarkPlanData);
this.buildingBISrv.postMarkData(allMarkPlanData.institutionID, data)
this.buildingBISrv.postMarkData(allMarkPlanData.institutionID, DataManager.institutionData_simple.id, data)
.subscribe(data => {
ModeManager.log("保存标绘信息成功:" + allMarkPlanData.institutionID);
console.log("保存标绘信息成功:" + allMarkPlanData.institutionID, DataManager.institutionData_simple.id);
if (onSuccess) {
onSuccess(allMarkPlanData.institutionID, data.result);
}

6
src/app/babylon/controller/status/login-status.ts

@ -61,7 +61,8 @@ export class LoginSatus extends StatusBase {
// testIns1.key = "test";
// testIns1.name = "测试单位1";
// debugList.push(testIns1);
ServeManager.instance.getInstitutionData("InsList", (key, data) => {
// -1 = InsList
ServeManager.instance.getInstitutionData(-1, (key, data) => {
debugList = plainToClass(InsitutionDataSimple, data);
this.institutionList = debugList;
if (onSuccess) {
@ -228,11 +229,10 @@ export class LoginSatus extends StatusBase {
//保存新单位信息至服务器
saveNewIns(status: LoginSatus, insData: InstitutionData, key: string, id: number, onSuccess?: (insDataSimple: InsitutionDataSimple) => void) {
console.log("准备保存新单位");
ServeManager.instance.saveInstitutionData(insData, key, id, (key, result) => {
console.log("在服务器新建单位" + key);
let insDataSimple = new InsitutionDataSimple();
insDataSimple.key = key;
insDataSimple.id = id;
insDataSimple.name = insData.normalData.name;
status.onCreateInsSuccess(insDataSimple);
if (onSuccess != null) {

2
src/app/babylon/game.ts

@ -26,7 +26,7 @@ export class Game {
this.scene = new Scene(this.engine);
this.scene.useRightHandedSystem = true;//使用右手坐标系
RenderingManager.MIN_RENDERINGGROUPS = -1;//最小渲染序列
// Engine.DefaultLoadingScreenFactory() //尝试更改canvas
this.createScene();
let scene = this.scene;
// canvas.translate = true; //用于设置背景透明

11
src/app/babylon/model/data/mark/mark-plan-data.ts

@ -11,11 +11,15 @@ import { MarkData } from "./mark-data";
*/
export class AllMarkPlanData {
/**
* ID
* ID("字符串")
*/
institutionID: string;
/**
*
*/
@ -192,6 +196,7 @@ export class MarkPlanData {
*/
export class MarkNodeData {
/**
* id
*/
@ -364,9 +369,9 @@ export class MarkNodeData {
let timeScale = 0.3;
let minTime = 3; //最短停留时间
let minTime = 4; //最短停留时间
let result = textNum * timeScale;
let result = textNum * timeScale + 1;
if (result < minTime) {
result = minTime;
}

5
src/app/babylon/model/info/mark/model-info-mark.ts

@ -267,7 +267,9 @@ export class ModelInfo_mark extends ModelInfo {
// instance.uiFollowHeadBg.widthInPixels = maxWidth;
}, (50));
// console.log("喷水", this.taskNeedWaterParticle());
if (this.taskNeedWaterParticle()) {
this.sprinklingWater(true);
}
else {
@ -423,6 +425,9 @@ export class ModelInfo_mark extends ModelInfo {
// }
// }
}
// console.log("喷头", this.node_pz);
if (this.node_pz == null) {
result = false;
}

2
src/app/babylon/model/info/mark/other/mark-plan-particle-info.ts

@ -68,6 +68,7 @@ export class ModelInfo_mark_particle extends ModelInfo_mark {
// instance.modelBox.scaling = new Vector3(100, 300, 100);
ps.emitter = root;
instance.particleSet.systems.push(ps);
// console.log(ps.name, instance.isPlaying);
if (instance.isPlaying) {
instance.particleSet.start();
}
@ -127,6 +128,7 @@ export class ModelInfo_mark_particle extends ModelInfo_mark {
dispose() {
if (this.particleSet != null) {
// console.log("释放粒子", this.particleSet);
this.particleSet.dispose();
}
super.dispose();

2
src/app/babylon/model/info/model/model-info.ts

@ -229,7 +229,7 @@ export class ModelInfo {
this.uiFollowRoot.dispose();
}
console.log("释放model" + this.key, disposeMesh);
// console.log("释放model" + this.key, disposeMesh);
if (disposeMesh) {
if (this.modelBox != null) {
this.modelBox.dispose();

26
src/app/babylon/tool/babylon-tool.ts

@ -1,3 +1,4 @@
import { NumberValueAccessor } from '@angular/forms';
import {
AbstractMesh,
Animation,
@ -130,7 +131,7 @@ export class BabylonTool {
path = ObjectsService.getFullPath(path); //根据环境,动态改变桶名
}
console.log("异步加载模型" + path + sceneFilename);
// console.log("异步加载模型" + path + sceneFilename);
let modelPath = path + sceneFilename;
LoadTool.add(modelPath, tag);
@ -345,7 +346,12 @@ export class BabylonTool {
radius: number,
alpha: number,
beta: number,
onAnimationEnd?: () => void
) {
camera.alpha = BabylonTool.limitPI(camera.alpha);
camera.beta = BabylonTool.limitPI(camera.beta);
//缓动动画
let easingFunction = new QuadraticEase();
easingFunction.setEasingMode(EasingFunction.EASINGMODE_EASEOUT);
@ -416,10 +422,26 @@ export class BabylonTool {
camera.animations.push(anim_a);
camera.animations.push(anim_b);
camera._scene.beginAnimation(camera, 0, allFrame, false);
return camera._scene.beginAnimation(camera, 0, allFrame, false, undefined, onAnimationEnd);
}
/**
* 0-2π
* @param value
*/
public static limitPI(value: number) {
let result = value;
while (result < 0) {
result += Math.PI * 2;
}
while (result > Math.PI * 2) {
result -= Math.PI * 2;
}
return result;
}
//动画移动摄像机target
public static AnimMoveCameraTarget(

7
src/app/babylon/tool/particle-system-tool.ts

@ -40,6 +40,8 @@ export class ParticleSystemTool {
let instance = this;
ParticleHelper.ParseFromFileAsync(null, path, this.scene, false).then((value: ParticleSystem) => {
value.stop();
value.emitter = Vector3.Zero();
value.name += "(prefab)";
instance.psPool.set(path, value);
if (clone) {
let result = instance.cloneParticle(value, name);
@ -65,10 +67,11 @@ export class ParticleSystemTool {
if (instance.psPool.has(path)) {
let set = instance.psPool.get(path);
let result = instance.cloneParticle(set, name);
// console.log(set.uniqueId + "克隆特效id", result.uniqueId);
onSuccess(result);
}
else {
// console.log("加载特效", name);
instance.loadPrefab(null, path, true, (value: ParticleSystem) => {
onSuccess(value);
})
@ -104,7 +107,7 @@ export class ParticleSystemTool {
cloneParticle(particle: ParticleSystem, name: string) {
// let root = new AbstractMesh("root_" + name, this.scene);
let root = Vector3.Zero();
let result = particle.clone(particle.name, root);
let result = particle.clone(name, root);
return result;
}

2
src/app/babylon/tool/speaking-tool.ts

@ -38,7 +38,7 @@ export class SpeakingTool {
* @param msg
*/
speak(msg: string) {
console.log("阅读" + msg);
// console.log("阅读" + msg);
if (this.isIE()) {
}

37
src/app/babylon/view/building-window/building-window.ts

@ -1,8 +1,10 @@
import { AbstractMesh, Material, Mesh, PBRMaterial, Texture } from "@babylonjs/core";
import { AbstractMesh, Material, Mesh, PBRMaterial, Texture, Animatable } from "@babylonjs/core";
import { PlanComponent } from "src/app/pages/plan/plan.component";
import { ConfigManager } from "../../controller/config-manager";
import { DataManager } from "../../controller/data-manager";
import { EventManager } from "../../controller/event-manager/event-manager";
import { Event_LoadingChange } from "../../controller/event-manager/events/event-loading-change";
import { InfoManager } from "../../controller/info-manager";
import { ModeManager, ModeType } from "../../controller/mode-manager";
import { SceneManager } from "../../controller/scene-manager";
@ -23,6 +25,7 @@ import { ModelInfo_building } from "../../model/info/model/model-info-building";
import { FacilityInfoByType, ModelInfo_facility } from "../../model/info/model/model-info-facility";
import { BabylonTool } from "../../tool/babylon-tool";
import { GizmoTool } from "../../tool/gizmo-tool";
import { LoadTool } from "../../tool/load-tool";
import { TsTool } from "../../tool/ts-tool";
import { FacilityInfoInSceneWindow } from "../facilityinfoinscene-window/facilityinfoinscene-window";
import { MarkWindow } from "../mark-window/mark-window";
@ -49,6 +52,7 @@ export class BuildingWindow extends UIBase {
three: PlanComponent;//前端组件
cameraAnim: Animatable;//相机动画
//#region 与前端对接部分
@ -283,12 +287,16 @@ export class BuildingWindow extends UIBase {
* @param cameraData
* @param showZP
*/
revoverCamera(cameraData: ArcRotateCameraData, showZP: boolean) {
revoverCamera(cameraData: ArcRotateCameraData, showZP: boolean, onAnimationEnd?: () => void) {
this.showZP(showZP);
PlanComponent.instance.isOpenAwning = showZP;
let camera = SceneManager.Instance.defaultCamera;
if (cameraData != null) {
BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta);
this.cameraAnim = BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta, onAnimationEnd);
if (Event_LoadingChange.isLoading) { //加载中,暂停
this.cameraAnim.pause();
}
}
}
@ -314,6 +322,10 @@ export class BuildingWindow extends UIBase {
SceneManager.Instance.scene.onBeforeRenderObservable.add(() => {
instance.onUpdate();
})
EventManager.addListener<Event_LoadingChange>(Event_LoadingChange, (eventInfo) => {
instance.onChangeLoading(eventInfo);
});
}
onShow() {
@ -331,6 +343,25 @@ export class BuildingWindow extends UIBase {
}
/**
* loading状态改变时
* @param eventInfo
*/
onChangeLoading(eventInfo: Event_LoadingChange) {
if (eventInfo.showLoading) {
if (this.cameraAnim != null) {
this.cameraAnim.pause();
}
}
else {
if (this.cameraAnim != null) {
this.cameraAnim.restart();
}
}
}
//#endregion

7
src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts

@ -2,6 +2,7 @@ import { AbstractMesh, Color3, EventState, Mesh, PickingInfo, PointerEventTypes,
import { classToClass } from "class-transformer";
import { PlanComponent } from "src/app/pages/plan/plan.component";
import { ModelChangeType } from "../../controller/data-manager";
import { EventManager } from "../../controller/event-manager/event-manager";
import { Event_KeyboardInput } from "../../controller/event-manager/events/event-keyboard-input";
import { Event_ModelInfoChange } from "../../controller/event-manager/events/event-modelinfo-change";
import { ModeManager, ModeType } from "../../controller/mode-manager";
@ -261,7 +262,7 @@ export class FacilityInfoInSceneWindow extends UIBase {
FacilityInfoInSceneWindow.instance = this;
this.three = PlanComponent.instance;
// EventManager.addListener(Event_ModelInfoChange, this.onModelInfoChange);
EventManager.addListener(Event_ModelInfoChange, this.onModelInfoChange);
GizmoTool.onPickMeshInfoObservable.add(this.onClickModel);
this.currentFacility = [];
@ -275,7 +276,7 @@ export class FacilityInfoInSceneWindow extends UIBase {
onClose() {
super.onClose();
//EventManager.removeCallback(Event_ModelInfoChange, this.onModelInfoChange);
EventManager.removeCallback(Event_ModelInfoChange, this.onModelInfoChange);
GizmoTool.onPickMeshInfoObservable.removeCallback(this.onClickModel);
}
@ -638,7 +639,7 @@ export class FacilityInfoInSceneWindow extends UIBase {
}
// facilityInfo.setSelectEnable(true);
// this.selectFacilityItemToThree(facilityInfoUIItem);
this.selectFacilityItemToThree([facilityInfoUIItem], true);
}
//this.onClickModel(facilityInfoUIItem);

40
src/app/babylon/view/mark-window/mark-window.ts

@ -39,6 +39,12 @@ import { WeatherTool } from "./weather-tool";
export class MarkWindow extends UIBase {
/**
* Key
*/
readonly c_leaveNode: string = "node_leave_";
static instance: MarkWindow;
static s_cameraData: ArcRotateCameraData = null;//预定义的相机数据
static s_preLoadMesh: boolean = false;//预加载所有标绘物(如果是false,则在选中每个标绘物的时候,进行预加载单个)
@ -236,6 +242,7 @@ export class MarkWindow extends UIBase {
*
* @param markPlanId idID
* @param nodeId idid
* @param newName
*/
saveToOldNode(markPlanId: number, nodeId: number, newName?: string) {
let markPlaneData = DataManager.allMarkPlanData.getMarkPlanById(markPlanId);
@ -248,7 +255,7 @@ export class MarkWindow extends UIBase {
let copyNodeData = classToClass(this.currentMarkNodeDataCopy);//覆盖数据
copyNodeData.id = oldNodeData.id;
copyNodeData.index = oldNodeData.index;
if (newName != null) {
if (newName != null && newName != this.c_leaveNode) {
copyNodeData.name = newName;
}
// copyNodeData.name = oldNodeData.name;
@ -321,10 +328,10 @@ export class MarkWindow extends UIBase {
let nodeCopy: MarkNodeData;
if (changeBuildingByUI) //从ui点击切层,
{
console.log(this.currentMarkNodeInfo);
// console.log(this.currentMarkNodeInfo);
if (this.currentMarkNodeInfo == null)//没有当前的markInfo,创建一个游离的节点
{
console.log("拷贝游离节点");
// console.log("拷贝游离节点");
nodeCopy = this.createLeaveNode();
this.savCurrentNodeData(nodeCopy);
}
@ -362,10 +369,14 @@ export class MarkWindow extends UIBase {
this.currentMarkNodeDataCopy = nodeCopy;//更新备份数据
this.currentMarkNodeInfo = new MarkNodeInfo(markPlanData, this.currentMarkNodeDataCopy);
//this.currentMarkNodeDataCopy = classToClass(this.currentMarkNodeInfo.nodeData); //更新备份数据
this.updateNodeInfo();
if (readDescribe) {
this.readDescribe(nodeCopy.describe);
}
this.updateNodeInfo(readDescribe);
// let instance = this;
// if (readDescribe) { //镜头移动完,开始说话
// setTimeout(() => {
// instance.readDescribe(nodeCopy.describe);
// }, MarkNodeData.speakWaitTime * 1000);
// }
}
@ -936,6 +947,8 @@ export class MarkWindow extends UIBase {
//#endregion
//#region 查询类
@ -1009,7 +1022,7 @@ export class MarkWindow extends UIBase {
*
*/
createLeaveNode() {
let result = new MarkNodeData(0, "leave");
let result = new MarkNodeData(0, this.c_leaveNode);
return result;
}
@ -1167,8 +1180,9 @@ export class MarkWindow extends UIBase {
*
*
*
* @param readDescribe: 是否阅读介绍
*/
updateNodeInfo() {
updateNodeInfo(readDescribe = false) {
let environmentData = this.currentMarkNodeInfo.nodeData.getCurrentEnvironmentData();
let cameraData = this.currentMarkNodeInfo.nodeData.cameraData;
let showZP = this.currentMarkNodeInfo.nodeData.showZP;
@ -1198,7 +1212,13 @@ export class MarkWindow extends UIBase {
// }
//仅此分支生效
BuildingWindow.instance.revoverCamera(cameraData, showZP);
//动画还原相机,结束后开始阅读
BuildingWindow.instance.revoverCamera(cameraData, showZP, (() => {
if (readDescribe) {
instance.readDescribe(instance.currentMarkNodeInfo.nodeData.describe);
}
}));
instance.clearEnterObserver(true);

39
src/app/pages/init3D.guard.ts

@ -0,0 +1,39 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Component, OnInit, Inject } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
import { ModeManager } from '../babylon/controller/mode-manager';
import { NzMessageService } from 'ng-zorro-antd/message';
@Injectable({
providedIn: 'root'
})
export class init3DGuard implements CanActivate {
constructor(private router: Router, private http: HttpClient, private message: NzMessageService,) { }
// 路由守卫
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot,): Promise<boolean> {
return this.getGasStationBaseInfo().then((res: any) => {
sessionStorage.setItem("3dSceneData", JSON.stringify(res))
let isMakeMode = ModeManager.s_isMakeMode
if (isMakeMode || res.hasBuildingInfo) {
return true
} else if (!res.hasBuildingInfo) {
this.message.info("当前站点没有数字油站!");
return false
}
});
}
//获取 当前加油站基本信息
getGasStationBaseInfo() {
return new Promise((resolve, reject) => {
let params = { organizationUnitId: (JSON.parse(sessionStorage.getItem('userdataOfgasstation'))).organization.id }
this.http.get('/api/services/app/GasStation/Get', { params: params }).subscribe((data: any)=>{
resolve(data.result)
})
})
}
}

30
src/app/pages/left-domain/left-domain.component.html

@ -101,8 +101,7 @@
<p style="padding-left: 8px;">
<nz-select class="tableSelect" [nzBorderless]="true" [nzDisabled]="!editMode" [(ngModel)]="item.getPropertyData().oilTankType">
<nz-option nzValue="scg" nzLabel="双层罐"></nz-option>
<nz-option nzValue="dcg" nzLabel="单层罐"></nz-option>
<nz-option nzValue="fsgc" nzLabel="防渗罐池"></nz-option>
<nz-option nzValue="dcg" nzLabel="单层罐+防渗罐池"></nz-option>
</nz-select>
</p>
</div>
@ -126,10 +125,24 @@
<div class="positionRightTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionRightBottom" *ngIf="selectFacilityId === item.getID()"></div>
<!-- 选中样式 -->
<p class="title"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().name"></p>
<div class="table">
<div class="tableHeader" style="flex: 50%;">
<p>连接的加油机</p>
<p>连接的油罐</p>
</div>
<div class="tableContent" style="flex: 50%;">
<p><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().linkJYJ"></p>
<p><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().linkYG"></p>
</div>
</div>
<div class="propertyImage" id="pipelineViewer{{item.getID()}}">
<p class="imgTitle" style="margin-top: 0px;">设计图纸</p>
<p class="imgTitle">设计图纸</p>
<img [hidden]="!item.getPropertyData().img" [src]="item.getPropertyData().img" [attr.data-original]="item.getPropertyData().img">
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" *ngIf="editMode"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="plus" nzTheme="outline"></i></a>
<div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && item.getPropertyData().img">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImg(item)"></i>
</div>
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" *ngIf="editMode && !item.getPropertyData().img"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="plus" nzTheme="outline"></i></a>
</div>
</div>
</div>
@ -160,7 +173,11 @@
<div class="propertyImage" id="orvrViewer{{item.getID()}}">
<p class="imgTitle">设计图纸</p>
<img [hidden]="!item.getPropertyData().img" [src]="item.getPropertyData().img" [attr.data-original]="item.getPropertyData().img">
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" *ngIf="editMode"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="plus" nzTheme="outline"></i></a>
<div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && item.getPropertyData().img">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImg(item)"></i>
</div>
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" *ngIf="editMode && !item.getPropertyData().img"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="plus" nzTheme="outline"></i></a>
</div>
</div>
</div>
@ -186,6 +203,9 @@
</div>
<!-- 处置预案 -->
<!-- 弹窗 -->
<nz-modal nzClassName="baseInfoDialog" [(nzVisible)]="isShowBaseDialog" nzFooter="null" (nzOnCancel)="closeBaseInfoDialog()" nzWidth="70%">
<app-oil-station-info *ngIf="isShowBaseDialog"></app-oil-station-info>
</nz-modal>
<nz-modal [(nzVisible)]="addDisposalPop || addNodePop" nzTitle="创建预案/节点" (nzOnCancel)="addDisposalPop = false; addNodePop = null;" (nzOnOk)="addDisposal(form.value)" [nzOkDisabled]='nodeName.invalid'>
<form nz-form #form='ngForm'>
<nz-form-item>

6
src/app/pages/left-domain/left-domain.component.scss

@ -38,9 +38,9 @@
.tableInput{ border: none; outline: none; background-color: transparent; width: 100%; height: 100%; }
.tableSelect{ width: 100%; height: 100%; color: #fff; }
.propertyImage{
padding-left: 15px;
img{ width: auto; max-height: 130px; display: block; margin-bottom: 10px; }
.imgTitle{ font-size: 14px; height: 20px; line-height: 20px; margin: 10px 0; }
position: relative;
.imgTitle{ font-size: 14px; height: 20px; line-height: 20px; margin: 10px 0; padding-left: 10px; }
img{ width: 120px; height: auto; max-height: 100px; display: block; margin-bottom: 10px; }
.uploadImgBox{ margin: 0; width: 50px; height: 50px; line-height: 50px; text-align: center; }
}

36
src/app/pages/left-domain/left-domain.component.ts

@ -36,6 +36,7 @@ export class LeftDomainComponent implements OnInit {
FacilityList: FacilityInfoUIItem[] = []; //统计设备 list
selectFacilityId: string = null; //选中设备 ID
baseInfo: any; //基本信息
isShowBaseDialog: boolean = false; //显隐 编辑信息/导出Excel 弹窗
//初始化组件
initComponent(type?: number) {
@ -91,7 +92,7 @@ export class LeftDomainComponent implements OnInit {
this.FacilityList.forEach(item=>{
if (item.getPropertyData() && item.getPropertyData().img) {
window.setTimeout(() => {
new Viewer(this.element.nativeElement.querySelector(`#${id}${item.getID()}`), { url: 'data-original' });
new Viewer(this.element.nativeElement.querySelector(`#${id}${item.getID()}`), { url: 'data-original', navbar: false });
}, 0)
}
})
@ -126,11 +127,11 @@ export class LeftDomainComponent implements OnInit {
item.getPropertyData().img = ObjectsService.getFullPath(path + name)
if (this.beforeFence === 5) {
window.setTimeout(() => {
new Viewer(this.element.nativeElement.querySelector(`#pipelineViewer${item.getID()}`), { url: 'data-original' });
new Viewer(this.element.nativeElement.querySelector(`#pipelineViewer${item.getID()}`), { url: 'data-original', navbar: false });
}, 0)
} else if (this.beforeFence === 6) {
window.setTimeout(() => {
new Viewer(this.element.nativeElement.querySelector(`#orvrViewer${item.getID()}`), { url: 'data-original' });
new Viewer(this.element.nativeElement.querySelector(`#orvrViewer${item.getID()}`), { url: 'data-original', navbar: false });
}, 0)
}
PlanComponent.instance.isShowLoading = false //关闭遮罩
@ -139,6 +140,17 @@ export class LeftDomainComponent implements OnInit {
}
}
//删除设备 图片
deleteImg(item: FacilityInfoUIItem) {
let isDelete = confirm("您确定要删除吗?")
if (isDelete) {
this.http.delete(`${item.getPropertyData().img}`).subscribe(data=>{
item.getPropertyData().img = ""
this.message.info("删除成功!");
})
}
}
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
treeData: NzTreeNodeOptions[] = []; //tree data
@ -351,17 +363,29 @@ export class LeftDomainComponent implements OnInit {
}
}
originalData: any; //sessionStorage 原始数据
//编辑信息
editInfo() {
this.originalData = sessionStorage.getItem('userdata')
let userdata = { organization: PlanComponent.instance.companyData, hideCloseBtn: true }
sessionStorage.setItem('userdata', JSON.stringify(userdata))
this.isShowBaseDialog = true
}
//导出Excel
deriveExcel() {
this.originalData = sessionStorage.getItem('userdata')
let userdata = { organization: PlanComponent.instance.companyData, hideCloseBtn: true }
sessionStorage.setItem('userdata', JSON.stringify(userdata))
this.isShowBaseDialog = true
}
//关闭 编辑信息/导出Excel 弹窗
closeBaseInfoDialog() {
sessionStorage.setItem('userdata', this.originalData)
this.isShowBaseDialog = false
}
}

2
src/app/pages/oil-station-info/oil-station-info.component.html

@ -372,7 +372,7 @@
</form>
</div>
</div>
<div class="backbtn">
<div class="backbtn" *ngIf="userdata && !userdata.hideCloseBtn">
<button nz-button (click)="goback()">返回</button>
</div>
</div>

3
src/app/pages/pages-routing.module.ts

@ -11,11 +11,12 @@ import { EquipmentInfoComponent } from './equipment-info/equipment-info.componen
import { PlanAdminComponent } from './plan-admin/plan-admin.component';
import { HomePageComponent } from './home-page/home-page.component';
import { OilUnloadingProcessListComponent } from './oil-unloading-process-list/oil-unloading-process-list.component';
import { init3DGuard } from './init3D.guard';
const routes: Routes = [
{ path: 'homepage', component: HomePageComponent },
{ path: 'plan', component: PlanAdminComponent },
{ path: 'plan/petrolStation', component: PlanComponent },
{ path: 'plan/petrolStation', component: PlanComponent, canActivate: [init3DGuard], },
{ path: 'warning', component: TodayWarningAdminComponent },
{ path: 'warning/petrolStation', component: TodayWarningComponent },
{ path: 'records', component: CriminalRecordsAdminComponent },

28
src/app/pages/plan/plan.component.html

@ -3,7 +3,7 @@
<div class="header">
<button *ngFor="let item of allFence; let key = index;" [ngClass]="{'selectFence': selectFence === key}" (click)="toggleHeaderFence(key)">
<label nz-dropdown [nzDropdownMenu]="menu" [nzDisabled]="item != '基本信息'">{{item}}<i nz-icon nzType="caret-up" nzTheme="outline" *ngIf="key === 0"></i></label>
<label nz-dropdown [nzDropdownMenu]="menu" [nzDisabled]="item != '基本信息' || selectFence != 0">{{item}}<i nz-icon nzType="caret-up" nzTheme="outline" *ngIf="key === 0"></i></label>
</button>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu class="dropDown">
@ -57,14 +57,24 @@
<!-- 右侧属性栏 -->
<div class="nature" *ngIf="isShowNature && selectFence === 0 && beforeOnePropertyData && beforeOnePropertyData.getPropertyData()" [ngStyle]="{'right': editMode? '5%' : null}">
<div class="natureHeader"><i nz-icon nzType="close-circle" nzTheme="outline" title="关闭" (click)="isShowNature = false;"></i></div>
<div class="natureContent" *ngIf="beforeOnePropertyData.getPropertyData().textDirection != undefined">
<div class="natureTitle">方向</div>
<div><input type="text" [(ngModel)]="beforeOnePropertyData.getPropertyData().textDirection" [disabled]="!editMode"></div>
</div>
<div class="natureContent" *ngIf="beforeOnePropertyData.getPropertyData().info != undefined">
<div class="natureTitle">详情</div>
<div><textarea [(ngModel)]="beforeOnePropertyData.getPropertyData().info" [disabled]="!editMode"></textarea></div>
</div>
<div class="natureContent" *ngIf="beforeOnePropertyData.getPropertyData().img != undefined" id="propertyImg">
<div class="natureTitle">图片</div>
<div class="natureImg" *ngIf="beforeOnePropertyData.getPropertyData().img"><img [src]="beforeOnePropertyData.getPropertyData().img" [attr.data-original]="beforeOnePropertyData.getPropertyData().img"></div>
<div *ngIf="editMode"><a href="javascript:;" class="bottomPlanUpload natureUpload"><input type="file" accept="image/*" (change)='uploadPropertyImg($event)'><i nz-icon nzType="plus" nzTheme="outline"></i></a></div>
<div class="natureImg" *ngIf="beforeOnePropertyData.getPropertyData().img">
<img [src]="beforeOnePropertyData.getPropertyData().img" [attr.data-original]="beforeOnePropertyData.getPropertyData().img">
<div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && beforeOnePropertyData.getPropertyData().img">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadPropertyImg($event)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImgVideo(1)"></i>
</div>
</div>
<div *ngIf="editMode && !beforeOnePropertyData.getPropertyData().img"><a href="javascript:;" class="bottomPlanUpload natureUpload"><input type="file" accept="image/*" (change)='uploadPropertyImg($event)'><i nz-icon nzType="plus" nzTheme="outline"></i></a></div>
</div>
</div>
<div class="nature natureLook" *ngIf="isShowNature && (selectFence === 1 || selectFence === 2) && beforeOnePropertyData" [ngStyle]="{'top': naturePosition.top,'right': naturePosition.right}">
@ -94,7 +104,7 @@
<!-- 右侧属性栏 -->
<!-- 右侧图标栏 -->
<div class="rightIcons" *ngIf="editMode && (selectFence === 0 || selectFence === 7)" [ngClass]="{'publicMoveUp': selectFence === 7}" [ngStyle]="{'width': selectFence === 0? '60px' : null}">
<div class="rightIcons" *ngIf="editMode && (selectFence === 0 || selectFence === 7)" [ngClass]="{'publicMoveUp': selectFence === 7}" [ngStyle]="{'width': selectFence === 7? '100px' : null}">
<div class="bottomCenter" id="bottomCenter">
<ng-container *ngIf="selectFence === 0">
<div class="everyIcon" (click)='selectBottomIcon(item)' *ngFor="let item of allFacilityUIItemes" [ngClass]="{'selectLeftIcon': beforeOneIcon == item.getIconID()}">
@ -145,12 +155,18 @@
</div>
<div class="planHeaderImg" id="planNodeImg">
<img class="imgSrc" [src]="beforePlanNode.texture" [hidden]="!beforePlanNode.texture" [attr.data-original]="beforePlanNode.texture">
<a href="javascript:;" class="imgAndVideoUpload uploadImage" *ngIf="editMode && beforePlanNode.texture"><input type="file" accept="image/*" (change)='uploadImgVideo($event, false)'><i nz-icon nzType="border-inner" nzTheme="outline"></i></a>
<div class="positionHandleImgVideo" style="width: 100px;" *ngIf="editMode && beforePlanNode.texture">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadImgVideo($event, false)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImgVideo(2)"></i>
</div>
<a href="javascript:;" class="bottomPlanUpload" *ngIf="editMode && !beforePlanNode.texture"><input type="file" accept="image/*" (change)='uploadImgVideo($event, false)'><img src="../../../assets/images/uploadImg.png"></a>
</div>
<div class="planHeaderVideo">
<video [src]="beforePlanNode.video" [hidden]="!beforePlanNode.video" (click)="openVideo(beforePlanNode.video)"></video>
<a href="javascript:;" class="imgAndVideoUpload uploadVideo" *ngIf="editMode && beforePlanNode.video"><input type="file" accept="video/*" (change)='uploadImgVideo($event, true)'><i nz-icon nzType="border-inner" nzTheme="outline"></i></a>
<div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && beforePlanNode.video">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="video/*" (change)='uploadImgVideo($event, true)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImgVideo(3)"></i>
</div>
<a href="javascript:;" class="bottomPlanUpload" style="width: 100px;" *ngIf="editMode && !beforePlanNode.video"><input type="file" accept="video/*" (change)='uploadImgVideo($event, true)'><img src="../../../assets/images/uploadVideo.png"></a>
</div>
</div>

19
src/app/pages/plan/plan.component.scss

@ -192,10 +192,11 @@
.natureContent{
box-sizing: border-box;
padding: 0 20px;
margin-bottom: 5px;
margin: 5px 0;
.natureTitle{ margin-bottom: 5px; height: 20px; line-height: 20px; }
input{ width: 100%; height: 28px; background: rgba(145, 204, 255, 0.41); border: 1px solid #91CCFF; padding: 0; resize: none; outline: none; }
textarea{ width: 100%; height: 75px; background: rgba(145, 204, 255, 0.41); border: 1px solid #91CCFF; padding: 0; resize: none; outline: none; }
.natureImg{ margin-bottom: 5px; img{ width: auto; height: auto; max-height: 120px; } }
.natureImg{ margin-bottom: 5px; position: relative; img{ width: 120px; height: auto; max-height: 100px; } }
.natureUpload{ margin: 0; text-align: center; width: 50px; height: 50px; line-height: 50px; }
}
}
@ -226,13 +227,11 @@
//右侧图标栏
.rightIcons{
width: 100px;
height: 70%;
width: 60px;
height: 260px;
position: absolute;
top: 0;
bottom: 0;
top: 10%;
right: 1%;
margin: auto;/*这行代码是关键*/
color: #fff;
background: linear-gradient(360deg, #000D21 0%, rgba(0, 59, 110, 0.8) 100%);
overflow: hidden;
@ -335,10 +334,8 @@
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: 140px; height: 100%; text-align: center; line-height: 80px; .imgSrc{ width: 100px; height: auto; max-height: 100%; } }
.uploadImage{ width: 20px; height: 20px; line-height: 20px; float: right; margin-top: 30px; }
.planHeaderVideo{ width: 180px; height: 100%; text-align: center; line-height: 80px; video{ width: 120px; height: auto; max-height: 100%; } }
.uploadVideo{ width: 30px; height: 30px; line-height: 30px; float: right; margin-top: 25px; }
.planHeaderImg{ width: 100px; height: 100%; text-align: center; position: relative; margin: 0 30px; .imgSrc{ width: 100%; height: 100%; } }
.planHeaderVideo{ width: 120px; height: 100%; text-align: center; position: relative; video{ width: 100%; height: 100%; } }
}
.bottomPlanCenter{
height: 35px;

137
src/app/pages/plan/plan.component.ts

@ -29,6 +29,7 @@ import { EventManager as babylonEventManager } from 'src/app/babylon/controller/
import { Event_GetAllMarkPlanData } from 'src/app/babylon/controller/event-manager/events/event-get-markplandata-success';
import { FacilityInfoInSceneWindow } from 'src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window';
import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-facility';
import { HttpClient } from '@angular/common/http';
@ -39,7 +40,7 @@ import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-f
})
export class PlanComponent implements OnInit {
constructor(private element: ElementRef, private buildingBISrv: BuildingBasicInfosService, private objectsSrv: ObjectsService, private eventManager: EventManager, private message: NzMessageService) { }
constructor(private element: ElementRef, private buildingBISrv: BuildingBasicInfosService, private objectsSrv: ObjectsService, private eventManager: EventManager, private message: NzMessageService, private http: HttpClient) { }
static instance: PlanComponent;
public game: Game = new Game();
@ -49,7 +50,7 @@ export class PlanComponent implements OnInit {
public userMode: boolean = ModeManager.s_isMakeMode; //是否为 内部权限
public bucketName: string = ObjectsService.getFullPath("文件路径"); //当前桶名
public isShowLoading: boolean = true; //显隐 loading加载条
public companyData: any; //当前加油站 信息
public companyData: any; //当前加油站所属组织机构 data
ngOnInit(): void {
PlanComponent.instance = this;
@ -78,43 +79,46 @@ export class PlanComponent implements OnInit {
}
ngAfterViewInit(): void {
let simpleData: InsitutionDataSimple = new InsitutionDataSimple();
simpleData.id = 1; //来自选中的单位的信息 ,测试:1
simpleData.key = "ceshi"; //正式: id.tostring(),测试:"ceshi"
simpleData.name = this.companyData.displayName || "测试"; //来自选中的单位的信息 ,测试:"测试"
let has3dData = true;//是否有三维数据,来自选中单位的信息
let loginStatus = StatusManager.getStatus<LoginSatus>(LoginSatus);
if (ModeManager.institutionDemoKey == ModeManager.c_demoKey_null) { //无指定测试单位,则为正式启动,根据当前单位key寻找
if (has3dData) { //如果已经有三维数据,直接进入
this.beforeOneSatus = StatusManager.getStatus<LoginSatus>(LoginSatus);
this.beforeOneSatus.onSelectInsSuccess(simpleData)
} else { //如果没有三维数据
if (ModeManager.s_isMakeMode) //内部制作模式下,询问新建
{
let isAdd = confirm('没有单位' + simpleData.key + ',是否进行初始化?')
if (isAdd) {
let name = simpleData.name;
let id = simpleData.id;// 单位id
loginStatus.createInsitution(simpleData.key, name, id);
this.getGasStationBaseInfo().then((res: any) => { //获取单位 基本信息
let simpleData: InsitutionDataSimple = new InsitutionDataSimple();
simpleData.id = res.id || 6; //来自选中的单位的信息 ,测试:1
simpleData.key = `${res.id}` || "ceshi"; //测试:"ceshi"
simpleData.name = res.stationName || "测试"; //来自选中的单位的信息 ,测试:"测试"
let has3dData = res.hasBuildingInfo; //是否有三维数据,来自选中单位的信息
let loginStatus = StatusManager.getStatus<LoginSatus>(LoginSatus);
if (ModeManager.institutionDemoKey == ModeManager.c_demoKey_null) { //无指定测试单位,则为正式启动,根据当前单位key寻找
if (has3dData) { //如果已经有三维数据,直接进入
this.beforeOneSatus = StatusManager.getStatus<LoginSatus>(LoginSatus);
this.beforeOneSatus.onSelectInsSuccess(simpleData)
} else { //如果没有三维数据
if (ModeManager.s_isMakeMode) //内部制作模式下,询问新建
{
let isAdd = confirm('没有单位:' + simpleData.name + ',是否进行初始化?')
if (isAdd) {
let name = simpleData.name;
let id = simpleData.id;// 单位id
loginStatus.createInsitution(simpleData.key, name, id);
}
}
else //非内部制作模式,不开启
{
console.log("没有单位" + simpleData.key);
}
}
else //非内部制作模式,不开启
{
console.log("没有单位" + simpleData.key);
}
}
} else {
//let find = data.find(item => { return item.key === ModeManager.institutionDemoKey })
let find = simpleData; //测试单位
if (find) {
sessionStorage.setItem('unitId', find.key)
this.beforeOneSatus = StatusManager.getStatus<LoginSatus>(LoginSatus);
this.beforeOneSatus.onSelectInsSuccess(find)
} else {
//this.modelInit(data) //开发模式 选择单位 弹窗
//let find = data.find(item => { return item.key === ModeManager.institutionDemoKey })
let find = simpleData; //测试单位
if (find) {
sessionStorage.setItem('unitId', find.key)
this.beforeOneSatus = StatusManager.getStatus<LoginSatus>(LoginSatus);
this.beforeOneSatus.onSelectInsSuccess(find)
} else {
//this.modelInit(data) //开发模式 选择单位 弹窗
}
}
}
})
}
ngOnDestroy(): void { //组件销毁前 销毁canvas
@ -122,6 +126,14 @@ export class PlanComponent implements OnInit {
this.game = null;
}
//获取 当前加油站基本信息
getGasStationBaseInfo() {
return new Promise((resolve, reject) => {
let result = JSON.parse(sessionStorage.getItem("3dSceneData"))
resolve(result)
})
}
//开发模式 选择单位 弹窗
modelInit(InsList) { }
@ -144,22 +156,22 @@ export class PlanComponent implements OnInit {
this.initializePlan()
}
if (type === 7) { //初始化 应急预案 data
this.isShowChildComponent && this.leftDomain? this.leftDomain.initComponent(type) : null; //手动初始化子组件
this.isShowChildComponent && this.leftDomain ? this.leftDomain.initComponent(type) : null; //手动初始化子组件
this.selectFence = type
this.editMode? this.isShowChildComponent = true : this.isShowChildComponent = false
this.editMode ? this.isShowChildComponent = true : this.isShowChildComponent = false
buildingWindow.changeJYZInfoModel(fenceType, true)
MarkWindow.instance ? this.allMarkPlanData = MarkWindow.instance.allMarkPlanData : null;
babylonEventManager.addListener(Event_GetAllMarkPlanData, (data: Event_GetAllMarkPlanData) => {
this.allMarkPlanData = MarkWindow.instance.allMarkPlanData
this.isShowChildComponent && this.leftDomain? this.leftDomain.allMarkPlanData = MarkWindow.instance.allMarkPlanData : null
this.isShowChildComponent && this.leftDomain ? this.leftDomain.allMarkPlanData = MarkWindow.instance.allMarkPlanData : null
})
this.isShowChildComponent && this.leftDomain? this.leftDomain.allMarkPlanData = MarkWindow.instance.allMarkPlanData : null
this.isShowChildComponent && this.leftDomain ? this.leftDomain.allMarkPlanData = MarkWindow.instance.allMarkPlanData : null
} else {
this.isShowChildComponent && this.leftDomain && type != 4 ? this.leftDomain.initComponent(type) : null; //手动初始化子组件
this.selectFence = type
this.isShowChildComponent = true
buildingWindow.changeJYZInfoModel(fenceType, true)
if (type === 0) { this.baseInfoMarks.forEach(item=>{ item.isShow = true }) } //初始化基本信息 设备显隐
if (type === 0) { this.baseInfoMarks.forEach(item => { item.isShow = true }) } //初始化基本信息 设备显隐
}
} else { //取消选中
this.selectFence = -1
@ -373,9 +385,9 @@ export class PlanComponent implements OnInit {
}
if (this.selectFence === 0 && this.beforeOnePropertyData.getPropertyData() && this.beforeOnePropertyData.getPropertyData().img) { //img
window.setTimeout(() => {
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original' });
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original', navbar: false });
}, 0)
}
}
}
//上传设备 图片
@ -395,7 +407,7 @@ export class PlanComponent implements OnInit {
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
this.beforeOnePropertyData.getPropertyData().img = ObjectsService.getFullPath(path + name)
window.setTimeout(() => {
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original' });
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original', navbar: false });
}, 0)
this.isShowLoading = false //关闭遮罩
this.message.info("上传成功!");
@ -424,8 +436,8 @@ export class PlanComponent implements OnInit {
publicToggleNode() {
return new Promise((resolve, reject) => {
this.beforePlanNode = this.beforeEmergencyPlan.nodes[this.nzCurrent]
this.isShowChildComponent && this.leftDomain? this.leftDomain.selectPlanId = this.beforeEmergencyPlan.id : null
this.isShowChildComponent && this.leftDomain? this.leftDomain.selectNodeId = this.beforePlanNode.id : null
this.isShowChildComponent && this.leftDomain ? this.leftDomain.selectPlanId = this.beforeEmergencyPlan.id : null
this.isShowChildComponent && this.leftDomain ? this.leftDomain.selectNodeId = this.beforePlanNode.id : null
MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id, false, true)
this.beforePlanNode = MarkWindow.instance.currentMarkNodeInfo.nodeData
this.initViewer()
@ -459,6 +471,12 @@ export class PlanComponent implements OnInit {
//更新进度条 值
updateProgress() {
if (this.isShowLoading) { //当前为loading状态
window.setTimeout(() => {
this.updateProgress()
}, 500);
return
}
if (this.progressList[this.nzCurrent] >= 100) {
this.progressList[this.nzCurrent] = 100
window.clearTimeout(this.updateTimer) //清除定时器
@ -619,7 +637,7 @@ export class PlanComponent implements OnInit {
initViewer() {
if (this.beforePlanNode.texture) {
window.setTimeout(() => {
this.planNodeImg = new Viewer(this.element.nativeElement.querySelector('#planNodeImg'), { url: 'data-original' });
this.planNodeImg = new Viewer(this.element.nativeElement.querySelector('#planNodeImg'), { url: 'data-original', navbar: false });
}, 0)
}
}
@ -635,7 +653,7 @@ export class PlanComponent implements OnInit {
}
this.isShowLoading = true //打开遮罩
let institutionKey = sessionStorage.getItem('unitId') || "ceshi"; //单位id
let resType = isVideo? ResType.Video : ResType.Texture
let resType = isVideo ? ResType.Video : ResType.Texture
let key = `${(new Date()).getMonth() + 1}-${(new Date()).getDate()}-${(new Date()).getHours()}`
let url = DataManager.getResPath_mark(institutionKey, resType, key) //url
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
@ -651,6 +669,29 @@ export class PlanComponent implements OnInit {
}
}
//删除 图片/视频
deleteImgVideo(type: number) {
let isDelete = confirm("您确定要删除吗?")
if (isDelete) {
if (type === 1) {
this.http.delete(`${this.beforeOnePropertyData.getPropertyData().img}`).subscribe(data=>{
this.beforeOnePropertyData.getPropertyData().img = ""
this.message.info("删除成功!");
})
} else if (type === 2) {
this.http.delete(`${this.beforePlanNode.texture}`).subscribe(data=>{
this.beforePlanNode.texture = ""
this.message.info("删除成功!");
})
} else if (type === 3) {
this.http.delete(`${this.beforePlanNode.video}`).subscribe(data=>{
this.beforePlanNode.video = ""
this.message.info("删除成功!");
})
}
}
}
//打开视频弹窗
openVideo(src: string) {
this.videoDialogType.isVideo = true
@ -807,7 +848,7 @@ export class modelBuilding {
modelType: BuildingType = BuildingType.Normal;
}
//基本信息 设备筛选
export class baseInfoMark{
export class baseInfoMark {
markerName: string;
isShow: boolean = true;
constructor(markerName: string) {

19
src/app/pages/plan/publicPop.scss

@ -27,10 +27,12 @@
display: inline-block;
}
.imgAndVideoUpload{
width: 20px;
height: 20px;
margin-right: 10px;
vertical-align: top;
position: relative;
cursor: pointer;
background: rgba(145, 204, 255, 0.41);
border: 1px dashed #91CCFF;
overflow: hidden;
display: inline-block;
}
@ -41,5 +43,16 @@
right: 0;
top: 0;
opacity: 0;
cursor: pointer
cursor: pointer;
}
//绝对定位 上传/删除 图片/视频弹窗
.positionHandleImgVideo {
position: absolute;
left: 0;
bottom: 0px;
height: 20px;
text-align: center;
background: rgba(0, 0, 0, 0.7);
.anticon { font-size: 20px; color: #fff; cursor: pointer; }
}

19
src/app/service/babylon/building-basic-infos.service.ts

@ -1,5 +1,6 @@
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { NumberValueAccessor } from '@angular/forms';
import { Observable, throwError } from 'rxjs';
import { catchError, retry } from 'rxjs/operators';
@ -27,8 +28,8 @@ export class BuildingBasicInfosService {
/**
*
*/
getBuildingBasicInfos(name: string): Observable<string> {
return this.getInfos(this.api_buildingInfo, name);
getBuildingBasicInfos(id: number): Observable<string> {
return this.getInfos(this.api_buildingInfo, { gasStationId: id });
}
/**
*
@ -43,8 +44,8 @@ export class BuildingBasicInfosService {
*
* @param name
*/
getMarkData(name: string): Observable<string> {
return this.getInfos(this.api_sandBox, name);
getMarkData(id: number): Observable<string> {
return this.getInfos(this.api_sandBox, { "gasStationId": id });
}
/**
@ -52,8 +53,8 @@ export class BuildingBasicInfosService {
* @param name
* @param data
*/
postMarkData(name: string, data: object): Observable<any> {
return this.postInfos(this.api_sandBox, data, { name: name });
postMarkData(name: string, id: number, data: object): Observable<any> {
return this.postInfos(this.api_sandBox, data, { name: name, "gasStationId": id });
}
@ -78,10 +79,10 @@ export class BuildingBasicInfosService {
* @param api
* @param name
*/
getInfos(api: string, name: string) {
let id = { "name": name };
getInfos(api: string, params = {}) {
return this.http.get<string>(api + this.c_get, { params: id }).pipe(
return this.http.get<string>(api + this.c_get, { params: params }).pipe(
catchError((err) => this.handleError(err))
);
}

4
src/app/service/objects.service.ts

@ -54,8 +54,8 @@ export class ObjectsService {
*/
obsRootByEnv = new Map<EnvironmentType, string>([
[EnvironmentType.DevelopEditor, "sinochemweb/"], //开发与编辑
[EnvironmentType.Test, "sinochem3d/"],//测试
[EnvironmentType.Production, "sinochem3d/"],//生产环境(根据需要设置)最好是与测试环境的桶名相同
[EnvironmentType.Test, "sinochemweb/"],//测试
[EnvironmentType.Production, "sinochemweb/"],//生产环境(根据需要设置)最好是与测试环境的桶名相同
]);

BIN
src/assets/images/mark/disaster/dt.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
src/assets/images/mark/disaster/lyd.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
src/assets/images/mark/disaster/lyx.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
src/assets/images/mark/inside/jyy.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
src/assets/images/mark/inside/syy.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
src/assets/images/mark/inside/xfsd.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
src/assets/images/mark/inside/xfsq.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
src/assets/images/mark/inside/xyy.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
src/assets/images/mark/inside/ygc.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
src/assets/images/mark/inside/ygcsj.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
src/assets/images/mark/inside/zymbrq.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

5
src/assets/mesh/mark/disaster/dt/DT.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/disaster/lyd/LYD.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/disaster/lyx/LYX.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/disaster/sy/SY.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/gfmhq/GFMHQ.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/jyy/JYY.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/ptmhq/PTMHQ.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/syy/SYY.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/tcmhq/TCMHQ.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/xfsd/XFSD.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/xfsq/XFSQ.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/xyy/XYY.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/ygc/YGC.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/ygcsj/YGCSJ.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/yzzg/YZZG.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/inside/zymbrq/ZYMBRQ.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/outside/XFC/XFC.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/assets/mesh/mark/outside/XFY/XFY.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

5
src/styles.scss

@ -125,6 +125,11 @@ h1 {
.ant-input { background: rgba(145, 204, 255, 0.41); border: 1px solid #91CCFF; }
textarea { resize: none; outline: none; }
}
.baseInfoDialog{
height: 80%;
.ant-modal-footer { padding: 0; }
.ant-modal-body,.ant-modal-content { height: 100%; background: radial-gradient(closest-side at 50% 55%, #004988 0%, #00122D 100%); }
}
.videoDialog{
height: 80%;
.ant-modal-footer { padding: 0; }

Loading…
Cancel
Save