diff --git a/README.md b/README.md index 81cb8db..1644865 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,30 @@ # 中国石化加油站项目 +## 🌼v1.0.3 主要变化 修改 bug,部署测试 + +### 🌻 简介 + +> 时间:2021、12、8 周三 +> 修复 bug,三维优化 + +### 🌻 详情 + +> 前端部分 + +- [🚩 重大变更] 无 +- [🌱 新增] 无 +- [🍀 完善] 无 + +> 三维部分 + +- [🚩 重大变更] 无 +- [🌱 新增] 无 +- [🍀 完善] 修复分块上传路径拼接使用错误变量的问题 +- [🍀 完善] 优化应急中的操作: 取消模型不可见的外框可以被选中的问题。 增加右键取消高亮的功能。 非选中状态下,不再允许拖拽。 +- [🍀 完善] 尝试修复因升级 obs(解决大小写变换问题)而导致的消防车和消防员加载不出来的问题 +- [🍀 完善] 延迟应急中人物任务 ui 的更新时间,尝试修复背景框自适应不正确的问题 +- [🍀 完善] 限制应急处置下、上传视频的格式 + ## 🌼v1.0.2 主要变化 修改 bug,部署测试 ### 🌻 简介 diff --git a/src/app/babylon/controller/event-manager/event-manager.ts b/src/app/babylon/controller/event-manager/event-manager.ts index c623545..854b93d 100644 --- a/src/app/babylon/controller/event-manager/event-manager.ts +++ b/src/app/babylon/controller/event-manager/event-manager.ts @@ -74,7 +74,6 @@ export class EventManager { let instance = EventManager.getEvent(c); - console.log("添加监听", instance.key); return instance.observable.add(callback, mask, insertFirst, scope, unregisterOnFirstCall); } @@ -136,7 +135,6 @@ class EventContainer { //this.key = c.name; this.key = obj.getTypeKey(); - console.log("EventContainer===" + this.key); this.observable = new Observable(); } } \ No newline at end of file diff --git a/src/app/babylon/controller/serve-manager.ts b/src/app/babylon/controller/serve-manager.ts index 327df3d..99f774d 100644 --- a/src/app/babylon/controller/serve-manager.ts +++ b/src/app/babylon/controller/serve-manager.ts @@ -213,9 +213,10 @@ 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; + console.log("上传完成,地址为", filePath, fileName); ServeManager.instance.onGetPostFileResult(fileName, filePath, file); resolve('success') }); @@ -243,7 +244,8 @@ export class ServeManager { 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, ""); //去掉结尾的文件名 + dataObj.filePath = dataObj.filePath.replace(dataObj.fileName, ""); //去掉结尾的文件名 + console.log(dataObj.filePath, dataObj.fileName, dataObj.name); ServeManager.instance.onGetPostFileResult(dataObj.fileName, dataObj.filePath, file); }); diff --git a/src/app/babylon/model/info/mark/model-info-mark.ts b/src/app/babylon/model/info/mark/model-info-mark.ts index 8a79389..665f505 100644 --- a/src/app/babylon/model/info/mark/model-info-mark.ts +++ b/src/app/babylon/model/info/mark/model-info-mark.ts @@ -141,8 +141,9 @@ export class ModelInfo_mark extends ModelInfo { this.uiFollowHead = Button.CreateSimpleButton('followHead_' + this.key, ""); UIManager.Instance.uiRoot.addControl(this.uiFollowHead); this.uiFollowHead.width = this.c_uiDefaultWidth + "px"; - this.uiFollowHead.height = "50px"; + this.uiFollowHead.height = "55px"; this.uiFollowHead.thickness = 0; + this.uiFollowHead.adaptWidthToChildren = true; this.uiFollowHead.linkWithMesh(this.headMesh); this.uiFollowHead.onPointerClickObservable.add(() => { MarkWindow.instance.selectMarkDataFrom3d(instance, true); @@ -161,6 +162,9 @@ export class ModelInfo_mark extends ModelInfo { this.uiFollowHead.addControl(this.uiNumber); this.uiNumber.width = 1; this.uiNumber.height = 0.5; + this.uiNumber.paddingTopInPixels = 5; + this.uiNumber.paddingLeft = 5; + this.uiNumber.paddingRight = 5; this.uiNumber.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; this.uiNumber.color = "white"; this.uiNumber.shadowBlur = 2; @@ -171,6 +175,9 @@ export class ModelInfo_mark extends ModelInfo { this.uiFollowHead.addControl(this.uiTask); this.uiTask.width = 1; this.uiTask.height = 0.5; + this.uiTask.paddingBottomInPixels = 2; + this.uiTask.paddingLeft = 5; + this.uiTask.paddingRight = 5; this.uiTask.verticalAlignment = Control.VERTICAL_ALIGNMENT_BOTTOM this.uiTask.color = BabylonUIStyleTool.c_color_3d_blue; this.uiTask.shadowBlur = 1; @@ -178,6 +185,7 @@ export class ModelInfo_mark extends ModelInfo { this.uiTask.resizeToFit = true; this.updateProperty(); + // this.uiFollowHead.linkWithMesh(this.headMesh); } @@ -207,12 +215,13 @@ export class ModelInfo_mark extends ModelInfo { }) } else { - //this.pointerDragBehavior.enabled = true; + this.pointerDragBehavior.enabled = true; } - //特效类、灭火器类,要出现坐标轴 + //特效类、灭火器类、文字标注,要出现坐标轴 if (this.markData.markKindType == MarkKindType.Effect - || TsTool.stringContain(this.markData.type, "MHQ")) { + || TsTool.stringContain(this.markData.type, "MHQ") + || this.markData.type == MarkType.WZ) { GizmoTool.onPickMeshInfoObservable.notifyObservers(this); } else { @@ -227,7 +236,7 @@ export class ModelInfo_mark extends ModelInfo { //GizmoTool.onPickMeshInfoObservable.notifyObservers(null); SceneManager.Instance.removeFromHighLight(this.modelBox as Mesh) if (this.pointerDragBehavior != null) { - //this.pointerDragBehavior.enabled = false; //停止拖拽 + this.pointerDragBehavior.enabled = false; //停止拖拽 } } @@ -253,18 +262,18 @@ export class ModelInfo_mark extends ModelInfo { if (this.markData.property.taskType != MarkTask.None) { this.uiNumber.text = this.markData.property.getInstitutionNum(); this.uiTask.text = this.markData.property.task; - + this.uiNumber let instance = this; - setTimeout(() => { - if (instance.uiNumber == null) { - return; - } - let numWidth = instance.uiNumber.widthInPixels; - let taskWidth = instance.uiTask.widthInPixels; - let maxWidth = Math.max(numWidth, taskWidth, this.c_uiDefaultWidth); - instance.uiFollowHead.widthInPixels = maxWidth; - // instance.uiFollowHeadBg.widthInPixels = maxWidth; - }, (50)); + // setTimeout(() => { + // if (instance.uiNumber == null) { + // return; + // } + // let numWidth = instance.uiNumber.widthInPixels; + // let taskWidth = instance.uiTask.widthInPixels; + // let maxWidth = Math.max(numWidth, taskWidth, this.c_uiDefaultWidth); + // instance.uiFollowHead.widthInPixels = maxWidth; + // // instance.uiFollowHeadBg.widthInPixels = maxWidth; + // }, (100)); // console.log("喷水", this.taskNeedWaterParticle()); if (this.taskNeedWaterParticle()) { diff --git a/src/app/babylon/view/building-window/building-window.ts b/src/app/babylon/view/building-window/building-window.ts index 5669b94..ac5c905 100644 --- a/src/app/babylon/view/building-window/building-window.ts +++ b/src/app/babylon/view/building-window/building-window.ts @@ -249,8 +249,9 @@ export class BuildingWindow extends UIBase { } else {//恢复查看状态 - this.recoverMoudleShow(type); + } + this.recoverMoudleShow(type); } else { if (type == JYZInfoMoudleType.YJCZ) { diff --git a/src/app/babylon/view/mark-window/mark-window.ts b/src/app/babylon/view/mark-window/mark-window.ts index 9533696..274640a 100644 --- a/src/app/babylon/view/mark-window/mark-window.ts +++ b/src/app/babylon/view/mark-window/mark-window.ts @@ -7,9 +7,9 @@ import { DataManager } from "../../controller/data-manager"; import { EventManager } from "../../controller/event-manager/event-manager"; import { Event_GetAllMarkPlanData } from "../../controller/event-manager/events/event-get-markplandata-success"; import { Event_KeyboardInput } from "../../controller/event-manager/events/event-keyboard-input"; -import { Event_LoadingChange } from "../../controller/event-manager/events/event-loading-change"; import { Event_MarkInfoChange, MarkInfoChangeType } from "../../controller/event-manager/events/event-mark-info-change"; import { InputController } from "../../controller/inputController"; +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"; @@ -799,7 +799,7 @@ export class MarkWindow extends UIBase { onPointerObservable(eventData: PointerInfo, eventState: EventState) { let instance = MarkWindow.instance; - if (!instance.isShow) { + if (!instance.isShow || ModeManager.currentMode != ModeType.Edit) { //查看模式不能调整预案 return; } @@ -856,6 +856,10 @@ export class MarkWindow extends UIBase { // instance.selectMarkDataFrom3d(instance.currentMarkInfo, false); //暂时没有右键取消选中实例的功能 if (!SceneManager.s_isPointerDrag) { instance.selectMarkDataPrefabFrom3d(instance.currentMarkDataPrefab, false) + if (instance.currentMarkNodeInfo != null) { + //取消选中 + instance.selectMarkDataFrom3d(instance.currentMarkInfo, false); + } } @@ -1161,8 +1165,8 @@ export class MarkWindow extends UIBase { markInfo = meshPoolInfo.modelInfo as ModelInfo_mark; markInfo.belongToBuilding = buildingInfo; instance.setMarkTransform(isLocalPos, isNew, buildingInfo, markInfo.modelBox, markInfo); - markInfo.modelBox.isPickable = true; - console.log("成功创建模型", markInfo); + // markInfo.modelBox.isPickable = true; //避免超大的透明选中区 + // console.log("成功创建模型", markInfo); instance.currentMarkNodeInfo.addMarkInfo(markInfo, isNew); markInfo.onCreate(isNew); Event_MarkInfoChange.dispatch(MarkInfoChangeType.Create, markInfo); diff --git a/src/app/pages/plan/plan.component.html b/src/app/pages/plan/plan.component.html index 14b0173..2a060fa 100644 --- a/src/app/pages/plan/plan.component.html +++ b/src/app/pages/plan/plan.component.html @@ -19,7 +19,7 @@ - + @@ -157,7 +157,7 @@

- +
@@ -170,10 +170,10 @@
- +
- +
diff --git a/src/app/pages/plan/plan.component.scss b/src/app/pages/plan/plan.component.scss index 9e543d7..f548096 100644 --- a/src/app/pages/plan/plan.component.scss +++ b/src/app/pages/plan/plan.component.scss @@ -339,6 +339,7 @@ p{ margin: 0; height: 20px; line-height: 18px; } 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; } + .lookModelTextarea{ background: transparent; border: none; } } .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%; } } diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts index d19eebb..649fa7b 100644 --- a/src/app/pages/plan/plan.component.ts +++ b/src/app/pages/plan/plan.component.ts @@ -732,6 +732,10 @@ export class PlanComponent implements OnInit { if (e.target.files.length) { let maxSize = 30 * 1024 * 1024 //限制30MB let file = e.target.files[0] + if (isVideo && !file.name.toLowerCase().includes(".mp4") && !file.name.toLowerCase().includes(".ogg") && !file.name.toLowerCase().includes(".webm")) { //视频格式限制 + this.message.info("上传视频限制为mp4/ogg/webm格式"); + return + } if (file.size > maxSize) { //超出限制 this.message.info("上传资源需小于30MB"); return @@ -739,7 +743,7 @@ export class PlanComponent implements OnInit { this.isShowLoading = true //打开遮罩 let institutionKey = `${this.companyData.id}` || "ceshi"; //单位id let resType = isVideo ? ResType.Video : ResType.Texture - let key = `${(new Date()).getMonth() + 1}-${(new Date()).getDate()}-${(new Date()).getHours()}` + let key = `${(new Date()).getFullYear()}-${(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) => { //上传 if (!isVideo) { //img