|
|
|
@ -339,6 +339,7 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
isShowNature: boolean = false; //显隐设备 属性栏
|
|
|
|
|
beforeOnePropertyData: FacilityInfoUIItem = null; //当前选择 设备
|
|
|
|
|
propertyImg: Viewer; //设备图标Viewer 实例
|
|
|
|
|
naturePosition: naturePosition = new naturePosition(); //设备栏 定位位置
|
|
|
|
|
|
|
|
|
|
//选中 设备
|
|
|
|
@ -349,6 +350,36 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
if (this.isShowChildComponent && this.leftDomain) { |
|
|
|
|
this.leftDomain.selectFacilityId = e.getID() |
|
|
|
|
} |
|
|
|
|
if (this.beforeOnePropertyData.getPropertyData() && this.beforeOnePropertyData.getPropertyData().img) { //img
|
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original' }); |
|
|
|
|
}, 0) |
|
|
|
|
}
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//上传设备 图片
|
|
|
|
|
uploadPropertyImg(e) { |
|
|
|
|
if (e.target.files.length) { |
|
|
|
|
let maxSize = 30 * 1024 * 1024 //限制30MB
|
|
|
|
|
let file = e.target.files[0] |
|
|
|
|
if (file.size > maxSize) { //超出限制
|
|
|
|
|
this.message.info("上传资源需小于30MB"); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.isShowLoading = true //打开遮罩
|
|
|
|
|
let institutionKey = sessionStorage.getItem('unitId') || "ceshi"; //单位id
|
|
|
|
|
let buildingKey = this.buildingUIItems.find(item => { return item.getBuildingID() == this.beforeOneBuildingID }) |
|
|
|
|
let facility = this.beforeOnePropertyData |
|
|
|
|
let url = DataManager.getResPath_facilityProperty(institutionKey, buildingKey.getBuildingID(), facility.getType(), facility.getID(), null) |
|
|
|
|
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
|
|
|
|
|
this.beforeOnePropertyData.getPropertyData().img = ObjectsService.getFullPath(path + name) |
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original' }); |
|
|
|
|
}, 0) |
|
|
|
|
this.isShowLoading = false //关闭遮罩
|
|
|
|
|
this.message.info("上传成功!"); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
allMarkPlanData: AllMarkPlanData; //处置预案节点 数据
|
|
|
|
|