|
|
|
@ -3,6 +3,8 @@ import { Component, OnInit ,Renderer2,ElementRef, Inject, NgZone, ViewChild } fr
|
|
|
|
|
import { FormBuilder,FormGroup, FormControl } from '@angular/forms'; |
|
|
|
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
|
import { ImgDetails, PsViewer } from 'src/app/plan-management/entry-plan-look/entry-plan-look.component'; |
|
|
|
|
import { SeeVideoComponent } from 'src/app/plan-management/see-video/see-video.component'; |
|
|
|
|
declare var AMap: any; |
|
|
|
|
declare var QRCode: any; |
|
|
|
|
|
|
|
|
@ -1551,28 +1553,60 @@ export class LookPlanDialog {
|
|
|
|
|
} |
|
|
|
|
//查看预案
|
|
|
|
|
lookPlan(e){ |
|
|
|
|
if(e.planMode == 0){
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('本地文件,请下载查看','确定',config); |
|
|
|
|
} |
|
|
|
|
if(e.planMode == 1){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('查看导入word文件','确定',config); |
|
|
|
|
if (e.planType == 16 || e.planType == 4 || e.planType == 8) { |
|
|
|
|
var index = e.attachmentUrls[0].indexOf("\/") |
|
|
|
|
if (e.attachmentUrls[0].substr(0, index) == 'psw') { |
|
|
|
|
const dialogRef = this.dialog.open(PsViewer, { |
|
|
|
|
width: '1500px', |
|
|
|
|
height: '800px', |
|
|
|
|
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) == 'peg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') { |
|
|
|
|
let data = e |
|
|
|
|
const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
data: data.attachmentUrls, |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(); |
|
|
|
|
} else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'mp4' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'MP4') { |
|
|
|
|
let fetchUrl = e.attachmentUrls[0] |
|
|
|
|
let data = `/api/Objects/PlanPlatform/` + fetchUrl |
|
|
|
|
const dialogRef = this.dialog.open(SeeVideoComponent, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
data: data, |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(); |
|
|
|
|
} else { |
|
|
|
|
let fetchUrl = e.attachmentUrls[0] |
|
|
|
|
if (fetchUrl) { |
|
|
|
|
let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() |
|
|
|
|
if (suffix == 'docx' || suffix == 'doc') { |
|
|
|
|
let arr = fetchUrl.split('.') |
|
|
|
|
arr[arr.length - 1] = 'pdf' |
|
|
|
|
window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) |
|
|
|
|
} else if (suffix == 'pdf') { |
|
|
|
|
window.open(`/api/Objects/PlanPlatform/` + fetchUrl) |
|
|
|
|
} else { |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(e.planMode == 2){ //如果是在线编辑
|
|
|
|
|
let id = e.id
|
|
|
|
|
sessionStorage.setItem("planId",id) |
|
|
|
|
sessionStorage.setItem("companyId",this.data.id) |
|
|
|
|
sessionStorage.setItem("buildingTypeId",this.data.buildingTypes[0].id) |
|
|
|
|
sessionStorage.setItem("editable","0") |
|
|
|
|
sessionStorage.setItem("planName",e.name) |
|
|
|
|
if (e.planType == 1) { //如果是在线编辑
|
|
|
|
|
let id = e.id |
|
|
|
|
sessionStorage.setItem("planId", id) |
|
|
|
|
sessionStorage.setItem("companyId", this.data.id) |
|
|
|
|
sessionStorage.setItem("buildingTypeId", this.data.buildingTypes[0].id) |
|
|
|
|
sessionStorage.setItem("editable", "0") |
|
|
|
|
sessionStorage.setItem("planName", e.name) |
|
|
|
|
let companyId = sessionStorage.getItem("companyId") |
|
|
|
|
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); |
|
|
|
|
} |
|
|
|
|
if (e.planType == 2) { //如果是跳转网页
|
|
|
|
|
sessionStorage.setItem("url", e.url) |
|
|
|
|
window.open(`/planManagement/webLook`) |
|
|
|
|
} |
|
|
|
|
if(e.planMode == 3){ //如果是跳转网页
|
|
|
|
|
sessionStorage.setItem("url",e.url) |
|
|
|
|
window.open(`/planManagement/webLook`) |
|
|
|
|