Browse Source

Merge remote-tracking branch 'origin/master'

dev
邵佳豪 3 years ago
parent
commit
a8e4770c66
  1. 26
      src/app/babylon/controller/config-manager.ts
  2. 9
      src/app/babylon/controller/data-manager.ts
  3. 8
      src/app/babylon/controller/mode-manager.ts
  4. 3
      src/app/babylon/controller/scene-manager.ts
  5. 13
      src/app/babylon/controller/serve-manager.ts
  6. 9
      src/app/babylon/model/data/camera-data.ts
  7. 32
      src/app/babylon/model/data/institution/facility/property-data/in/property-data-jyj.ts
  8. 25
      src/app/babylon/model/data/institution/facility/property-data/in/property-data-sygx.ts
  9. 34
      src/app/babylon/model/data/institution/facility/property-data/in/property-data-yg.ts
  10. 25
      src/app/babylon/model/data/institution/facility/property-data/in/property-data-yqhsgx.ts
  11. 2
      src/app/babylon/model/data/institution/facility/property-data/out/property-data-q.ts
  12. 7
      src/app/babylon/model/data/institution/jyz-show-data.ts
  13. 10
      src/app/babylon/model/data/mark/mark-plan-data.ts
  14. 2
      src/app/babylon/model/data/model-data/model-data-facility.ts
  15. 2
      src/app/babylon/model/info/mark/mark-plan-info.ts
  16. 50
      src/app/babylon/model/info/model/facilityinfo-tool/facility-area.ts
  17. 9
      src/app/babylon/model/info/model/model-info-building.ts
  18. 36
      src/app/babylon/model/info/model/model-info-facility.ts
  19. 60
      src/app/babylon/model/info/model/model-info.ts
  20. 3
      src/app/babylon/tool/babylon-tool.ts
  21. 2
      src/app/babylon/tool/gizmo-tool.ts
  22. 7
      src/app/babylon/tool/pos-point-tool.ts
  23. 64
      src/app/babylon/tool/speaking-tool.ts
  24. 80
      src/app/babylon/view/building-window/building-window.ts
  25. 62
      src/app/babylon/view/facility-window/facility-window.ts
  26. 16
      src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts
  27. 225
      src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts
  28. 97
      src/app/babylon/view/mark-window/mark-window.ts
  29. 54
      src/app/pages/left-domain/left-domain.component.html
  30. 22
      src/app/pages/left-domain/left-domain.component.scss
  31. 139
      src/app/pages/left-domain/left-domain.component.ts
  32. 3
      src/app/pages/login/login.component.ts
  33. 8
      src/app/pages/pages.module.ts
  34. 2
      src/app/pages/plan/plan.component.html
  35. 8
      src/app/pages/plan/plan.component.ts
  36. BIN
      src/assets/images/facility/in/JY_JYJ.png
  37. BIN
      src/assets/images/facility/in/JY_YG.png
  38. BIN
      src/assets/images/facility/out/DWBZ.png
  39. BIN
      src/assets/images/facility/out/PL.png
  40. BIN
      src/assets/images/facility/out/QY.png
  41. BIN
      src/assets/images/facility/out/TPBZ.png
  42. 26
      src/styles.scss
  43. 6
      yarn.lock

26
src/app/babylon/controller/config-manager.ts

@ -43,7 +43,10 @@ export class ConfigManager {
case FacilityType.QY:
case FacilityType.TPBZ:
case FacilityType.DWBZ:
case FacilityType.JY_JYJ://临时
case FacilityType.JY_YG://临时
result = true;
break;
}
@ -73,11 +76,28 @@ export class ConfigManager {
static getFacilityTypeName(type: FacilityType): string {
let result = "未知";
switch (type) {
//自定义放置
case FacilityType.PL: result = "毗邻"; break;
case FacilityType.QY: result = "区域"; break;
case FacilityType.TPBZ: result = "图片标注"; break;
case FacilityType.DWBZ: result = "点位标注"; break;
case FacilityType.TPBZ: result = "图片"; break;
case FacilityType.DWBZ: result = "点位"; break;
//内建
case FacilityType.XF_MHQ_PT_4: result = "4kg普通灭火器"; break;
case FacilityType.XF_MHQ_PT_8: result = "8kg普通灭火器"; break;
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_35: result = "35kg干粉灭火器"; break;
case FacilityType.XF_MHT: result = "灭火毯"; break;
case FacilityType.XF_XFQ: result = "消防锹"; break;
case FacilityType.XF_XFT: result = "消防桶"; break;
case FacilityType.XF_XFCM: result = "消防长矛"; break;
case FacilityType.XF_XFF: result = "消防斧"; break;
case FacilityType.XF_XFS: result = "消防沙"; break;
case FacilityType.JY_JYJ: result = "加油机"; break;
case FacilityType.JY_YG: result = "油罐"; break;
case FacilityType.JY_SYGX: result = "输油管线"; break;
case FacilityType.JY_YQHSGX: result = "油气回收管线"; break;
}
return result;
}

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

@ -11,7 +11,11 @@ import {
} from '../model/data/institution/building/building-data';
import { AllFacilityData } from '../model/data/institution/facility/all-facility-data';
import { PropertyData_Base_IMG } from '../model/data/institution/facility/property-data/base/property-data-base-img';
import { PropertyData_JYJ } from '../model/data/institution/facility/property-data/in/property-data-jyj';
import { PropertyData_MHQ } from '../model/data/institution/facility/property-data/in/property-data-mhq';
import { PropertyData_SYGX } from '../model/data/institution/facility/property-data/in/property-data-sygx';
import { PropertyData_YG } from '../model/data/institution/facility/property-data/in/property-data-yg';
import { PropertyData_YQHSGX } from '../model/data/institution/facility/property-data/in/property-data-yqhsgx';
import { PropertyData_DWBZ } from '../model/data/institution/facility/property-data/out/property-data-dwbz';
import { PropertyData_PL } from '../model/data/institution/facility/property-data/out/property-data-pl';
import { PropertyData_Q } from '../model/data/institution/facility/property-data/out/property-data-q';
@ -439,7 +443,10 @@ export class DataManager {
case FacilityType.XF_MHQ_GF_4:
case FacilityType.XF_MHQ_GF_8:
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_SYGX: result = new PropertyData_SYGX(key); break;
case FacilityType.JY_YQHSGX: result = new PropertyData_YQHSGX(key); break;
}

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

@ -15,15 +15,15 @@ export enum ModeType {
export class ModeManager {
/**
*
*
* 使 currentMode 访
*/
private static s_currentMode: ModeType = ModeType.Edit;
/**
*
*
*/
public static highPower = true;
public static s_isMakeMode = true;
/**
*
@ -52,7 +52,7 @@ export class ModeManager {
//#endregion
/**
*
*
*/
static get currentMode(): ModeType {
return ModeManager.s_currentMode;

3
src/app/babylon/controller/scene-manager.ts

@ -138,6 +138,7 @@ export class SceneManager {
// camera.upperBetaLimit = 1.5; //beta方向上的旋转限制(防止看到模型底面)
camera.lowerRadiusLimit = 1; //相机距离拍摄目标的最小距离(防止穿插)
camera.setTarget(Vector3.Zero()); //设置拍摄目标
camera.radius = 100;
camera.attachControl(this.canvas, true); //把相机连接到画布
this.defaultCamera = camera;
@ -475,7 +476,7 @@ export class SceneManager {
) {
// console.log("准备加载");
let defaultMesh = MeshBuilder.CreateBox(modelData.key, { size: 0.01 });
let defaultMesh = MeshBuilder.CreateBox(modelData.key + "Box", { size: 0.01 });
defaultMesh.scaling.y = 0.01;
defaultMesh.visibility = 0;

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

@ -5,7 +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 { ModeManager } from "./mode-manager";
import { ModeManager, ModeType } from "./mode-manager";
//服务器通信
export class ServeManager {
@ -95,7 +95,7 @@ export class ServeManager {
this.buildingBISrv.getMarkData(institutionID)
.subscribe(data => {
ModeManager.log(data);
// ModeManager.log(data);
if (onSuccess) {
onSuccess(institutionID, JSON.parse((data as any).result));
}
@ -103,7 +103,13 @@ export class ServeManager {
if (error instanceof HttpErrorResponse) {
if (error.status === 404) {
ModeManager.log("没有标绘数据,新建:" + error.error);
onSuccess(institutionID, null); //data 为null ,表示新建
if (ModeManager.currentMode == ModeType.Edit) {
onSuccess(institutionID, null); //data 为null ,表示新建
}
else {
PlanComponent.instance.openSnackBar("暂无数据");
}
}
else {
if (onError) {
@ -138,6 +144,7 @@ export class ServeManager {
}
//PlanComponent.instance.openSnackBar("保存标绘信息成功");
// alert("保存标绘信息成功");
PlanComponent.instance.openSnackBar("保存成功");
//暂时没有失败的回调 onError
})

9
src/app/babylon/model/data/camera-data.ts

@ -12,13 +12,18 @@ export class ArcRotateCameraData {
alpha: number;
beta: number;
constructor() {
this.target = new Vector3();
}
/**
*
* @param camera
*/
setDataToCamera(camera: ArcRotateCamera) {
camera._scene.stopAnimation(camera);
camera.target = this.target;
camera.target = this.target.clone();
camera.radius = this.radius;
camera.alpha = this.alpha;
camera.beta = this.beta;
@ -29,7 +34,7 @@ export class ArcRotateCameraData {
* @param camera
*/
getDataFromCamera(camera: ArcRotateCamera) {
this.target = camera.target;
this.target = camera.target.clone();
this.radius = camera.radius;
this.alpha = camera.alpha;
this.beta = camera.beta;

32
src/app/babylon/model/data/institution/facility/property-data/in/property-data-jyj.ts

@ -0,0 +1,32 @@
import { FacilityType } from "../../../../model-data/model-data-facility";
import { PropertyData_Base } from "../property-data-base";
/**
*
*/
export class PropertyData_JYJ extends PropertyData_Base {
brand: string = ""; //品牌
superBrand: string = ""; //超大牌
oilGunNum: string = ""; //油枪数量
oilProductNo: string = ""; //油品品号
oilPumpType: string = ""; //油泵类型
constructor(key: string, brand: string, superBrand: string, oilGunNum: string, oilProductNo: string, oilPumpType: string) {
super(key, FacilityType.JY_JYJ);
this.name = "未命名";
this.brand = brand
this.superBrand = superBrand
this.oilGunNum = oilGunNum
this.oilProductNo = oilProductNo
this.oilPumpType = oilPumpType
}
clone(key: string) {
let result = new PropertyData_JYJ(key, this.brand, this.superBrand, this.oilGunNum, this.oilProductNo, this.oilPumpType);
result.name = this.name;
return result;
}
}

25
src/app/babylon/model/data/institution/facility/property-data/in/property-data-sygx.ts

@ -0,0 +1,25 @@
import { FacilityType } from "../../../../model-data/model-data-facility";
import { PropertyData_Base_IMG } from "../base/property-data-base-img";
import { PropertyData_Base } from "../property-data-base";
/**
*
*/
export class PropertyData_SYGX extends PropertyData_Base_IMG {
constructor(key: string) {
super(key, "", "", "", FacilityType.JY_SYGX);
}
clone(key: string) {
let result = new PropertyData_SYGX(key);
result.img = this.img;
result.pos = this.pos;
result.info = this.info,
result.is360 = this.is360;
return result;
}
}

34
src/app/babylon/model/data/institution/facility/property-data/in/property-data-yg.ts

@ -0,0 +1,34 @@
import { FacilityType } from "../../../../model-data/model-data-facility";
import { PropertyData_Base } from "../property-data-base";
/**
*
*/
export class PropertyData_YG extends PropertyData_Base {
oilProductNo: string = ""; //油品品号
oilTankVolume: string = ""; //油罐容积
safeVolume: string = ""; //安全容积
quantity: string = ""; //数量
tankFarm: string = ""; //罐区
oilTankType: string = ""; //油罐类型
constructor(key: string,oilProductNo: string,oilTankVolume: string,safeVolume: string,quantity: string,tankFarm: string,oilTankType: string) {
super(key, FacilityType.JY_YG);
this.name = "未命名";
this.oilProductNo = oilProductNo
this.oilTankVolume = oilTankVolume
this.safeVolume = safeVolume
this.quantity = quantity
this.tankFarm = tankFarm
this.oilTankType = oilTankType
}
clone(key: string) {
let result = new PropertyData_YG(key,this.oilProductNo,this.oilTankVolume,this.safeVolume,this.quantity,this.tankFarm,this.oilTankType);
result.name = this.name;
return result;
}
}

25
src/app/babylon/model/data/institution/facility/property-data/in/property-data-yqhsgx.ts

@ -0,0 +1,25 @@
import { FacilityType } from "../../../../model-data/model-data-facility";
import { PropertyData_Base_IMG } from "../base/property-data-base-img";
import { PropertyData_Base } from "../property-data-base";
/**
*
*/
export class PropertyData_YQHSGX extends PropertyData_Base_IMG {
constructor(key: string) {
super(key, "", "", "", FacilityType.JY_YQHSGX);
}
clone(key: string) {
let result = new PropertyData_YQHSGX(key);
result.img = this.img;
result.pos = this.pos;
result.info = this.info,
result.is360 = this.is360;
return result;
}
}

2
src/app/babylon/model/data/institution/facility/property-data/out/property-data-q.ts

@ -6,7 +6,7 @@ import { PropertyData_Base_IMG } from "../base/property-data-base-img";
import { PropertyData_Base } from "../property-data-base";
/**
*
*
*/
export class PropertyData_Q extends PropertyData_Base_IMG {

7
src/app/babylon/model/data/institution/jyz-show-data.ts

@ -16,7 +16,7 @@ export class JYZShowData {
*
*/
@Type(() => ArcRotateCameraData)
cameraData: ArcRotateCameraData;
cameraData: ArcRotateCameraData = new ArcRotateCameraData();
/**
*
@ -26,7 +26,10 @@ export class JYZShowData {
constructor(moudleType: JYZInfoMoudleType, camera: ArcRotateCamera, showZP: boolean) {
this.moudleType = moudleType;
this.cameraData = new ArcRotateCameraData();
this.cameraData.getDataFromCamera(camera);
if (camera != null) {
this.cameraData.getDataFromCamera(camera);
}
}
}

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

@ -225,6 +225,16 @@ export class MarkNodeData {
@Type(() => NatureData)
natureData: NatureData;
/**
*
*/
describe: string;
/**
*
*/
texture: string;
constructor(id: number, name: string) {
this.id = id;

2
src/app/babylon/model/data/model-data/model-data-facility.ts

@ -67,7 +67,7 @@ export class ModelData_facility extends ModelData {
//新建区域位点
newAreapPoints(): Vector3[] {
let size = 10;
let size = 3;
let x = 0.75 * size;
let z = 0.5 * size;
let result: Vector3[] = [];

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

@ -83,7 +83,7 @@ export class MarkNodeInfo {
}
/**
* id
* id()
*/
getNextMarkDataId() {
//console.log(this.currentMarkDataIndex, 1);

50
src/app/babylon/model/info/model/facilityinfo-tool/facility-area.ts

@ -1,6 +1,6 @@
//#region 区域
import { AbstractMesh, Color3, Mesh, MeshBuilder, Observer, PolygonMeshBuilder, Quaternion, Scene, StandardMaterial, Vector2, Vector3 } from "@babylonjs/core";
import { AbstractMesh, Color3, Mesh, MeshBuilder, Observer, PointerDragBehavior, PolygonMeshBuilder, Quaternion, Scene, StandardMaterial, Vector2, Vector3 } from "@babylonjs/core";
import { Button, Vector2WithInfo } from "@babylonjs/gui";
import { ModelInfo_facility } from "../model-info-facility";
@ -197,9 +197,9 @@ export class AreaInfo {
//更新顶点
updateMeshPoint(index = -1) {
this.clearMeshPoint();
let select = null;
let select: PolygonMeshPoint = null;
for (let i = 0; i < this.pointData.length; i++) {
let l_meshPoint = new PolygonMeshPoint(PosPointTool.c_key + "_" + i, i, 0.2, this.root, this.pointData[i], this);
let l_meshPoint = new PolygonMeshPoint(PosPointTool.c_key + "_" + i, i, 0.5, this.root, this.pointData[i], this);
this.pointMesh.push(l_meshPoint);
if (i == index) {
@ -266,6 +266,7 @@ export class PolygonMeshPoint {
area: AreaInfo
mesh: Mesh;
pos: Vector3;
pointMat: StandardMaterial; //顶点材质
index: number;
@ -273,6 +274,7 @@ export class PolygonMeshPoint {
onGizmoAimMeshObservor: Observer<AbstractMesh>;
onPointerClickObservor: Observer<Vector2WithInfo>;
pointerDragBehavior: PointerDragBehavior;//拖拽事件
constructor(name: string, index: number, size: number, parent: Mesh, pos: Vector3, area: AreaInfo) {
@ -289,23 +291,37 @@ export class PolygonMeshPoint {
//初始化编辑UI
initEditUI(name: string, size: number, parent: Mesh, pos: Vector3) {
if (ModeManager.currentMode == ModeType.Edit) {
this.mesh = MeshBuilder.CreateBox(name, { size: size });
let instance = this;
this.mesh = MeshBuilder.CreateSphere(name, { diameter: size });
this.mesh.setParent(parent);
this.mesh.position = pos;
this.mesh.isVisible = false;
this.mesh.isVisible = true;
let instance = this;
this.uiRoot = Button.CreateSimpleButton("ui_" + name, this.index.toString());
UIManager.Instance.uiRoot.addControl(this.uiRoot);
this.uiRoot.linkWithMesh(this.mesh);
BabylonUIStyleTool.setStyle_size(this.uiRoot, "20px", "20px");
this.uiRoot.background = BabylonUIStyleTool.c_color_blue;
this.uiRoot.color = BabylonUIStyleTool.c_color_white;
this.uiRoot.onPointerClickObservable.add(() => {
this.pointMat = new StandardMaterial("mat_areaPoint", SceneManager.Instance.scene);
this.pointMat.emissiveColor = Color3.FromHexString("#A9FF00");
this.pointMat.disableLighting = true;
this.pointMat.alpha = 0.87;
this.mesh.material = this.pointMat;
this.pointerDragBehavior = new PointerDragBehavior({ dragPlaneNormal: Vector3.Up() }); //平面内移动
this.mesh.addBehavior(this.pointerDragBehavior);
this.pointerDragBehavior.onDragEndObservable.add(() => {
instance.changeAim();
});
this.showUI(false);
// this.uiRoot = Button.CreateSimpleButton("ui_" + name, this.index.toString());
// UIManager.Instance.uiRoot.addControl(this.uiRoot);
// this.uiRoot.linkWithMesh(this.mesh);
// BabylonUIStyleTool.setStyle_size(this.uiRoot, "20px", "20px");
// this.uiRoot.background = BabylonUIStyleTool.c_color_blue;
// this.uiRoot.color = BabylonUIStyleTool.c_color_white;
// this.uiRoot.onPointerClickObservable.add(() => {
// instance.changeAim();
// });
// this.showUI(false);
}
}
@ -318,7 +334,7 @@ export class PolygonMeshPoint {
//改变选中的目标
changeAim() {
let instance = this;
GizmoTool.changeGizmoAim(instance.mesh);
//GizmoTool.changeGizmoAim(instance.mesh);
PosPointTool.attachMesh(instance.mesh as Mesh, instance.pos,
() => {
instance.addPoint();
@ -337,6 +353,10 @@ export class PolygonMeshPoint {
this.mesh.dispose();
this.uiRoot.dispose();
}
if (this.pointMat != null) {
this.pointMat.dispose();
this.pointMat = null;
}
}

9
src/app/babylon/model/info/model/model-info-building.ts

@ -50,7 +50,7 @@ export class ModelInfo_building extends ModelInfo {
for (let i = 0; i < allTransformNode.length; i++) {
if (TsTool.stringContain(allTransformNode[i].name, "WAI")) {
this.neiRoot = allTransformNode[i];
console.log("找到关键节点wai");
break;
}
}
@ -58,6 +58,10 @@ export class ModelInfo_building extends ModelInfo {
if (this.neiRoot == null) {
if (!TsTool.stringContain(this.modelBox.name, "Box")) {
console.error("没有关键节点", this.modelBox.name);
}
this.neiRoot = this.modelBox;
}
@ -156,6 +160,9 @@ export class ModelInfo_building extends ModelInfo {
//更新跟随UI的名称
updateName(name: string) {
this.uiIconBtn.textBlock.text = name;
if (!ModeManager.s_isMakeMode) {
this.showFollowUI(false);
}
}

36
src/app/babylon/model/info/model/model-info-facility.ts

@ -3,12 +3,13 @@ import { Button, Control, Ellipse, Rectangle, Vector2WithInfo } from "@babylonjs
import { ConfigManager } from "src/app/babylon/controller/config-manager";
import { SceneManager } from "src/app/babylon/controller/scene-manager";
import { BabylonUIStyleTool } from "src/app/babylon/tool/babylon-ui-style-tool";
import { SpeakingTool } from "src/app/babylon/tool/speaking-tool";
import { TsTool } from "src/app/babylon/tool/ts-tool";
import { FacilityWindow } from "src/app/babylon/view/facility-window/facility-window";
import { FacilityInfoInSceneWindow } from "src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window";
import { PropertyBaseWindow } from "src/app/babylon/view/property-window/property-base-window";
import { ModelData } from "../../data/model-data/model-data";
import { FacilityShowType, FacilityType, ModelData_facility } from "../../data/model-data/model-data-facility";
import { FacilityPosType, FacilityShowType, FacilityType, ModelData_facility } from "../../data/model-data/model-data-facility";
import { BuildingInfo } from "../building/building-info";
import { AreaInfo } from "./facilityinfo-tool/facility-area";
@ -16,6 +17,9 @@ import { ModelInfo } from "./model-info";
//设施数据
export class ModelInfo_facility extends ModelInfo {
static readonly c_hightLightColor = Color3.Yellow();
belongToBuilding: BuildingInfo;//属于哪个建筑
pickDown: boolean;//按下
facilityShowType: FacilityShowType;//设备展示状态
@ -39,15 +43,15 @@ export class ModelInfo_facility extends ModelInfo {
}
onCreateFollowUI() {
let modelData = this.modelData as ModelData_facility;
if (!ConfigManager.getFacilityNeedIcon(modelData.facilityType)) {
let facilityData = this.modelData as ModelData_facility;
if (!ConfigManager.getFacilityNeedIcon(facilityData.facilityType)) {
return;
}
super.onCreateFollowUI();
let instance = this;
let posType = ConfigManager.getPosType(modelData.facilityType);
let iconPath = ConfigManager.getFacilityIconUrl(modelData.facilityType, posType);
let posType = ConfigManager.getPosType(facilityData.facilityType);
let iconPath = ConfigManager.getFacilityIconUrl(facilityData.facilityType, posType);
BabylonUIStyleTool.setStyle_size(this.uiFollowRoot, ConfigManager.c_size_facilityIconSize + "px", ConfigManager.c_size_facilityIconSize + "px");
this.uiFollowRoot.thickness = 0;
@ -93,7 +97,13 @@ export class ModelInfo_facility extends ModelInfo {
});
this.uiFollowRoot.zIndex = BabylonUIStyleTool.c_zIndex_facilityIcon;
this.showFollowUI(false);
if (facilityData.posType == FacilityPosType.In) {
this.showFollowUI(false); //内置设备,默认隐藏
}
}
@ -115,6 +125,7 @@ export class ModelInfo_facility extends ModelInfo {
// this.onClickMeshIconBtn(eventData,eventState);
FacilityInfoInSceneWindow.instance.selectFacilityInfo(this);
// SpeakingTool.Instance.speak("你好世界");
}
//展示属性
@ -141,7 +152,10 @@ export class ModelInfo_facility extends ModelInfo {
* @param enable
*/
setSelectEnable(enable: boolean) {
this.ui_select.isVisible = enable;
if (this.ui_select != null) {
this.ui_select.isVisible = enable;
}
}
/**
@ -159,14 +173,14 @@ export class ModelInfo_facility extends ModelInfo {
}
/**
* ()
* @param play false表示停止
*/
* ()
* @param play false表示停止
*/
playShowAnim(play: boolean) {
this.showFollowUI(play);
if (this.modelBox != null) {
if (play) {
SceneManager.Instance.addToHighLight(this.modelBox as Mesh, Color3.Yellow());
SceneManager.Instance.addToHighLight(this.modelBox as Mesh, ModelInfo_facility.c_hightLightColor);
}
else {
SceneManager.Instance.removeFromHighLight(this.modelBox as Mesh);

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

@ -5,15 +5,15 @@ import {
EventState,
Mesh,
PointerDragBehavior,
Vector2,
Vector3,
} from '@babylonjs/core';
import { Button, Rectangle, Vector2WithInfo } from '@babylonjs/gui';
import { classToClass } from 'class-transformer';
import { SceneManager } from 'src/app/babylon/controller/scene-manager';
import { UIManager } from 'src/app/babylon/controller/ui-manager';
import { BabylonTool } from 'src/app/babylon/tool/babylon-tool';
import { BabylonUIStyleTool } from 'src/app/babylon/tool/babylon-ui-style-tool';
import { GizmoTool } from 'src/app/babylon/tool/gizmo-tool';
import { TsTool } from 'src/app/babylon/tool/ts-tool';
import { ModelData } from '../../data/model-data/model-data';
@ -25,7 +25,12 @@ export class ModelInfo {
/**
*
*/
models: AbstractMesh[];
_models: AbstractMesh[];
/**
*
*/
head: AbstractMesh;
/**
* 使modelBox 访
*/
@ -121,6 +126,20 @@ export class ModelInfo {
}
}
/**
*
*/
get models(): AbstractMesh[] {
if (this._models == null) {
this._models = this.modelBox.getChildMeshes();
}
return this._models;
}
set models(value: AbstractMesh[]) {
this._models = value;
}
//创建跟随UI
onCreateFollowUI() {
@ -237,8 +256,23 @@ export class ModelInfo {
if (this.uiFollowRoot != null) {
this.uiFollowRoot.linkWithMesh(this.modelBox);
this.uiFollowRoot.linkOffsetY = '-50px';
for (let i = 0; i < this.models.length; i++) {
let l_mesh = this.models[i];
if (TsTool.stringContain(l_mesh.name, "Head")) {
this.head = l_mesh;
break;
}
}
if (this.head == null) {
this.uiFollowRoot.linkWithMesh(this.modelBox);
this.uiFollowRoot.linkOffsetY = '-50px';
}
else {
this.uiFollowRoot.linkWithMesh(this.head);
}
}
}
@ -271,6 +305,22 @@ export class ModelInfo {
}
/**
* ui所在的位置
*/
getHeadUIPos() {
let result: Vector2 = null;
if (this.uiFollowRoot != null) {
result = new Vector2();
result.x = this.uiFollowRoot.leftInPixels;
result.y = this.uiFollowRoot.topInPixels;
}
return result;
}
}

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

@ -288,6 +288,9 @@ export class BabylonTool {
}
/**
* targetalphabeta
*/
public static AnimMoveCameraTargetAB(
camera: ArcRotateCamera,
allFrame: number,

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

@ -425,7 +425,7 @@ export class GizmoTool {
: UIBase.color_null;
GizmoTool.s_gizmoManager.scaleGizmoEnabled = isScaling;
if (uiType == TransformUIType.Hide) { //隐藏选中框
if (uiType == TransformUIType.Hide || !ModeManager.s_isMakeMode) { //隐藏选中框
GizmoTool.s_boundingBoxGizmo.attachedMesh = null;
}

7
src/app/babylon/tool/pos-point-tool.ts

@ -19,14 +19,19 @@ export class PosPointTool {
initUI() {
let instance = this;
this.uiRoot = new Rectangle("PosPointTooUI");
this.uiRoot.color = BabylonUIStyleTool.c_color_3d_blueLight;
this.uiRoot.shadowBlur = 5;
UIManager.Instance.uiRoot.addControl(this.uiRoot);
BabylonUIStyleTool.setStyle_size(this.uiRoot, "40px", "20px");
let stack = new StackPanel("stack");
this.uiRoot.addControl(stack);
stack.width = 1;
stack.height = 1;
stack.isVertical = false;
let btn_add = Button.CreateSimpleButton("add", "+");
stack.addControl(btn_add);
btn_add.background = BabylonUIStyleTool.c_color_blue;
@ -52,7 +57,7 @@ export class PosPointTool {
showUI(show: boolean) {
this.uiRoot.isVisible = show;
this.uiRoot.linkWithMesh(this.mesh);
this.uiRoot.linkOffsetY = "-50px";
this.uiRoot.linkOffsetY = "-30px";
}
//#endregion

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

@ -0,0 +1,64 @@
/**
*
*/
export class SpeakingTool {
private static instance: SpeakingTool;
static get Instance() {
if (SpeakingTool.instance == null) {
SpeakingTool.instance = new SpeakingTool();
}
return SpeakingTool.instance;
}
/**
*
* @param msg
*/
speak(msg: string) {
if (this.isIE()) {
}
else {
let speakMsg = new SpeechSynthesisUtterance(msg);
speakMsg.lang = "zh-CN";
speakMsg.rate = 1;
speakMsg.pitch = 1.5;
window.speechSynthesis.speak(speakMsg);
return speakMsg;
}
}
/**
*
* @param speakMsg
*/
pause() {
window.speechSynthesis.pause();
}
/**
*
*/
resume() {
window.speechSynthesis.resume();
}
/**
* IE浏览器
*/
private isIE() {
// if ("ActiveXObject" in window) {
// console.log("IE 浏览器")
// return true;
// }
// else {
// return false;
// }
return false;
}
}

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

@ -1,8 +1,10 @@
import { AbstractMesh, Material, Mesh, PBRMaterial, Texture } 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 { InfoManager } from "../../controller/info-manager";
import { ModeManager, ModeType } from "../../controller/mode-manager";
import { SceneManager } from "../../controller/scene-manager";
import { ServeManager } from "../../controller/serve-manager";
import { BuildingStatus } from "../../controller/status/building-status";
@ -10,7 +12,7 @@ import { StatusManager } from "../../controller/status/status-manager";
import { BuildingData, BuildingData_ChemicalPlant, BuildingData_Environment, BuildingData_Normal, BuildingType } from "../../model/data/institution/building/building-data";
import { JYZInfoMoudleType, JYZShowData } from "../../model/data/institution/jyz-show-data";
import { ModelType } from "../../model/data/model-data/model-data";
import { FacilityType } from "../../model/data/model-data/model-data-facility";
import { FacilityPosType, FacilityType } from "../../model/data/model-data/model-data-facility";
import { ModelEditData } from "../../model/data/model-data/model-edit-data";
import { BuildingInfo } from "../../model/info/building/building-info";
import { BuildingInfo_ChemicalPlant } from "../../model/info/building/building-info-chemicalplant";
@ -20,6 +22,7 @@ import { ModelInfo_building } from "../../model/info/model/model-info-building";
import { FacilityInfoByType } from "../../model/info/model/model-info-facility";
import { BabylonTool } from "../../tool/babylon-tool";
import { TsTool } from "../../tool/ts-tool";
import { FacilityInfoInSceneWindow } from "../facilityinfoinscene-window/facilityinfoinscene-window";
import { UIBase } from "../window-base/ui-base";
import { BuildingUIItem } from "./building-ui-item";
@ -217,8 +220,6 @@ export class BuildingWindow extends UIBase {
* @param show true表示显示
*/
showJYZInfoModel(type: JYZInfoMoudleType, show: boolean) {
console.log("showJYZInfoModel", type, show);
if (this.currentJYZInfoMoudleType == type) {
if (show) {
return; //与上次显示的模块相同
@ -239,15 +240,7 @@ export class BuildingWindow extends UIBase {
//进入应急处置
}
else {//恢复查看状态
let showData = DataManager.institutionData.getMoudleShowData(type);
if (showData != null) {
let camera = SceneManager.Instance.defaultCamera;
//showData.cameraData.setDataToCamera(camera);
let cameraData = showData.cameraData;
BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta);
this.showZP(showData.showZP);
PlanComponent.instance.isOpenAwning = showData.showZP;
}
this.recoverMoudleShow(type);
}
}
else {
@ -259,6 +252,23 @@ export class BuildingWindow extends UIBase {
}
/**
*
* @param type
*/
recoverMoudleShow(type: JYZInfoMoudleType) {
let showData = DataManager.institutionData.getMoudleShowData(type);
if (showData != null) {
let camera = SceneManager.Instance.defaultCamera;
//showData.cameraData.setDataToCamera(camera);
let cameraData = showData.cameraData;
BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta);
this.showZP(showData.showZP);
PlanComponent.instance.isOpenAwning = showData.showZP;
}
}
//#endregion
@ -345,6 +355,7 @@ export class BuildingWindow extends UIBase {
this.showJYZModules(JYZInfoMoudleType.AQSS, false);
this.showJYZModules(JYZInfoMoudleType.YQHSGX, false);
this.showJYZModules(JYZInfoMoudleType.YQHSGX, false);
this.recoverMoudleShow(null);
//this.onChangeCurrentBuildingItem(item);
@ -503,7 +514,7 @@ export class BuildingWindow extends UIBase {
instance.addBuildings(BuildingType.Normal, 0, (uiItem, index) => {
if (index == 0 && uiItem.buildingInfo.isEnable) {
instance.onChangeCurrentBuildingItem(uiItem, false);
uiItem.lookAt(false);
//uiItem.lookAt(false);
// console.log("默认选中" + uiItem.buildingInfo.buildingData.normalData.key);
}
});
@ -708,6 +719,8 @@ export class BuildingWindow extends UIBase {
}
this.initFacilityTypeByMoudleType(type, this.currentBuidngItem.buildingInfo);
FacilityInfoInSceneWindow.instance.selectJYJFrom3D(null);
//设备: 显示UI
let facilityByType: FacilityInfoByType[] = [];
if (this.facilitysByMoudle.has(type)) {
@ -763,6 +776,31 @@ export class BuildingWindow extends UIBase {
let moudleTypeKey = moudleType; //当前模块物体的特殊字段
let zdKey = "ZD_" + moudleType; //阻挡类物体特殊字段
//编辑模式下,基本信息下的设备会随时变化
if (ModeManager.currentMode == ModeType.Edit) {
let jbxxMoudle = JYZInfoMoudleType.JBXX;
if (this.facilitysByMoudle.has(jbxxMoudle)) {
this.facilitysByMoudle.get(jbxxMoudle).length = 0;
}
else {
this.facilitysByMoudle.set(jbxxMoudle, []);
}
let allFacilityByType = buildingInfo.ModelInfo.facilityInfos;
if (allFacilityByType == null) {
return; //没有设备
}
for (let i = 0; i < allFacilityByType.length; i++) {
let l_facilityByType = allFacilityByType[i];
if (ConfigManager.getPosType(l_facilityByType.type) == FacilityPosType.Out) {
this.facilitysByMoudle.get(jbxxMoudle).push(l_facilityByType);
}
}
}
if (this.facilitysByMoudle.has(moudleType)) {
//已经初始化过了
return;
@ -779,17 +817,7 @@ export class BuildingWindow extends UIBase {
for (let i = 0; i < allFacilityByType.length; i++) {
let l_facilityByType = allFacilityByType[i];
// if (moudleType == JYZInfoMoudleType.XF) //消防-逃生
// {
// if (TsTool.stringContain(l_facilityByType.type, FacilityType.XF_TSLX)) {
// continue;
// }
// if (TsTool.stringContain(l_facilityByType.type, FacilityType.XF_SSD)) {
// continue;
// }
// }
if (TsTool.stringContain(l_facilityByType.type, zdKey)) {
if (TsTool.stringContain(l_facilityByType.type, zdKey)) { //遮挡物
if (!this.zdByMoudle.has(moudleType)) {
this.zdByMoudle.set(moudleType, []);
}
@ -798,6 +826,7 @@ export class BuildingWindow extends UIBase {
else if (TsTool.stringContain(l_facilityByType.type, "_" + moudleTypeKey) || TsTool.stringContain(l_facilityByType.type, moudleTypeKey + "_")) {
this.facilitysByMoudle.get(moudleType).push(l_facilityByType);
}
}
}
@ -862,7 +891,6 @@ export class BuildingWindow extends UIBase {
if (!isRepeat)//不重复,就添加进去
{
this.mat_UV.get(moudleType).push(l_mat);
console.log("找到uv", l_mat);
}
}
}
@ -936,10 +964,12 @@ export class BuildingWindow extends UIBase {
}
if (jyzShowData == null) {
jyzShowData = new JYZShowData(moudleType, camera, showZP);
DataManager.institutionData.JYZShowDatas.push(jyzShowData);
}
jyzShowData.moudleType = moudleType;
jyzShowData.cameraData.getDataFromCamera(camera);
jyzShowData.showZP = showZP;
console.log("保存展示数据", DataManager.institutionData.JYZShowDatas);
}

62
src/app/babylon/view/facility-window/facility-window.ts

@ -1,8 +1,10 @@
import {
AbstractMesh,
Color3,
EventState,
Mesh,
MeshBuilder,
PickingInfo,
PointerEventTypes,
PointerInfo,
Vector3,
@ -23,6 +25,8 @@ import { BuildingStatus } from '../../controller/status/building-status';
import { IndoorStatus } from '../../controller/status/indoor-status';
import { StatusManager } from '../../controller/status/status-manager';
import { UIManager } from '../../controller/ui-manager';
import { BuildingType } from '../../model/data/institution/building/building-data';
import { JYZInfoMoudleType } from '../../model/data/institution/jyz-show-data';
import { FacilityPosType, ModelData_facility, FacilityShowType, FacilityType } from '../../model/data/model-data/model-data-facility';
import { TransformData } from '../../model/data/transform-data';
import { BuildingInfo } from '../../model/info/building/building-info';
@ -33,6 +37,7 @@ import { BabylonUIStyleTool } from '../../tool/babylon-ui-style-tool';
import { GizmoTool } from '../../tool/gizmo-tool';
import { TsTool } from '../../tool/ts-tool';
import { BuildingWindow } from '../building-window/building-window';
import { FacilityInfoUIItem } from '../facilityinfoinscene-window/facilityinfo-ui-item';
import { CopyFacilityInfo, FacilityInfoInSceneWindow } from '../facilityinfoinscene-window/facilityinfoinscene-window';
import { ToolbarWindow } from '../toolbar-window/toobar-window';
import { UIBase } from '../window-base/ui-base';
@ -49,6 +54,8 @@ export class FacilityWindow extends UIBase {
static s_currentFacilityItem: FacilityUIItem;
static instance: FacilityWindow;
createIconRoot: Rectangle;//创建状态的跟随icon
createIcon: Image;
static readonly c_createIcon_width = 40;
@ -237,7 +244,11 @@ export class FacilityWindow extends UIBase {
case PointerEventTypes.POINTERUP:
if (eventData.event.button == 0) { //左键正常
if (eventData.pickInfo.hit && !SceneManager.s_isPointerDrag) {
if (FacilityWindow.s_currentFacilityItem != null) {
instance.createNewFacilityByPos(eventData.pickInfo.pickedPoint);
return;
@ -258,6 +269,7 @@ export class FacilityWindow extends UIBase {
}
}
//寻找设备预设
getFacilityPrefab(resName: string): Mesh {
let result = null;
@ -309,24 +321,8 @@ export class FacilityWindow extends UIBase {
}
/**
* mesh创建设备
* @param mesh
* @param type
*/
createNewFacilityByMesh(mesh: AbstractMesh, type: FacilityType) {
let facilityData = this.createFacilityDataFromMesh(mesh, type);
//let facilityInfo = this.createFacilityInfoFromMesh(facilityData, mesh, buildingInfo);
if (!this.isRepeatFacilityFromMesh(type, mesh.id)) //不重复
{
console.log("获取到设备" + type, mesh);
this.createNewFacility(facilityData, mesh);
}
}
/**
@ -342,6 +338,10 @@ export class FacilityWindow extends UIBase {
// ThreeDimensionalHomeComponent.instance.openSnackBar("请先选中目标建筑");
return
}
else if (currentBuidngItem.getBuildingType() == BuildingType.Environment) {
alert("请选中主体建筑后,再进行标注")
return
}
Event_ChangeFacility.dispatch(facilityData, ModelChangeType.Add, null);
@ -728,6 +728,36 @@ export class FacilityWindow extends UIBase {
}
//#endregion
//#region 加油机特殊表现
/**
* mesh创建设备
* @param mesh
* @param type
*/
createNewFacilityByMesh(mesh: AbstractMesh, type: FacilityType) {
let facilityData = this.createFacilityDataFromMesh(mesh, type);
//let facilityInfo = this.createFacilityInfoFromMesh(facilityData, mesh, buildingInfo);
if (!this.isRepeatFacilityFromMesh(type, mesh.id)) //不重复
{
console.log("获取到设备" + type, mesh);
this.createNewFacility(facilityData, mesh);
}
}
//#endregion
}

16
src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts

@ -1,4 +1,5 @@
import { Vector2 } from "@babylonjs/core";
import { SceneManager } from "../../controller/scene-manager";
import { PropertyData_Base } from "../../model/data/institution/facility/property-data/property-data-base";
import { FacilityType, ModelData_facility } from "../../model/data/model-data/model-data-facility";
@ -93,12 +94,15 @@ export class FacilityInfoUIItem {
GizmoTool.onPickMeshInfoObservable.notifyObservers(this.modelInfo);
this.facilityInfoInSceneWindow.selectFacilityItemToThree([this], true);
this.modelInfo.setIconEnable(select);
this.facilityInfoInSceneWindow.playJYJSelectEffect(select, this.modelInfo)
}
else {
this.facilityInfoInSceneWindow.selectFacilityItemToThree([this], false);
if (!this.facilityInfoInSceneWindow.getFacilityUIShowType(this.getType())) {
this.modelInfo.setIconEnable(select);
}
this.facilityInfoInSceneWindow.playJYJSelectEffect(select, this.modelInfo)
}
}
@ -131,5 +135,17 @@ export class FacilityInfoUIItem {
}
/**
* UI的位置
*/
getHeadUIPos(): Vector2 {
if (this.modelInfo != null) {
return this.modelInfo.getHeadUIPos();
}
else {
return null;
}
}
}

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

@ -1,15 +1,17 @@
import { EventManager } from "@angular/platform-browser";
import { AbstractMesh, Ray, RayHelper, Vector3 } from "@babylonjs/core";
import { AbstractMesh, Color3, EventState, Mesh, PickingInfo, PointerEventTypes, PointerInfo, Ray, RayHelper, Vector3 } from "@babylonjs/core";
import { classToClass } from "class-transformer";
import { PlanComponent } from "src/app/pages/plan/plan.component";
import { ModelChangeType } from "../../controller/data-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";
import { SceneManager } from "../../controller/scene-manager";
import { BuildingStatus } from "../../controller/status/building-status";
import { IndoorStatus } from "../../controller/status/indoor-status";
import { StatusManager } from "../../controller/status/status-manager";
import { Game } from "../../game";
import { JYZInfoMoudleType } from "../../model/data/institution/jyz-show-data";
import { ModelData_facility, FacilityType } from "../../model/data/model-data/model-data-facility";
import { BuildingInfo } from "../../model/info/building/building-info";
import { ModelInfo } from "../../model/info/model/model-info";
@ -18,6 +20,7 @@ import { GizmoTool } from "../../tool/gizmo-tool";
import { TsTool } from "../../tool/ts-tool";
import { BuildingWindow } from "../building-window/building-window";
import { FacilityWindow } from "../facility-window/facility-window";
import { UIBase } from "../window-base/ui-base";
import { FacilityInfoUIItem } from "./facilityinfo-ui-item";
@ -42,6 +45,7 @@ export class FacilityInfoInSceneWindow extends UIBase {
isMultiselect: boolean = false;//多选状态
//#region 前端对接
@ -94,6 +98,7 @@ export class FacilityInfoInSceneWindow extends UIBase {
{
if (this.currentFacility != null) {
for (let i = 0; i < this.currentFacility.length; i++) {
console.log("取消选中", facilityInfoUIItem.getName());
this.currentFacility[i].onSelect(false);
}
this.currentFacility = [];
@ -159,12 +164,11 @@ export class FacilityInfoInSceneWindow extends UIBase {
}
} else { // 单选
if (isChecked) { //选中
this.three.beforeOnefacilityInfo = facilityInfoUIItem[0].getID();
this.three.getPropertyData(facilityInfoUIItem[0])
this.three.selectProperty(facilityInfoUIItem[0])
} else { //取消选中
// this.three.isShowRightNature = false
this.three.beforeOnefacilityInfo = null
}
}
}
@ -175,21 +179,21 @@ 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);
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++) {
@ -207,13 +211,27 @@ export class FacilityInfoInSceneWindow extends UIBase {
* @param facilityType
*/
getFacilityUIShowType(facilityType: FacilityType): boolean {
// for (let i = 0; i < this.three.allFacilityInfoUIItemes.length; i++) {
// let item = this.three.allFacilityInfoUIItemes[i];
// if (item.type == facilityType) {
// return item.isShow;
// }
// }
return true;
//没开弹框
if (!this.three.isShowChildComponent || this.three.leftDomain == null) {
return false;
}
//没有要显示的设备
if (this.three.leftDomain.FacilityList == null) {
return false;
}
for (let i = 0; i < this.three.leftDomain.FacilityList.length; i++) {
let item: FacilityInfoUIItem = this.three.leftDomain.FacilityList[i];
if (item.getType() == facilityType) {
console.log("显示", facilityType);
return true;
}
}
console.log("不显示", facilityType);
return false;
}
@ -242,14 +260,15 @@ export class FacilityInfoInSceneWindow extends UIBase {
super.onInit();
FacilityInfoInSceneWindow.instance = this;
// this.three = ThreeDimensionalHomeComponent.instance;
this.three = PlanComponent.instance;
// EventManager.addListener(Event_ModelInfoChange, this.onModelInfoChange);
GizmoTool.onPickMeshInfoObservable.add(this.onClickModel);
this.currentFacility = [];
this.initKeyboardInput();
this.initDragInput();
this.initPickEvent();
}
@ -261,6 +280,7 @@ export class FacilityInfoInSceneWindow extends UIBase {
GizmoTool.onPickMeshInfoObservable.removeCallback(this.onClickModel);
}
//#endregion
//#region 键盘输入
/**
@ -280,14 +300,7 @@ export class FacilityInfoInSceneWindow extends UIBase {
onKeyboardInput(eventData: Event_KeyboardInput) {
if (eventData.data.key == "Delete") // 删除。 后期看是否加入 Backspace 退格
{
//改由前端完成快捷键删除
// if (this.currentFacility != null) {
// for (let i = 0; i < this.currentFacility.length; i++) {
// this.currentFacility[i].askDelete(false);
// }
// this.currentFacility = [];
// this.three.getAllCensusList(this.facilityInfoUIItemes || []);
// }
}
else if (eventData.data.key == "X") //室内消火栓吸附墙
{
@ -417,6 +430,154 @@ export class FacilityInfoInSceneWindow extends UIBase {
//#endregion
//#region 鼠标输入
//初始化pick事件
initPickEvent() {
SceneManager.Instance.scene.onPointerObservable.add(
this.onPointerObservable
);
}
//鼠标交互监听
onPointerObservable(eventData: PointerInfo, eventState: EventState) {
let instance = FacilityInfoInSceneWindow.instance;
switch (eventData.type) {
case PointerEventTypes.POINTERUP:
if (eventData.event.button == 0) { //左键正常
if (eventData.pickInfo.hit && !SceneManager.s_isPointerDrag) {
instance.selectJYJFrom3D(eventData.pickInfo);
}
}
else { //右键
}
break;
case PointerEventTypes.POINTERPICK:
// console.log(eventData.event);
break;
}
}
/**
*
*/
static readonly c_selectJYJColor = Color3.Green();
/**
*
*/
currentSelectJYJInfo: ModelInfo_facility;
/**
*
* @param pickInfo null
*/
selectJYJFrom3D(pickInfo: PickingInfo) {
if (this.currentSelectJYJInfo != null) {
let facilityItem: FacilityInfoUIItem = FacilityInfoInSceneWindow.instance.getFacilityItem(this.currentSelectJYJInfo);
facilityItem.onSelect(false);
// this.playJYJSelectEffect(false, this.currentSelectJYJInfo);
this.currentSelectJYJInfo = null;
}
if (pickInfo == null) {
return;
}
let allJYJInfo: ModelInfo_facility[] = [];
try {
let facilityInfosByType = BuildingWindow.instance.currentBuidngItem.buildingInfo.ModelInfo.facilityInfos;
let currentMoudle = BuildingWindow.instance.currentJYZInfoMoudleType;
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) {
allJYJInfo = allJYJInfo.concat(facilityInfosByType[i].facilityInfo);
}
}
} catch (error) {
console.log("点击没找到", error);
}
let result: ModelInfo_facility = null;
for (let i = 0; i < allJYJInfo.length; i++) {
let childMesh = allJYJInfo[i].models;
childMesh.push(allJYJInfo[i].modelBox);
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);
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());
}
}
/**
*
* @param play false,
*/
playJYJSelectEffect(play: boolean, facilityInfo: ModelInfo_facility) {
//if (play) {
let facilityData = facilityInfo.modelData as ModelData_facility;
if (facilityData.facilityType != FacilityType.JY_JYJ &&
facilityData.facilityType != FacilityType.JY_YG) {
//只有加油机和油罐有高亮显示和取消
return;
}
//}
if (play) {
this.currentSelectJYJInfo = facilityInfo;
//正在展示加油机或油罐
if (BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.JYJ
|| BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.YG) {
SceneManager.Instance.removeFromHighLight(facilityInfo.modelBox as Mesh);
}
SceneManager.Instance.addToHighLight(facilityInfo.modelBox as Mesh, FacilityInfoInSceneWindow.c_selectJYJColor);
}
else {
SceneManager.Instance.removeFromHighLight(facilityInfo.modelBox as Mesh);
//正在展示加油机或油罐
if (BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.JYJ
|| BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.YG) {
SceneManager.Instance.addToHighLight(facilityInfo.modelBox as Mesh, ModelInfo_facility.c_hightLightColor);
}
}
}
//#endregion
//创建所有设备UI
createAllFacilities(facilityByType: FacilityInfoByType[]) {
this.clearFacilityInfoUIItemes();

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

@ -117,8 +117,8 @@ export class MarkWindow extends UIBase {
isShowProperty3d: boolean = true;
/**
*
*/
*
*/
isShowWaterSource = false;
//#region 生命周期
@ -145,7 +145,9 @@ export class MarkWindow extends UIBase {
this.weatherTool = new WeatherTool(SceneManager.Instance.defaultCamera, SceneManager.Instance.scene);
SceneManager.Instance.scene.onBeforeRenderObservable.add(() => {
instance.onUpdateShow();
})
}
@ -623,9 +625,9 @@ export class MarkWindow extends UIBase {
}
/**
*
* @param temperature
*/
*
* @param temperature
*/
changeNature_windDirection(windDirection: WindDirectionType) {
if (this.currentMarkNodeInfo == null) {
return;
@ -635,9 +637,9 @@ export class MarkWindow extends UIBase {
}
/**
*
* @param temperature
*/
*
* @param temperature
*/
changeNature_windPower(windPower: number) {
if (this.currentMarkNodeInfo == null) {
return;
@ -646,7 +648,77 @@ export class MarkWindow extends UIBase {
}
/**
*
* @param play false
*/
playOrPauseShow(play: boolean) {
}
/**
*
*/
skipToNode(nodeID: string) {
}
//#endregion
//#region 演出系统
/**
*
*/
currentShowTime: number;
/**
*
*/
totalShowTime: number;
/**
*
*/
isPlayingShow: boolean = false;
/**
*
* @param id
*/
playMarkNode(id: number) {
//通知前端
}
/**
*
*/
onUpdateShow() {
if (this.isPlayingShow) {
if (this.currentShowTime > 0) {
this.currentShowTime -= SceneManager.Instance.scene.deltaTime * 0.001;
if (this.currentShowTime <= 0) {
let l_currentMarkNodeData: MarkNodeData = this.currentMarkNodeInfo.nodeData;
//播放下一个节点
this.getNextNode(l_currentMarkNodeData.id);
}
}
}
}
//#endregion
@ -904,6 +976,13 @@ export class MarkWindow extends UIBase {
return result;
}
/**
* null表示没有了
*/
getNextNode(id: number) {
let result: MarkNodeInfo = null;
return result;
}
//#endregion

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

@ -18,8 +18,12 @@
<!-- 基本信息 -->
<!-- 加油机 -->
<div class="publicBox refueller" *ngIf="beforeFence === 1">
<div class="interval">
<p class="title">1类加油机</p>
<div class="interval" *ngFor="let item of FacilityList" (click)="selectFacility(item)">
<!-- 选中样式 -->
<div class="positionLeftTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionLeftBottom" *ngIf="selectFacilityId === item.getID()"></div>
<div class="positionRightTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionRightBottom" *ngIf="selectFacilityId === item.getID()"></div>
<!-- 选中样式 -->
<p class="title"><input type="text" class="tableInput" [(ngModel)]="item.getPropertyData().name"></p>
<div class="table">
<div class="tableHeader">
<p>品牌</p>
@ -29,11 +33,16 @@
<p>油泵类型</p>
</div>
<div class="tableContent">
<p>超大牌</p>
<p>2</p>
<p>4</p>
<p>92#</p>
<p>自吸泵</p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().brand"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().superBrand"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().oilGunNum"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().oilProductNo"></p>
<p style="padding-left: 8px;">
<nz-select class="tableSelect" [nzBorderless]="true" [nzDisabled]="!editModel" [(ngModel)]="item.getPropertyData().oilPumpType">
<nz-option nzValue="zxb" nzLabel="自吸泵"></nz-option>
<nz-option nzValue="qyb" nzLabel="潜油泵"></nz-option>
</nz-select>
</p>
</div>
</div>
</div>
@ -41,8 +50,12 @@
<!-- 加油机 -->
<!-- 油罐设备 -->
<div class="publicBox refueller oilTank" *ngIf="beforeFence === 2">
<div class="interval">
<p class="title">1号油罐</p>
<div class="interval" *ngFor="let item of FacilityList" (click)="selectFacility(item)">
<!-- 选中样式 -->
<div class="positionLeftTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionLeftBottom" *ngIf="selectFacilityId === item.getID()"></div>
<div class="positionRightTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionRightBottom" *ngIf="selectFacilityId === item.getID()"></div>
<!-- 选中样式 -->
<p class="title"><input type="text" class="tableInput" [(ngModel)]="item.getPropertyData().name"></p>
<div class="table">
<div class="tableHeader">
<p>油品品号</p>
@ -53,12 +66,18 @@
<p>油罐类型</p>
</div>
<div class="tableContent">
<p>92#</p>
<p>200L</p>
<p>180L</p>
<p>1</p>
<p>独立罐区</p>
<p>防渗罐池</p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().oilProductNo"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().oilTankVolume"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().safeVolume"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().quantity"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().tankFarm"></p>
<p style="padding-left: 8px;">
<nz-select class="tableSelect" [nzBorderless]="true" [nzDisabled]="!editModel" [(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-select>
</p>
</div>
</div>
</div>
@ -66,7 +85,10 @@
<!-- 油罐设备 -->
<!-- 消防设施 -->
<div class="publicBox fireFacilities" *ngIf="beforeFence === 3">
<nz-tree #nzTreeComponent [nzData]="treeData"></nz-tree>
<nz-tree [nzData]="treeData" [nzTreeTemplate]="nzTreeTemplate" (nzClick)="nzClick($event)"></nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeRow"><p>{{node.title}}</p><p><i nz-icon nzType="eye" nzTheme="outline" *ngIf="node.isSelected"></i>{{getFacilityNum(node.key)}}</p></div>
</ng-template>
</div>
<!-- 消防设施 -->
</div>

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

@ -33,8 +33,11 @@
}
}
.title{ font-size: 16px; height: 20px; line-height: 20px; margin-bottom: 20px; } //头部header
.publicBox{ width: 100%; height: 100%; overflow-y: auto; padding: 0 20px; }
.title{ font-size: 16px; height: 20px; line-height: 20px; margin-bottom: 20px; .anticon{ margin-left: 5px; font-size: 16px; } } //头部header
.tableInput{ border: none; outline: none; background-color: transparent; width: 100%; height: 100%; }
.tableSelect{ width: 100%; height: 100%; color: #fff; }
.baseInfo{ //基本信息
.interval{ margin-top: 10px; border-bottom: 1px solid rgb(197, 226, 245); } //分隔div
p{ height: 20px; line-height: 20px; }
@ -44,7 +47,11 @@
.textImage{ margin-bottom: 15px; height: auto; line-height: normal; img{ width: auto; height: 130px; } }
}
.refueller{ //加油机
.interval{ margin-top: 10px; } //分隔div
.interval{ margin-top: 10px; position: relative; cursor: pointer; } //分隔div
.positionLeftTop { position: absolute; width: 10px; height: 10px; left: -5px; top: -5px; border-left: 1px solid #fff; border-top: 1px solid #fff; } //左上角
.positionLeftBottom { position: absolute; width: 10px; height: 10px; left: -5px; bottom: -5px; border-left: 1px solid #fff; border-bottom: 1px solid #fff; } //左下角
.positionRightTop { position: absolute; width: 10px; height: 10px; right: -5px; top: -5px; border-right: 1px solid #fff; border-top: 1px solid #fff; } //右上角
.positionRightBottom { position: absolute; width: 10px; height: 10px; right: -5px; bottom: -5px; border-right: 1px solid #fff; border-bottom: 1px solid #fff; } //右下角
.table{
width: 100%;
border: 1px solid #91CCFF;
@ -64,14 +71,9 @@
}
}
}
.oilTank{ //油管设备
// .oilTank{ //油管设备
}
// }
.fireFacilities{ //消防设施
.ant-tree{
height: 32px;
line-height: 32px;
background-color: transparent;
color: #C4E2FC;
}
.treeRow{ width: 100%; display: flex; height: 30px; line-height: 30px; p:first-child{ flex: 1; }; p{ margin: 0; padding: 0; .anticon{ margin-right: 5px; font-size: 16px; } } }
}

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

@ -1,6 +1,10 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
import { FacilityInfoInSceneWindow } from 'src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window';
import { PlanComponent } from '../plan/plan.component';
import { FacilityInfoUIItem } from "../../babylon/view/facilityinfoinscene-window/facilityinfo-ui-item";
import { ConfigManager } from 'src/app/babylon/controller/config-manager';
import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-facility';
@Component({
selector: 'app-left-domain',
@ -15,16 +19,121 @@ export class LeftDomainComponent implements OnInit {
this.initComponent()
}
editModel: boolean = true; //编辑/查看模式
beforeFence: number; //当前选中功能栏
FacilityList: FacilityInfoUIItem[] = []; //统计设备 list
selectFacilityId: string = null; //选中设备 ID
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
treeData: NzTreeNodeOptions[] = treeData.nodes; //tree data
treeData: NzTreeNodeOptions[] = []; //tree data
//初始化组件
initComponent(type?: number) {
if (type != undefined && type != null) {
this.beforeFence = type
this.handleFacility()
} else {
this.beforeFence = PlanComponent.instance.selectFence
this.handleFacility()
}
}
//处理 设备data
handleFacility() {
let list: FacilityInfoUIItem[] = []
FacilityInfoInSceneWindow.instance.facilityInfoUIItemes.forEach(item=>{
if (this.beforeFence === 1) { //加油机
item.getType() === "JY_JYJ"? list.push(item) : null
} else if (this.beforeFence === 2) { //油罐设备
item.getType() === "JY_YG"? list.push(item) : null
} else if (this.beforeFence === 3) { //消防设施
(item.getType()).slice(0,3) === "XF_"? list.push(item) : null
}
})
this.FacilityList = list
this.selectFacilityId = null
if (this.beforeFence === 3) { //消防设施
this.handleTreeData(this.FacilityList)
}
}
//选中 设备
selectFacility(item: FacilityInfoUIItem) {
if (this.selectFacilityId != item.getID()) {
this.selectFacilityId = item.getID()
FacilityInfoInSceneWindow.instance.selectFacilityItem(item);
} else {
this.selectFacilityId = null
item.onSelect(false)
}
}
//处理 treeData
handleTreeData(list: FacilityInfoUIItem[]) {
this.treeData = []
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: [], }
let treeNode = { title: ConfigManager.getFacilityTypeName(item.getType()), key: item.getType(), selectable: false, }
primaryNode.children.push(treeNode)
this.treeData.push(primaryNode)
} else {
let primaryNode = { title: ConfigManager.getFacilityTypeName(item.getType()), key: item.getType(), selectable: false, }
this.treeData.push(primaryNode)
}
} else { //存在
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)
}
}
})
//编辑模式
if (this.editModel) {
let isFind = this.treeData.find(item=>{ return item.key === 'XF_MHQ' })
if (!isFind) {
let primaryNode = { title: '灭火器', key: 'XF_MHQ', selectable: false, }
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 (!isFind) {
let primaryNode = { title: ConfigManager.getFacilityTypeName(FacilityType[facility]), key: facility, selectable: false, }
this.treeData.push(primaryNode)
}
}
}
}
//编辑模式
}
//获取设备 数量
getFacilityNum(type: string): number {
let num = 0
this.FacilityList.forEach(item=>{
item.getType().includes(type)? num = num + 1 : null
})
return num
}
//点击tree节点
nzClick(event: NzFormatEmitEvent) {
if (event.node.key != 'XF_MHQ') {
event.node.isSelected = !event.node.isSelected
if (event.node.isSelected) { //显示当前, 隐藏所有
FacilityInfoInSceneWindow.instance.showFacilityByType(null, false)
FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[event.node.key], event.node.isSelected)
} else { //显示所有
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) })
}
})
}
}
}
@ -43,29 +152,5 @@ export class LeftDomainComponent implements OnInit {
}
export class treeData {
static nodes: NzTreeNodeOptions[] = [
{
title: '灭火器',
key: '1',
selectable: false,
children: [
{ title: '4KG手提干粉灭火器', key: '1', selectable: false, },
{ title: '4KG手提泡沫灭火器', key: '2', selectable: false, },
{ title: '4KG手提二氧化碳灭火器', key: '3', selectable: false, },
{ title: '35KG手推灭火器', key: '4', selectable: false, },
]
},
{
title: '灭火毯',
key: '2',
selectable: false,
children: []
},
{
title: '消防锹',
key: '3',
selectable: false,
children: []
},
];
static nodes: NzTreeNodeOptions[] = []
}

3
src/app/pages/login/login.component.ts

@ -3,9 +3,9 @@ import { HttpClient } from '@angular/common/http'
import { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from '../../service/cache-token.service'//引入服务
import { CookieService } from 'ngx-cookie-service';//cookie插件
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
@ -28,6 +28,7 @@ export class LoginComponent implements OnInit {
errmsg: string = ''; //错误信息
//跳转注册页面
toRegister() {
this.router.navigate(['/register'])

8
src/app/pages/pages.module.ts

@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { A11yModule } from '@angular/cdk/a11y';
import { DragDropModule } from '@angular/cdk/drag-drop';
@ -37,6 +37,8 @@ import { OilStationInfoComponent } from './oil-station-info/oil-station-info.com
import { LeftDomainComponent } from './left-domain/left-domain.component';
import { AddequipmentComponent } from './equipment-info/addequipment/addequipment.component';
import { EditequipmentComponent } from './equipment-info/editequipment/editequipment.component';
@NgModule({
declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent, TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent, AddequipmentComponent, EditequipmentComponent],
imports: [
@ -67,6 +69,8 @@ import { EditequipmentComponent } from './equipment-info/editequipment/editequip
NzSpinModule,
NzTreeModule
],
entryComponents :[AddequipmentComponent,EditequipmentComponent]
entryComponents: [AddequipmentComponent, EditequipmentComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class PagesModule { }

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

@ -1,5 +1,5 @@
<div class="loading" *ngIf="isShowLoading"><nz-spin nzSimple [nzSize]="'large'"></nz-spin></div>
<div class="content">
<div class="content" id="threeDimensional">
<div class="header">
<button *ngFor="let item of allFence; let key = index;" [ngClass]="{'selectFence': selectFence === key}" (click)="toggleHeaderFence(key)">{{item}}</button>

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

@ -269,11 +269,13 @@ export class PlanComponent implements OnInit {
}
beforeOnePropertyData: FacilityInfoUIItem = null; //当前选择 设备
beforeOnefacilityInfo: string = null; //当前选择 设备ID
//获取选择设备 属性
getPropertyData(e: FacilityInfoUIItem) {
//选中 设备
selectProperty(e: FacilityInfoUIItem) {
this.beforeOnePropertyData = e
if (this.isShowChildComponent && this.leftDomain) {
this.leftDomain.selectFacilityId = e.getID()
}
}
selectRightTopFast: number = 0; //当前选择功能 快捷栏

BIN
src/assets/images/facility/in/JY_JYJ.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/assets/images/facility/in/JY_YG.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
src/assets/images/facility/out/DWBZ.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
src/assets/images/facility/out/PL.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
src/assets/images/facility/out/QY.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
src/assets/images/facility/out/TPBZ.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

26
src/styles.scss

@ -102,16 +102,22 @@ h1 {
font-size: 16px;
}
//滚动条样式
::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-thumb {
background-image: linear-gradient(#2495f8,#1c73c2,#02233f,);
}
::-webkit-scrollbar-track {
background-color: #0d4070;
//三维场景
#threeDimensional {
.ant-tree{ color: #C4E2FC; }
.ant-tree,.ant-tree-node-content-wrapper:hover,.ant-tree-node-content-wrapper.ant-tree-node-selected { background-color: transparent; }
.ant-tree-node-content-wrapper { width: 100%; }
.ant-select-single:not(.ant-select-customize-input) .ant-select-selector { border: none; border-radius: 0px; }
//滚动条样式
::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-thumb {
background-image: linear-gradient(#2495f8,#1c73c2,#02233f,);
}
::-webkit-scrollbar-track {
background-color: #0d4070;
}
}

6
yarn.lock

@ -122,7 +122,7 @@
resolved "https://registry.npmmirror.com/@angular/animations/download/@angular/animations-9.1.13.tgz?cache=0&sync_timestamp=1634753072212&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2F%40angular%2Fanimations%2Fdownload%2F%40angular%2Fanimations-9.1.13.tgz#561305f7bf4a7a5ea3ff172d6fac31615667acb0"
integrity sha1-VhMF979Kel6j/xctb6wxYVZnrLA=
"@angular/cdk@^9.0.0":
"@angular/cdk@^9.0.0", "@angular/cdk@^9.2.4":
version "9.2.4"
resolved "https://registry.npmmirror.com/@angular/cdk/download/@angular/cdk-9.2.4.tgz#8413958bd275e4c34be3b96f56444671dd30ba93"
integrity sha1-hBOVi9J15MNL47lvVkRGcd0wupM=
@ -4976,9 +4976,9 @@ ecc-jsbn@~0.1.1:
jsbn "~0.1.0"
safer-buffer "^2.1.0"
echarts@^4.6.0:
echarts@^4.9.0:
version "4.9.0"
resolved "https://registry.nlark.com/echarts/download/echarts-4.9.0.tgz?cache=0&sync_timestamp=1632191355993&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fecharts%2Fdownload%2Fecharts-4.9.0.tgz#a9b9baa03f03a2a731e6340c55befb57a9e1347d"
resolved "https://registry.npmmirror.com/echarts/download/echarts-4.9.0.tgz?cache=0&sync_timestamp=1635741929711&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fecharts%2Fdownload%2Fecharts-4.9.0.tgz#a9b9baa03f03a2a731e6340c55befb57a9e1347d"
integrity sha1-qbm6oD8Doqcx5jQMVb77V6nhNH0=
dependencies:
zrender "4.3.2"

Loading…
Cancel
Save