邵佳豪 3 years ago
parent
commit
8569715bdd
  1. 25
      README.md
  2. 2
      src/app/babylon/controller/event-manager/event-manager.ts
  3. 6
      src/app/babylon/controller/serve-manager.ts
  4. 41
      src/app/babylon/model/info/mark/model-info-mark.ts
  5. 3
      src/app/babylon/view/building-window/building-window.ts
  6. 12
      src/app/babylon/view/mark-window/mark-window.ts
  7. 8
      src/app/pages/plan/plan.component.html
  8. 1
      src/app/pages/plan/plan.component.scss
  9. 6
      src/app/pages/plan/plan.component.ts

25
README.md

@ -1,5 +1,30 @@
# 中国石化加油站项目 # 中国石化加油站项目
## 🌼v1.0.3 主要变化 修改 bug,部署测试
### 🌻 简介
> 时间:2021、12、8 周三
> 修复 bug,三维优化
### 🌻 详情
> 前端部分
- [🚩 重大变更] 无
- [🌱 新增] 无
- [🍀 完善] 无
> 三维部分
- [🚩 重大变更] 无
- [🌱 新增] 无
- [🍀 完善] 修复分块上传路径拼接使用错误变量的问题
- [🍀 完善] 优化应急中的操作: 取消模型不可见的外框可以被选中的问题。 增加右键取消高亮的功能。 非选中状态下,不再允许拖拽。
- [🍀 完善] 尝试修复因升级 obs(解决大小写变换问题)而导致的消防车和消防员加载不出来的问题
- [🍀 完善] 延迟应急中人物任务 ui 的更新时间,尝试修复背景框自适应不正确的问题
- [🍀 完善] 限制应急处置下、上传视频的格式
## 🌼v1.0.2 主要变化 修改 bug,部署测试 ## 🌼v1.0.2 主要变化 修改 bug,部署测试
### 🌻 简介 ### 🌻 简介

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

@ -74,7 +74,6 @@ export class EventManager {
let instance = EventManager.getEvent<T>(c); let instance = EventManager.getEvent<T>(c);
console.log("添加监听", instance.key);
return instance.observable.add(callback, mask, insertFirst, scope, unregisterOnFirstCall); return instance.observable.add(callback, mask, insertFirst, scope, unregisterOnFirstCall);
} }
@ -136,7 +135,6 @@ class EventContainer<T extends Event_Base> {
//this.key = c.name; //this.key = c.name;
this.key = obj.getTypeKey(); this.key = obj.getTypeKey();
console.log("EventContainer===" + this.key);
this.observable = new Observable<T>(); this.observable = new Observable<T>();
} }
} }

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

@ -213,9 +213,10 @@ export class ServeManager {
let dataObj = data as any; let dataObj = data as any;
let fileName = dataObj.fileName; let fileName = dataObj.fileName;
let filePath: string = dataObj.objectName;//此路径不全,前面缺少ObjectsService.baseUrl,这部分不可序列化,要在运行时拼接 let filePath: string = dataObj.objectName;//此路径不全,前面缺少ObjectsService.baseUrl,这部分不可序列化,要在运行时拼接
//console.log("上传完成,地址为", filePath);
filePath = filePath.replace(fileName, "");//去掉结尾的文件名 filePath = filePath.replace(fileName, "");//去掉结尾的文件名
//filePath = ObjectsService.baseUrl + filePath; //filePath = ObjectsService.baseUrl + filePath;
console.log("上传完成,地址为", filePath, fileName);
ServeManager.instance.onGetPostFileResult(fileName, filePath, file); ServeManager.instance.onGetPostFileResult(fileName, filePath, file);
resolve('success') resolve('success')
}); });
@ -243,7 +244,8 @@ export class ServeManager {
ServeManager.instance.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => { ServeManager.instance.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => {
let dataObj = value as any; let dataObj = value as any;
console.log("分块上传完成", dataObj.filePath); 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); ServeManager.instance.onGetPostFileResult(dataObj.fileName, dataObj.filePath, file);
}); });

41
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, ""); this.uiFollowHead = Button.CreateSimpleButton('followHead_' + this.key, "");
UIManager.Instance.uiRoot.addControl(this.uiFollowHead); UIManager.Instance.uiRoot.addControl(this.uiFollowHead);
this.uiFollowHead.width = this.c_uiDefaultWidth + "px"; this.uiFollowHead.width = this.c_uiDefaultWidth + "px";
this.uiFollowHead.height = "50px"; this.uiFollowHead.height = "55px";
this.uiFollowHead.thickness = 0; this.uiFollowHead.thickness = 0;
this.uiFollowHead.adaptWidthToChildren = true;
this.uiFollowHead.linkWithMesh(this.headMesh); this.uiFollowHead.linkWithMesh(this.headMesh);
this.uiFollowHead.onPointerClickObservable.add(() => { this.uiFollowHead.onPointerClickObservable.add(() => {
MarkWindow.instance.selectMarkDataFrom3d(instance, true); MarkWindow.instance.selectMarkDataFrom3d(instance, true);
@ -161,6 +162,9 @@ export class ModelInfo_mark extends ModelInfo {
this.uiFollowHead.addControl(this.uiNumber); this.uiFollowHead.addControl(this.uiNumber);
this.uiNumber.width = 1; this.uiNumber.width = 1;
this.uiNumber.height = 0.5; 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.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
this.uiNumber.color = "white"; this.uiNumber.color = "white";
this.uiNumber.shadowBlur = 2; this.uiNumber.shadowBlur = 2;
@ -171,6 +175,9 @@ export class ModelInfo_mark extends ModelInfo {
this.uiFollowHead.addControl(this.uiTask); this.uiFollowHead.addControl(this.uiTask);
this.uiTask.width = 1; this.uiTask.width = 1;
this.uiTask.height = 0.5; 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.verticalAlignment = Control.VERTICAL_ALIGNMENT_BOTTOM
this.uiTask.color = BabylonUIStyleTool.c_color_3d_blue; this.uiTask.color = BabylonUIStyleTool.c_color_3d_blue;
this.uiTask.shadowBlur = 1; this.uiTask.shadowBlur = 1;
@ -178,6 +185,7 @@ export class ModelInfo_mark extends ModelInfo {
this.uiTask.resizeToFit = true; this.uiTask.resizeToFit = true;
this.updateProperty(); this.updateProperty();
// this.uiFollowHead.linkWithMesh(this.headMesh);
} }
@ -207,12 +215,13 @@ export class ModelInfo_mark extends ModelInfo {
}) })
} }
else { else {
//this.pointerDragBehavior.enabled = true; this.pointerDragBehavior.enabled = true;
} }
//特效类、灭火器类,要出现坐标轴 //特效类、灭火器类、文字标注,要出现坐标轴
if (this.markData.markKindType == MarkKindType.Effect 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); GizmoTool.onPickMeshInfoObservable.notifyObservers(this);
} }
else { else {
@ -227,7 +236,7 @@ export class ModelInfo_mark extends ModelInfo {
//GizmoTool.onPickMeshInfoObservable.notifyObservers(null); //GizmoTool.onPickMeshInfoObservable.notifyObservers(null);
SceneManager.Instance.removeFromHighLight(this.modelBox as Mesh) SceneManager.Instance.removeFromHighLight(this.modelBox as Mesh)
if (this.pointerDragBehavior != null) { 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) { if (this.markData.property.taskType != MarkTask.None) {
this.uiNumber.text = this.markData.property.getInstitutionNum(); this.uiNumber.text = this.markData.property.getInstitutionNum();
this.uiTask.text = this.markData.property.task; this.uiTask.text = this.markData.property.task;
this.uiNumber
let instance = this; let instance = this;
setTimeout(() => { // setTimeout(() => {
if (instance.uiNumber == null) { // if (instance.uiNumber == null) {
return; // return;
} // }
let numWidth = instance.uiNumber.widthInPixels; // let numWidth = instance.uiNumber.widthInPixels;
let taskWidth = instance.uiTask.widthInPixels; // let taskWidth = instance.uiTask.widthInPixels;
let maxWidth = Math.max(numWidth, taskWidth, this.c_uiDefaultWidth); // let maxWidth = Math.max(numWidth, taskWidth, this.c_uiDefaultWidth);
instance.uiFollowHead.widthInPixels = maxWidth; // instance.uiFollowHead.widthInPixels = maxWidth;
// instance.uiFollowHeadBg.widthInPixels = maxWidth; // // instance.uiFollowHeadBg.widthInPixels = maxWidth;
}, (50)); // }, (100));
// console.log("喷水", this.taskNeedWaterParticle()); // console.log("喷水", this.taskNeedWaterParticle());
if (this.taskNeedWaterParticle()) { if (this.taskNeedWaterParticle()) {

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

@ -249,8 +249,9 @@ export class BuildingWindow extends UIBase {
} }
else {//恢复查看状态 else {//恢复查看状态
this.recoverMoudleShow(type);
} }
this.recoverMoudleShow(type);
} }
else { else {
if (type == JYZInfoMoudleType.YJCZ) { if (type == JYZInfoMoudleType.YJCZ) {

12
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 { EventManager } from "../../controller/event-manager/event-manager";
import { Event_GetAllMarkPlanData } from "../../controller/event-manager/events/event-get-markplandata-success"; 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_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 { Event_MarkInfoChange, MarkInfoChangeType } from "../../controller/event-manager/events/event-mark-info-change";
import { InputController } from "../../controller/inputController"; import { InputController } from "../../controller/inputController";
import { ModeManager, ModeType } from "../../controller/mode-manager";
import { SceneManager } from "../../controller/scene-manager"; import { SceneManager } from "../../controller/scene-manager";
import { BuildingStatus } from "../../controller/status/building-status"; import { BuildingStatus } from "../../controller/status/building-status";
import { IndoorStatus } from "../../controller/status/indoor-status"; import { IndoorStatus } from "../../controller/status/indoor-status";
@ -799,7 +799,7 @@ export class MarkWindow extends UIBase {
onPointerObservable(eventData: PointerInfo, eventState: EventState) { onPointerObservable(eventData: PointerInfo, eventState: EventState) {
let instance = MarkWindow.instance; let instance = MarkWindow.instance;
if (!instance.isShow) { if (!instance.isShow || ModeManager.currentMode != ModeType.Edit) { //查看模式不能调整预案
return; return;
} }
@ -856,6 +856,10 @@ export class MarkWindow extends UIBase {
// instance.selectMarkDataFrom3d(instance.currentMarkInfo, false); //暂时没有右键取消选中实例的功能 // instance.selectMarkDataFrom3d(instance.currentMarkInfo, false); //暂时没有右键取消选中实例的功能
if (!SceneManager.s_isPointerDrag) { if (!SceneManager.s_isPointerDrag) {
instance.selectMarkDataPrefabFrom3d(instance.currentMarkDataPrefab, false) 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 = meshPoolInfo.modelInfo as ModelInfo_mark;
markInfo.belongToBuilding = buildingInfo; markInfo.belongToBuilding = buildingInfo;
instance.setMarkTransform(isLocalPos, isNew, buildingInfo, markInfo.modelBox, markInfo); instance.setMarkTransform(isLocalPos, isNew, buildingInfo, markInfo.modelBox, markInfo);
markInfo.modelBox.isPickable = true; // markInfo.modelBox.isPickable = true; //避免超大的透明选中区
console.log("成功创建模型", markInfo); // console.log("成功创建模型", markInfo);
instance.currentMarkNodeInfo.addMarkInfo(markInfo, isNew); instance.currentMarkNodeInfo.addMarkInfo(markInfo, isNew);
markInfo.onCreate(isNew); markInfo.onCreate(isNew);
Event_MarkInfoChange.dispatch(MarkInfoChangeType.Create, markInfo); Event_MarkInfoChange.dispatch(MarkInfoChangeType.Create, markInfo);

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

@ -19,7 +19,7 @@
<img src="../../../assets/images/selectHeightFinding.png" title="测量高度" [hidden]="selectMeasure != 2" (click)="toggleMeasure(2)"> <img src="../../../assets/images/selectHeightFinding.png" title="测量高度" [hidden]="selectMeasure != 2" (click)="toggleMeasure(2)">
<img src="../../../assets/images/measuredArea.png" title="测量面积" [hidden]="selectMeasure === 3" (click)="toggleMeasure(3)"> <img src="../../../assets/images/measuredArea.png" title="测量面积" [hidden]="selectMeasure === 3" (click)="toggleMeasure(3)">
<img src="../../../assets/images/selectMeasuredArea.png" title="测量面积" [hidden]="selectMeasure != 3" (click)="toggleMeasure(3)"> <img src="../../../assets/images/selectMeasuredArea.png" title="测量面积" [hidden]="selectMeasure != 3" (click)="toggleMeasure(3)">
<img src="../../../assets/images/save3DPlan.png" title="保存" (click)="preserve(true)"> <img src="../../../assets/images/save3DPlan.png" title="保存" (click)="preserve(true)" *ngIf="editMode">
</div> </div>
</div> </div>
@ -157,7 +157,7 @@
<div class="pulicPlanDiv bottomPlanHeader"> <div class="pulicPlanDiv bottomPlanHeader">
<div class="planHeaderText"> <div class="planHeaderText">
<p><input type="text" [(ngModel)]="beforePlanNode.name" [disabled]="!editMode"></p> <p><input type="text" [(ngModel)]="beforePlanNode.name" [disabled]="!editMode"></p>
<textarea [(ngModel)]="beforePlanNode.describe" [disabled]="!editMode"></textarea> <textarea [(ngModel)]="beforePlanNode.describe" [disabled]="!editMode" [ngClass]="{'lookModelTextarea': !editMode}"></textarea>
</div> </div>
<div class="planHeaderImg" id="planNodeImg"> <div class="planHeaderImg" id="planNodeImg">
<img class="imgSrc" [src]="beforePlanNode.texture" [hidden]="!beforePlanNode.texture" [attr.data-original]="beforePlanNode.texture"> <img class="imgSrc" [src]="beforePlanNode.texture" [hidden]="!beforePlanNode.texture" [attr.data-original]="beforePlanNode.texture">
@ -170,10 +170,10 @@
<div class="planHeaderVideo"> <div class="planHeaderVideo">
<video [src]="beforePlanNode.video" [hidden]="!beforePlanNode.video" (click)="openVideo(beforePlanNode.video)"></video> <video [src]="beforePlanNode.video" [hidden]="!beforePlanNode.video" (click)="openVideo(beforePlanNode.video)"></video>
<div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && beforePlanNode.video"> <div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && beforePlanNode.video">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="video/*" (change)='uploadImgVideo($event, true)'><i nz-icon nzType="upload" nzTheme="outline"></i></a> <a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept=".mp4,.ogg,.webm" (change)='uploadImgVideo($event, true)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImgVideo(3)"></i> <i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImgVideo(3)"></i>
</div> </div>
<a href="javascript:;" class="bottomPlanUpload" style="width: 100px;" *ngIf="editMode && !beforePlanNode.video"><input type="file" accept="video/*" (change)='uploadImgVideo($event, true)'><img src="../../../assets/images/uploadVideo.png"></a> <a href="javascript:;" class="bottomPlanUpload" style="width: 100px;" *ngIf="editMode && !beforePlanNode.video"><input type="file" accept=".mp4,.ogg,.webm" (change)='uploadImgVideo($event, true)'><img src="../../../assets/images/uploadVideo.png"></a>
</div> </div>
</div> </div>
<div style="height: 5px;"></div> <div style="height: 5px;"></div>

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

@ -339,6 +339,7 @@
p{ margin: 0; height: 20px; line-height: 18px; } p{ margin: 0; height: 20px; line-height: 18px; }
input{ border: none; outline: none; background-color: transparent; width: 100%; height: 100%; } 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; } 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%; } } .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%; } } .planHeaderVideo{ width: 120px; height: 100%; text-align: center; position: relative; video{ width: 100%; height: 100%; } }

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

@ -732,6 +732,10 @@ export class PlanComponent implements OnInit {
if (e.target.files.length) { if (e.target.files.length) {
let maxSize = 30 * 1024 * 1024 //限制30MB let maxSize = 30 * 1024 * 1024 //限制30MB
let file = e.target.files[0] 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) { //超出限制 if (file.size > maxSize) { //超出限制
this.message.info("上传资源需小于30MB"); this.message.info("上传资源需小于30MB");
return return
@ -739,7 +743,7 @@ export class PlanComponent implements OnInit {
this.isShowLoading = true //打开遮罩 this.isShowLoading = true //打开遮罩
let institutionKey = `${this.companyData.id}` || "ceshi"; //单位id let institutionKey = `${this.companyData.id}` || "ceshi"; //单位id
let resType = isVideo ? ResType.Video : ResType.Texture let resType = isVideo ? ResType.Video : ResType.Texture
let key = `${(new Date()).getMonth() + 1}-${(new Date()).getDate()}-${(new Date()).getHours()}` let key = `${(new Date()).getFullYear()}-${(new Date()).getMonth() + 1}-${(new Date()).getDate()}-${(new Date()).getHours()}`
let url = DataManager.getResPath_mark(institutionKey, resType, key) //url let url = DataManager.getResPath_mark(institutionKey, resType, key) //url
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传 ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
if (!isVideo) { //img if (!isVideo) { //img

Loading…
Cancel
Save