Browse Source

单位id在上传图片时的获取

dev
刘向辉 3 years ago
parent
commit
af3d4110c4
  1. 19
      src/app/pages/left-domain/left-domain.component.ts

19
src/app/pages/left-domain/left-domain.component.ts

@ -54,8 +54,8 @@ export class LeftDomainComponent implements OnInit {
if (this.beforeFence === 0) { //基本信息
if (!this.baseInfo) {
let params = { organizationUnitId: PlanComponent.instance.companyData.id }
this.http.get('/api/services/app/GasStation/Get', { params: params }).subscribe((data: any)=>{
data.result.govUnitDetail? data.result.govUnitDetail = JSON.parse(data.result.govUnitDetail) : null
this.http.get('/api/services/app/GasStation/Get', { params: params }).subscribe((data: any) => {
data.result.govUnitDetail ? data.result.govUnitDetail = JSON.parse(data.result.govUnitDetail) : null
this.baseInfo = data.result
})
}
@ -88,8 +88,8 @@ export class LeftDomainComponent implements OnInit {
if (this.beforeFence === 3) { //消防设施
this.handleTreeData(this.FacilityList)
} else if (this.beforeFence === 5 || this.beforeFence === 6) { //初始化 Viewer
let id: string = this.beforeFence === 5? "pipelineViewer" : "orvrViewer"
this.FacilityList.forEach(item=>{
let id: string = this.beforeFence === 5 ? "pipelineViewer" : "orvrViewer"
this.FacilityList.forEach(item => {
if (item.getPropertyData() && item.getPropertyData().img) {
window.setTimeout(() => {
new Viewer(this.element.nativeElement.querySelector(`#${id}${item.getID()}`), { url: 'data-original', navbar: false });
@ -126,7 +126,8 @@ export class LeftDomainComponent implements OnInit {
return
}
PlanComponent.instance.isShowLoading = true //打开遮罩
let institutionKey = PlanComponent.instance.companyData.id || "ceshi"; //单位id
//let institutionKey = PlanComponent.instance.companyData.id || "ceshi"; //单位id
let institutionKey = DataManager.institutionData_simple.key;
let buildingKey = PlanComponent.instance.buildingUIItems.find(item => { return item.getBuildingID() == PlanComponent.instance.beforeOneBuildingID })
let url = DataManager.getResPath_facilityProperty(institutionKey, buildingKey.getBuildingID(), item.getType(), item.getID(), null)
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
@ -150,7 +151,7 @@ export class LeftDomainComponent implements OnInit {
deleteImg(item: FacilityInfoUIItem) {
let isDelete = confirm("您确定要删除吗?")
if (isDelete) {
this.http.delete(`${item.getPropertyData().img}`).subscribe(data=>{
this.http.delete(`${item.getPropertyData().img}`).subscribe(data => {
item.getPropertyData().img = ""
this.message.info("删除成功!");
})
@ -184,7 +185,7 @@ export class LeftDomainComponent implements OnInit {
})
//编辑模式
if (this.editMode) {
let isFind = this.treeData.find(item=>{ return item.key === 'XF_MHQ' })
let isFind = this.treeData.find(item => { return item.key === 'XF_MHQ' })
if (!isFind) {
let primaryNode = { title: '灭火器', key: 'XF_MHQ', selectable: false, }
this.treeData.push(primaryNode)
@ -299,8 +300,8 @@ export class LeftDomainComponent implements OnInit {
//更新/初始化父组件 数据
updateFatherData(index) {
PlanComponent.instance.updateTimer? window.clearTimeout(PlanComponent.instance.updateTimer) : null //清除定时器
PlanComponent.instance.progressList.forEach((item,key)=>{ key >= index? PlanComponent.instance.progressList[key] = 0 : PlanComponent.instance.progressList[key] = 100 })
PlanComponent.instance.updateTimer ? window.clearTimeout(PlanComponent.instance.updateTimer) : null //清除定时器
PlanComponent.instance.progressList.forEach((item, key) => { key >= index ? PlanComponent.instance.progressList[key] = 0 : PlanComponent.instance.progressList[key] = 100 })
PlanComponent.instance.nzCurrent = index
PlanComponent.instance.isSuspend = true //暂停
}

Loading…
Cancel
Save