|
|
@ -31,6 +31,7 @@ import { FacilityInfoInSceneWindow } from 'src/app/babylon/view/facilityinfoinsc |
|
|
|
import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-facility'; |
|
|
|
import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-facility'; |
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
import { DataBuffer } from '@babylonjs/core'; |
|
|
|
import { DataBuffer } from '@babylonjs/core'; |
|
|
|
|
|
|
|
import { Photo360Tool } from 'src/app/babylon/tool/photo360-tool'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -402,19 +403,21 @@ export class PlanComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
//选中 设备
|
|
|
|
//选中 设备
|
|
|
|
selectProperty(e: FacilityInfoUIItem) { |
|
|
|
selectProperty(e: FacilityInfoUIItem) { |
|
|
|
|
|
|
|
this.propertyImg? this.propertyImg.destroy() : null |
|
|
|
this.isShowNature = true |
|
|
|
this.isShowNature = true |
|
|
|
this.beforeOnePropertyData = e |
|
|
|
this.beforeOnePropertyData = e |
|
|
|
if (this.selectFence === 1 || this.selectFence === 2) { //刷新弹窗 位置
|
|
|
|
if (this.selectFence === 1 || this.selectFence === 2) { //刷新弹窗 位置
|
|
|
|
this.renovateDialogPosition() |
|
|
|
this.renovateDialogPosition() |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(e.getPropertyData(), '选中设备') |
|
|
|
|
|
|
|
if (this.isShowChildComponent && this.leftDomain) { |
|
|
|
if (this.isShowChildComponent && this.leftDomain) { |
|
|
|
this.leftDomain.selectFacilityId = e.getID() |
|
|
|
this.leftDomain.selectFacilityId = e.getID() |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.selectFence === 0 && this.beforeOnePropertyData.getPropertyData() && this.beforeOnePropertyData.getPropertyData().img) { //img
|
|
|
|
if (this.selectFence === 0 && this.beforeOnePropertyData.getPropertyData() && this.beforeOnePropertyData.getPropertyData().img) { //img
|
|
|
|
window.setTimeout(() => { |
|
|
|
if (!this.beforeOnePropertyData.getPropertyData().is360) { |
|
|
|
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original', navbar: false }); |
|
|
|
window.setTimeout(() => { |
|
|
|
}, 0) |
|
|
|
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original', navbar: false }); |
|
|
|
|
|
|
|
}, 0) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -424,6 +427,37 @@ export class PlanComponent implements OnInit { |
|
|
|
this.naturePosition.top = `${this.beforeOnePropertyData.getHeadUIPos().y - 150}px` |
|
|
|
this.naturePosition.top = `${this.beforeOnePropertyData.getHeadUIPos().y - 150}px` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//切换图片 全景/非全景
|
|
|
|
|
|
|
|
togglePanorama(event) { |
|
|
|
|
|
|
|
if (!this.beforeOnePropertyData.getPropertyData().img) { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.beforeOnePropertyData.getPropertyData().is360) { //全景模式 销毁 Viewer
|
|
|
|
|
|
|
|
this.propertyImg? this.propertyImg.destroy() : null |
|
|
|
|
|
|
|
} else { //非全景模式 初始化 Viewer
|
|
|
|
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
|
|
|
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original', navbar: false }); |
|
|
|
|
|
|
|
}, 0) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查看图片 全景
|
|
|
|
|
|
|
|
lookPanorama() { |
|
|
|
|
|
|
|
if (this.beforeOnePropertyData.getPropertyData().img && this.beforeOnePropertyData.getPropertyData().is360) { //全景模式 打开canvas弹窗
|
|
|
|
|
|
|
|
this.videoDialogType.isVideo = false |
|
|
|
|
|
|
|
this.videoDialogType.url = this.beforeOnePropertyData.getPropertyData().img |
|
|
|
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
|
|
|
Photo360Tool.open(document.getElementById('panorama') as HTMLCanvasElement, this.videoDialogType.url) |
|
|
|
|
|
|
|
},0) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//销毁全景图片 canvas/ 关闭弹窗
|
|
|
|
|
|
|
|
closePanorama() { |
|
|
|
|
|
|
|
!this.videoDialogType.isVideo? Photo360Tool.close() : null |
|
|
|
|
|
|
|
this.videoDialogType.url = null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//上传设备 图片
|
|
|
|
//上传设备 图片
|
|
|
|
uploadPropertyImg(e) { |
|
|
|
uploadPropertyImg(e) { |
|
|
|
if (e.target.files.length) { |
|
|
|
if (e.target.files.length) { |
|
|
@ -434,15 +468,17 @@ export class PlanComponent implements OnInit { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
this.isShowLoading = true //打开遮罩
|
|
|
|
this.isShowLoading = true //打开遮罩
|
|
|
|
let institutionKey = this.companyData.id || "ceshi"; //单位id
|
|
|
|
let institutionKey = `${this.companyData.id}` || "ceshi"; //单位id
|
|
|
|
let buildingKey = this.buildingUIItems.find(item => { return item.getBuildingID() == this.beforeOneBuildingID }) |
|
|
|
let buildingKey = this.buildingUIItems.find(item => { return item.getBuildingID() == this.beforeOneBuildingID }) |
|
|
|
let facility = this.beforeOnePropertyData |
|
|
|
let facility = this.beforeOnePropertyData |
|
|
|
let url = DataManager.getResPath_facilityProperty(institutionKey, buildingKey.getBuildingID(), facility.getType(), facility.getID(), null) |
|
|
|
let url = DataManager.getResPath_facilityProperty(institutionKey, buildingKey.getBuildingID(), facility.getType(), facility.getID(), null) |
|
|
|
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
|
|
|
|
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
|
|
|
|
this.beforeOnePropertyData.getPropertyData().img = ObjectsService.getFullPath(path + name) |
|
|
|
this.beforeOnePropertyData.getPropertyData().img = ObjectsService.getFullPath(path + name) |
|
|
|
window.setTimeout(() => { |
|
|
|
if (!this.beforeOnePropertyData.getPropertyData().is360) { |
|
|
|
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original', navbar: false }); |
|
|
|
window.setTimeout(() => { |
|
|
|
}, 0) |
|
|
|
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original', navbar: false }); |
|
|
|
|
|
|
|
}, 0) |
|
|
|
|
|
|
|
} |
|
|
|
this.isShowLoading = false //关闭遮罩
|
|
|
|
this.isShowLoading = false //关闭遮罩
|
|
|
|
this.message.info("上传成功!"); |
|
|
|
this.message.info("上传成功!"); |
|
|
|
}) |
|
|
|
}) |
|
|
@ -695,7 +731,7 @@ export class PlanComponent implements OnInit { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
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()).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
|
|
|
|