|
|
|
@ -25,6 +25,8 @@ import { MarkData, MarkTask } from 'src/app/babylon/model/data/mark/mark-data';
|
|
|
|
|
import { MarkWindow } from 'src/app/babylon/view/mark-window/mark-window'; |
|
|
|
|
import { AllMarkPlanData, MarkNodeData, MarkPlanData } from 'src/app/babylon/model/data/mark/mark-plan-data'; |
|
|
|
|
import { DataManager, ResType } from 'src/app/babylon/controller/data-manager'; |
|
|
|
|
import { EventManager as babylonEventManager } from 'src/app/babylon/controller/event-manager/event-manager'; |
|
|
|
|
import { Event_GetAllMarkPlanData } from 'src/app/babylon/controller/event-manager/events/event-get-markplandata-success'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -43,6 +45,7 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
public canvas: HTMLCanvasElement; //canvas 实例
|
|
|
|
|
public editMode: boolean = true; //编辑/查看 模式
|
|
|
|
|
public userMode: boolean = ModeManager.s_isMakeMode; //是否为 内部权限
|
|
|
|
|
public bucketName: string = ObjectsService.getFullPath("文件路径"); //当前桶名
|
|
|
|
|
public isShowLoading: boolean = true; //显隐 loading加载条
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
@ -135,10 +138,23 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
if (this.selectFence === 7) { //初始化 应急预案模块
|
|
|
|
|
this.initializePlan() |
|
|
|
|
} |
|
|
|
|
if (type === 7) { //初始化 应急预案 data
|
|
|
|
|
this.isShowChildComponent && this.leftDomain? this.leftDomain.initComponent(type) : null; //手动初始化子组件
|
|
|
|
|
this.selectFence = type |
|
|
|
|
this.isShowChildComponent = true |
|
|
|
|
buildingWindow.changeJYZInfoModel(fenceType, true) |
|
|
|
|
MarkWindow.instance ? this.allMarkPlanData = MarkWindow.instance.allMarkPlanData : null; |
|
|
|
|
babylonEventManager.addListener(Event_GetAllMarkPlanData, (data: Event_GetAllMarkPlanData) => { |
|
|
|
|
this.allMarkPlanData = MarkWindow.instance.allMarkPlanData |
|
|
|
|
this.isShowChildComponent && this.leftDomain? this.leftDomain.allMarkPlanData = MarkWindow.instance.allMarkPlanData : null |
|
|
|
|
}) |
|
|
|
|
this.isShowChildComponent && this.leftDomain? this.leftDomain.allMarkPlanData = MarkWindow.instance.allMarkPlanData : null |
|
|
|
|
} else { |
|
|
|
|
this.isShowChildComponent && this.leftDomain && type != 4 ? this.leftDomain.initComponent(type) : null; //手动初始化子组件
|
|
|
|
|
this.selectFence = type |
|
|
|
|
this.isShowChildComponent = true |
|
|
|
|
buildingWindow.changeJYZInfoModel(fenceType, true) |
|
|
|
|
} |
|
|
|
|
} else { //取消选中
|
|
|
|
|
this.selectFence = -1 |
|
|
|
|
this.isShowChildComponent = false |
|
|
|
@ -360,6 +376,7 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
this.isShowChildComponent && this.leftDomain? this.leftDomain.selectNodeId = this.beforePlanNode.id : null |
|
|
|
|
MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id, false, true) |
|
|
|
|
this.beforePlanNode = MarkWindow.instance.currentMarkNodeInfo.nodeData |
|
|
|
|
this.initViewer() |
|
|
|
|
this.updateProgress() //更新进度条
|
|
|
|
|
resolve(true) |
|
|
|
|
}) |
|
|
|
@ -547,10 +564,19 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
videoDialogType: videoDialog = new videoDialog(true, null); //全景图/视频 弹窗
|
|
|
|
|
planNodeImg: Viewer; //应急预案图片Viewer 实例
|
|
|
|
|
|
|
|
|
|
//初始化 Viewer图片
|
|
|
|
|
initViewer() { |
|
|
|
|
if (this.beforePlanNode.texture) { |
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
this.planNodeImg = new Viewer(this.element.nativeElement.querySelector('#planNodeImg'), { url: 'data-original' }); |
|
|
|
|
}, 0) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//上传 图片/视频
|
|
|
|
|
uploadImgVideo(e, isVideo: boolean) { |
|
|
|
|
if (e.target.files.length) { |
|
|
|
|
let maxSize = 20 * 1024 * 1024 //限制30MB
|
|
|
|
|
let maxSize = 30 * 1024 * 1024 //限制30MB
|
|
|
|
|
let file = e.target.files[0] |
|
|
|
|
if (file.size > maxSize) { //超出限制
|
|
|
|
|
this.message.info("上传资源需小于30MB"); |
|
|
|
@ -563,12 +589,10 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
let url = DataManager.getResPath_mark(institutionKey, resType, key) //url
|
|
|
|
|
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
|
|
|
|
|
if (!isVideo) { //img
|
|
|
|
|
this.beforePlanNode.texture = path + name |
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
this.planNodeImg = new Viewer(this.element.nativeElement.querySelector('#planNodeImg'), { url: 'data-original' }); |
|
|
|
|
}, 0) |
|
|
|
|
this.beforePlanNode.texture = ObjectsService.getFullPath(path + name) |
|
|
|
|
this.initViewer() |
|
|
|
|
} else { //video
|
|
|
|
|
this.beforePlanNode.video = path + name |
|
|
|
|
this.beforePlanNode.video = ObjectsService.getFullPath(path + name) |
|
|
|
|
} |
|
|
|
|
this.isShowLoading = false //关闭遮罩
|
|
|
|
|
this.message.info("上传成功!"); |
|
|
|
@ -576,6 +600,12 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//打开视频弹窗
|
|
|
|
|
openVideo(src: string) { |
|
|
|
|
this.videoDialogType.isVideo = true |
|
|
|
|
this.videoDialogType.url = src |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
selectRightTopFast: number = 0; //当前选择功能 快捷栏
|
|
|
|
|
selectAdsorb: boolean = false; //吸附状态
|
|
|
|
|
topLevelView: boolean = false; //顶视图状态
|
|
|
|
|