|
|
@ -10,6 +10,7 @@ import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dial |
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
import { TreeService } from '../../http-interceptors/tree.service' |
|
|
|
import { TreeService } from '../../http-interceptors/tree.service' |
|
|
|
import { Viewer } from 'photo-sphere-viewer'; |
|
|
|
import { Viewer } from 'photo-sphere-viewer'; |
|
|
|
|
|
|
|
import { ImgDetails, PsViewer } from '../entry-plan-look/entry-plan-look.component'; |
|
|
|
declare var CryptoJS |
|
|
|
declare var CryptoJS |
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-open-plan', |
|
|
|
selector: 'app-open-plan', |
|
|
@ -201,22 +202,27 @@ export class OpenPlanComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
//跳转查看预案页面 公开预案
|
|
|
|
//跳转查看预案页面 公开预案
|
|
|
|
routerTo(e) { |
|
|
|
routerTo(e) { |
|
|
|
/* sessionStorage.setItem("companyName",element.companyName) |
|
|
|
console.log(e) |
|
|
|
window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=2`); */ |
|
|
|
if (e.planType == 16 || e.planType == 4 || e.planType == 8) { |
|
|
|
|
|
|
|
if (e.planType == 16 && e.attachmentUrls == null) { |
|
|
|
// console.log(e)
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${e.companyId}&planName=${e.name}&unitName=${e.company.name}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${e.company.buildingTypes[0].id}&orName=${e.company.organizationName}&orId=${e.company.organizationId}&pattern=false`) |
|
|
|
if (e.planMode == 0 || e.planMode == 1) { |
|
|
|
} else { |
|
|
|
//console.log(e.attachmentUrls)
|
|
|
|
|
|
|
|
var index = e.attachmentUrls[0].indexOf("\/") |
|
|
|
var index = e.attachmentUrls[0].indexOf("\/") |
|
|
|
if (e.attachmentUrls[0].substr(0, index) == 'psw') { |
|
|
|
if (e.attachmentUrls[0].substr(0, index) == 'psw') { |
|
|
|
const dialogRef = this.dialog.open(GkhtmlPsViewer, { |
|
|
|
const dialogRef = this.dialog.open(PsViewer, { |
|
|
|
width: '1500px', |
|
|
|
width: '1500px', |
|
|
|
height: '800px', |
|
|
|
height: '800px', |
|
|
|
data: e.attachmentUrls[0] |
|
|
|
data: e.attachmentUrls[0] |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'JPG' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'png' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpeg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') { |
|
|
|
else { |
|
|
|
let data = e |
|
|
|
|
|
|
|
const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
|
|
|
data: data.attachmentUrls, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
dialogRef.afterClosed().subscribe(); |
|
|
|
|
|
|
|
} else { |
|
|
|
let fetchUrl = e.attachmentUrls[0] |
|
|
|
let fetchUrl = e.attachmentUrls[0] |
|
|
|
|
|
|
|
if (fetchUrl) { |
|
|
|
let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() |
|
|
|
let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() |
|
|
|
if (suffix == 'docx' || suffix == 'doc') { |
|
|
|
if (suffix == 'docx' || suffix == 'doc') { |
|
|
|
let arr = fetchUrl.split('.') |
|
|
|
let arr = fetchUrl.split('.') |
|
|
@ -232,8 +238,10 @@ export class OpenPlanComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (e.planMode == 2) { //如果是在线编辑
|
|
|
|
if (e.planMode == 2 && e.planType == 1) { //如果是在线编辑
|
|
|
|
let id = e.id |
|
|
|
let id = e.id |
|
|
|
sessionStorage.setItem("planId", id) |
|
|
|
sessionStorage.setItem("planId", id) |
|
|
|
sessionStorage.setItem("companyId", e.companyId) |
|
|
|
sessionStorage.setItem("companyId", e.companyId) |
|
|
@ -248,6 +256,20 @@ export class OpenPlanComponent implements OnInit { |
|
|
|
window.open(`/planManagement/webLook`) |
|
|
|
window.open(`/planManagement/webLook`) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templatePlanChange($event, type) { |
|
|
|
|
|
|
|
if (type == 1) { |
|
|
|
|
|
|
|
this.templatePlan = $event |
|
|
|
|
|
|
|
} else if (type == 2) { |
|
|
|
|
|
|
|
this.customPlan = $event |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.templatePlan || this.customPlan) { |
|
|
|
|
|
|
|
this.reservePlanType = ['16'] |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.reservePlanType = [] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//分页事件
|
|
|
|
//分页事件
|
|
|
|
chagePage(e) { |
|
|
|
chagePage(e) { |
|
|
|
this.PageNumber = e.pageIndex + 1 |
|
|
|
this.PageNumber = e.pageIndex + 1 |
|
|
|