刘向辉 3 years ago
parent
commit
45b7adc6d5
  1. 2
      src/app/babylon/controller/mode-manager.ts
  2. 11
      src/app/babylon/controller/scene-manager.ts
  3. 2
      src/app/babylon/controller/serve-manager.ts
  4. 1
      src/app/babylon/tool/gizmo-tool.ts
  5. 9
      src/app/babylon/tool/load-tool.ts
  6. 7
      src/app/babylon/view/building-window/building-window.ts
  7. 13
      src/app/pages/plan/plan.component.ts
  8. 13
      src/app/service/babylon/building-basic-infos.service.ts

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

@ -18,7 +18,7 @@ export class ModeManager {
*
* 使 currentMode 访
*/
private static s_currentMode: ModeType = ModeType.Look;
private static s_currentMode: ModeType = ModeType.Edit;
/**
*

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

@ -58,6 +58,7 @@ import { MarkData_multiArrow_CT, MarkData_multiArrow_JG } from '../model/data/ma
import { ModelInfo_mark_multiArrow } from '../model/info/mark/other/mark-plan-multi-arrow';
import { ModelInfo_mark_particle } from '../model/info/mark/other/mark-plan-particle-info';
import { FacilityPosType, ModelData_facility } from '../model/data/model-data/model-data-facility';
import { LoadTool } from '../tool/load-tool';
//场景管理器
export class SceneManager {
@ -556,7 +557,7 @@ export class SceneManager {
}
SceneManager.endLoadMesh(modelData.resPath, modelData.resName);
let box = SceneManager.importMeshSuccess(newMeshes, particleSystems, skeletons, animationGroups, modelInfo, needBox, modelData);
console.log("加载模型完成", modelData.resName);
//console.log("加载模型完成", modelData.resName);
onSuccess(newMeshes, box, modelInfo);
}, null,
function (scene: Scene, message: string, exception?: any) {
@ -568,14 +569,14 @@ export class SceneManager {
SceneManager.createModel(modelType, modelData, needBox, isNew, tag, onSuccess, onError, l_index);
console.log("重新开始加载" + l_index, modelData);
//console.log("重新开始加载" + l_index, modelData);
console.log(exception);
}
else {
modelInfo.dispose();
console.log(message);
console.log(exception);
// alert("模型加载失败: " + message + "==" + exception);
LoadTool.remove(modelData.resPath + modelData.resName);
console.log(message, exception);
alert("模型加载失败,请刷新页面重试: " + message + "==" + exception);
// alert(exception);
if (onError) {
onError(message)

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

@ -53,7 +53,7 @@ export class ServeManager {
let l_data = classToPlain(institutionData);
console.log("保存单位", l_data);
this.buildingBISrv.postBuildingBasicInfos(key, l_data)
this.buildingBISrv.postBuildingBasicInfos(key, 1, l_data)
.subscribe(data => {
console.log("保存单位成功:" + key, l_data);
if (onSuccess) {

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

@ -199,7 +199,6 @@ export class GizmoTool {
//改变Gizmo目标
static changeGizmoAim(mesh: AbstractMesh, x: boolean = true, y = true, z = true) {
console.trace("改变gizmo");
GizmoTool.s_nowPickAim_mesh = mesh;
GizmoTool.s_gizmoManager.attachToMesh(mesh);
GizmoTool.s_gizmoManager.gizmos.positionGizmo.xGizmo.isEnabled = x;

9
src/app/babylon/tool/load-tool.ts

@ -1,3 +1,4 @@
import { PlanComponent } from "src/app/pages/plan/plan.component";
/**
*
@ -49,16 +50,16 @@ export class LoadTool {
*
*/
static onStart() {
console.log("开始加载");
//ThreeDimensionalHomeComponent.instance.maskLayerService.sendMessage(true)
// console.log("开始加载");
PlanComponent.instance.showLoading(true);
}
/**
*
*/
static onEnd() {
console.log("结束加载");
//ThreeDimensionalHomeComponent.instance.maskLayerService.sendMessage(false)
// console.log("结束加载");
PlanComponent.instance.showLoading(false);
}
}

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

@ -128,7 +128,7 @@ export class BuildingWindow extends UIBase {
file.push(manifestFile); //临时关闭缓存文件
}
PlanComponent.instance.showLoading(true);
ServeManager.instance.uploadFile(0, file, resPath_out, (name: string, path: string, currentfile) => {
if (TsTool.stringContain(name, ".gltf")) {
if (TsTool.stringContain(name, ".gltf.manifest")) {
@ -150,6 +150,7 @@ export class BuildingWindow extends UIBase {
}
}
, () => {
PlanComponent.instance.showLoading(false);
let buildingInfo = buildingWindow.getBuildingInfo(buildingData.normalData.key);
buildingWindow.updateBuildingModel(buildingInfo, true);
// buildingWindow.three = ThreeDimensionalHomeComponent.instance;
@ -506,7 +507,7 @@ export class BuildingWindow extends UIBase {
if (firstType == BuildingType.Environment) {
instance.createOneBuildingItem(firstItem, 0, (uiItem, index) => {
instance.onChangeCurrentBuildingItem(uiItem, false);
uiItem.lookAt(false);
// uiItem.lookAt(false);
if (buildingDatas_Environment.length > 1) {
instance.addBuildings(BuildingType.Environment, 1);
}
@ -519,7 +520,7 @@ export class BuildingWindow extends UIBase {
else {
instance.createOneBuildingItem(firstItem, 0, (uiItem, index) => {
instance.onChangeCurrentBuildingItem(uiItem, false);
uiItem.lookAt(false);
// uiItem.lookAt(false);
if (buildingDatas_mormal.length > 1) {
instance.addBuildings(BuildingType.Normal, 1);
}

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

@ -38,7 +38,7 @@ export class PlanComponent implements OnInit {
public game: Game = new Game();
public beforeOneSatus; //当前 satus
public canvas: HTMLCanvasElement; //canvas 实例
public isShowLoading: boolean = false; //显隐 loading加载条
public isShowLoading: boolean = true; //显隐 loading加载条
ngOnInit(): void {
PlanComponent.instance = this;
@ -365,14 +365,21 @@ export class PlanComponent implements OnInit {
this.message.info(title);
}
/**
*
* @param show
*/
showLoading(show: boolean) {
this.isShowLoading = show;
}
}
// 处置预案 所有图标
export class planIcons {
iconsName: string[] = ["灾情","内部力量","外部力量","其他"]
icons: MarkData[][] = [AllMarkData.CreateAllMarkData().marks_Disaster,AllMarkData.CreateAllMarkData().marks_Inside,AllMarkData.CreateAllMarkData().marks_Outside,AllMarkData.CreateAllMarkData().marks_Other,]
iconsName: string[] = ["灾情", "内部力量", "外部力量", "其他"]
icons: MarkData[][] = [AllMarkData.CreateAllMarkData().marks_Disaster, AllMarkData.CreateAllMarkData().marks_Inside, AllMarkData.CreateAllMarkData().marks_Outside, AllMarkData.CreateAllMarkData().marks_Other,]
}
//创建/编辑 建筑dataType
export class modelBuilding {

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

@ -35,8 +35,8 @@ export class BuildingBasicInfosService {
* @param name
* @param data
*/
postBuildingBasicInfos(name: string, data: object): Observable<any> {
return this.postInfos(this.api_buildingInfo, name, data);
postBuildingBasicInfos(name: string, gasstationId: number, data: object): Observable<any> {
return this.postInfos(this.api_buildingInfo, data, { name: name, gasstationId: gasstationId });
}
/**
@ -53,7 +53,7 @@ export class BuildingBasicInfosService {
* @param data
*/
postMarkData(name: string, data: object): Observable<any> {
return this.postInfos(this.api_sandBox, name, data);
return this.postInfos(this.api_sandBox, data, { name: name });
}
@ -92,14 +92,11 @@ export class BuildingBasicInfosService {
* @param name
* @param data
*/
postInfos(api: string, name: string, data: object) {
let params = {
name: name,
};
postInfos(api: string, body: object, params = {}) {
let headers = this.headers;
return this.http.post<any>(api + this.c_post, `'${JSON.stringify(data)}'`, { headers, params })
return this.http.post<any>(api + this.c_post, `'${JSON.stringify(body)}'`, { headers, params })
.pipe(
catchError((err) => this.handleError(err))
);

Loading…
Cancel
Save