diff --git a/src/app/babylon/controller/data-manager.ts b/src/app/babylon/controller/data-manager.ts index 1d3b41f..be125dc 100644 --- a/src/app/babylon/controller/data-manager.ts +++ b/src/app/babylon/controller/data-manager.ts @@ -283,10 +283,9 @@ export class DataManager { key: string ): string { let result = - institutionKey.toLocaleLowerCase() - '/' + - ServeManager.ngAssetsPath + + institutionKey.toLocaleLowerCase() + '/' + + ServeManager.ngAssetsPath + buildingKey.toLocaleLowerCase() + '/' + key + @@ -302,7 +301,6 @@ export class DataManager { institutionKey.toLocaleLowerCase() + '/' + ServeManager.ngAssetsPath + - '/' + buildingKey.toLocaleLowerCase() + '/' + ConfigManager.c_reaPath_facilityProperty + diff --git a/src/app/babylon/controller/serve-manager.ts b/src/app/babylon/controller/serve-manager.ts index 882f507..7bb055c 100644 --- a/src/app/babylon/controller/serve-manager.ts +++ b/src/app/babylon/controller/serve-manager.ts @@ -33,9 +33,8 @@ export class ServeManager { ) => void, onError?: (key: string, error: any) => void) { this.buildingBISrv.getBuildingBasicInfos(key) .subscribe(data => { - if (onSuccess) { - onSuccess(key, data); + onSuccess(key, JSON.parse((data as any).result)); } }, error => { console.error("From serve" + key + "===" + error); @@ -49,14 +48,14 @@ export class ServeManager { saveInstitutionData(institutionData: any, key: string = 'test', onSuccess?: (key: string, result: string ) => void, onError?: (key: string, error: string) => void) { - let data = classToPlain(institutionData); + let l_data = classToPlain(institutionData); - console.log("保存单位", data); - this.buildingBISrv.postBuildingBasicInfos(key, data) + console.log("保存单位", l_data); + this.buildingBISrv.postBuildingBasicInfos(key, l_data) .subscribe(data => { - ModeManager.log("保存单位成功:" + key); + console.log("保存单位成功:" + key, l_data); if (onSuccess) { - onSuccess(key, data); + onSuccess(key, data.result); } if (key != "InsList") { //ThreeDimensionalHomeComponent.instance.openSnackBar("保存单位成功"); @@ -96,7 +95,7 @@ export class ServeManager { .subscribe(data => { ModeManager.log(data); if (onSuccess) { - onSuccess(institutionID, data); + onSuccess(institutionID, JSON.parse((data as any).result)); } }, (error) => { if (error instanceof HttpErrorResponse) { @@ -133,7 +132,7 @@ export class ServeManager { .subscribe(data => { ModeManager.log("保存标绘信息成功:" + allMarkPlanData.institutionID); if (onSuccess) { - onSuccess(allMarkPlanData.institutionID, data); + onSuccess(allMarkPlanData.institutionID, data.result); } // ThreeDimensionalHomeComponent.instance.openSnackBar("保存标绘信息成功"); // alert("保存标绘信息成功"); @@ -153,6 +152,7 @@ export class ServeManager { //队列性,批量上传 uploadFile(index: number, files: File[], resPath_out, onOneSuccess: (name: string, path: string, file: File) => void, onEnd: () => void) { if (index < files.length) { + //console.log("上传文件", files[index].name); ServeManager.instance.openFileSelect(files[index], resPath_out, (name: string, path: string, file: File) => { onOneSuccess(name, path, file); this.uploadFile(index + 1, files, resPath_out, onOneSuccess, onEnd); @@ -196,6 +196,7 @@ export class ServeManager { let dataObj = data as any; let fileName = dataObj.fileName; let filePath: string = dataObj.objectName;//此路径不全,前面缺少ObjectsService.baseUrl,这部分不可序列化,要在运行时拼接 + //console.log("上传完成,地址为", filePath); filePath = filePath.replace(fileName, "");//去掉结尾的文件名 //filePath = ObjectsService.baseUrl + filePath; ServeManager.instance.onGetPostFileResult(fileName, filePath, file); @@ -222,8 +223,9 @@ export class ServeManager { * @param file */ postFileByMul(file: File) { - ServeManager.instance.objectsSrv.postFile_MultipartUpload(ServeManager.ngAssetsPath + this.postFilePath, file).then((value) => { + ServeManager.instance.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => { let dataObj = value as any; + console.log("分块上传完成", dataObj.filePath); dataObj.filePath = dataObj.filePath.replace(dataObj.name, ""); //去掉结尾的文件名 ServeManager.instance.onGetPostFileResult(dataObj.fileName, dataObj.filePath, file); }); diff --git a/src/app/babylon/model/data/institution/facility/all-facility-data.ts b/src/app/babylon/model/data/institution/facility/all-facility-data.ts index b6decfa..cd55fe6 100644 --- a/src/app/babylon/model/data/institution/facility/all-facility-data.ts +++ b/src/app/babylon/model/data/institution/facility/all-facility-data.ts @@ -55,6 +55,7 @@ export class AllFacilityData { //新建设备信息 static newFacilityData(type: FacilityType, posType: FacilityPosType, allFacilityData: AllFacilityData, isModel: boolean = true): ModelData_facility { + return; let name = ConfigManager.getFacilityTypeName(type); let result = new ModelData_facility(type.toString(), type, name, DataManager.getResName_facility(type) + ".gltf", new TransformData(), posType, isModel); switch (posType) { diff --git a/src/app/babylon/tool/babylon-tool.ts b/src/app/babylon/tool/babylon-tool.ts index 73fcd5d..b340304 100644 --- a/src/app/babylon/tool/babylon-tool.ts +++ b/src/app/babylon/tool/babylon-tool.ts @@ -129,7 +129,7 @@ export class BabylonTool { path = ConfigManager.c_resPath_assetsRoot + rootUrl; } else { - path = ObjectsService.baseUrl + path; //根据环境,动态改变桶名 + path = ObjectsService.getFullPath(path); //根据环境,动态改变桶名 } console.log("异步加载模型" + path + sceneFilename); diff --git a/src/app/babylon/view/building-window/building-window.ts b/src/app/babylon/view/building-window/building-window.ts index de90e15..9d85784 100644 --- a/src/app/babylon/view/building-window/building-window.ts +++ b/src/app/babylon/view/building-window/building-window.ts @@ -1,4 +1,5 @@ +import { PlanComponent } from "src/app/pages/plan/plan.component"; import { DataManager } from "../../controller/data-manager"; import { InfoManager } from "../../controller/info-manager"; import { SceneManager } from "../../controller/scene-manager"; @@ -26,7 +27,7 @@ export class BuildingWindow extends UIBase { currentBuidngItem: BuildingUIItem; //当前正在操作的建筑 - // three: ThreeDimensionalHomeComponent;//前端组件 + three: PlanComponent;//前端组件 @@ -97,9 +98,9 @@ export class BuildingWindow extends UIBase { let resPath_out = DataManager.getResPath_building( DataManager.institutionData.normalData.key.toLowerCase(), normalData.key.toLocaleLowerCase(), - buildingData.normalData.key + "outDoor" ); - // console.log("新资源路径" + resPath_out); + console.log("新资源路径" + resPath_out); let buildingWindow = this; let manifestFile: File = null; @@ -211,7 +212,7 @@ export class BuildingWindow extends UIBase { - // this.three = ThreeDimensionalHomeComponent.instance; + this.three = PlanComponent.instance; // this.three.getAllBuilding(this); } diff --git a/src/app/babylon/view/facility-window/facility-window.ts b/src/app/babylon/view/facility-window/facility-window.ts index 08e88d1..b09bb1f 100644 --- a/src/app/babylon/view/facility-window/facility-window.ts +++ b/src/app/babylon/view/facility-window/facility-window.ts @@ -156,7 +156,7 @@ export class FacilityWindow extends UIBase { let instance = this; //为了避免多个模型同时加载、导致indexDB创建冲突,所以先加载一个,保证indexDB创建完成 - BabylonTool.importMeshSync(null, "assets/facilities/outdoor/gd/", "GD.gltf", undefined, "GD_indexDB", (meshes) => { + BabylonTool.importMeshSync(null, "mesh/indexdb/gd/", "GD.gltf", undefined, "GD_indexDB", (meshes) => { meshes[0].dispose(); for (let i = 0; i < facilities.length; i++) { diff --git a/src/app/pages/plan/plan.component.html b/src/app/pages/plan/plan.component.html index bfe24c5..39368d4 100644 --- a/src/app/pages/plan/plan.component.html +++ b/src/app/pages/plan/plan.component.html @@ -7,12 +7,12 @@