Browse Source

修正bug

zhuzhou
陈鹏飞 3 years ago
parent
commit
411722d6a8
  1. 68
      src/app/gis-management/gis-labeling/gis-labeling.component.ts
  2. 2
      src/app/plan-audit/plan-record/plan-record.component.html
  3. 2
      src/app/plan-audit/wait-examineer/wait-examineer.component.html
  4. 9
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

68
src/app/gis-management/gis-labeling/gis-labeling.component.ts

@ -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){ //如果是在线编辑
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)
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`)

2
src/app/plan-audit/plan-record/plan-record.component.html

@ -178,7 +178,7 @@
</div>
<!-- 图片 -->
<div class="imgBox" *ngIf="showtype==1024" style="text-align: center; overflow: hidden; height: 100%;">
<img [src]="src" (click)="lookImg(fetchUrl)" style="width: auto; height: auto; max-height: 100%;">
<img [src]="src" (click)="lookImg(fetchUrl)" style="width: auto; height: auto; max-width: 100%; max-height: 100%;">
</div>
<!-- 图片 -->
<!-- 视频 -->

2
src/app/plan-audit/wait-examineer/wait-examineer.component.html

@ -283,7 +283,7 @@
</div>
<!-- 图片 -->
<div class="imgBox" *ngIf="showtype==1024" style="text-align: center; overflow: hidden; height: 100%;">
<img [src]="src" (click)="lookImg(fetchUrl)" style="width: auto; height: auto; max-height: 100%;">
<img [src]="src" (click)="lookImg(fetchUrl)" style="width: auto; height: auto; max-width: 100%; max-height: 100%;">
</div>
<!-- 图片 -->
<!-- 视频 -->

9
src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

@ -180,13 +180,7 @@ export class EntryPlanLookComponent implements OnInit {
sessionStorage.setItem("planName", e.name)
let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`);
}
else if (e.planType == 4) { //其他预案 上传
this.selectPlan = e
let Dom = document.getElementById('uploadFile')
Dom.click()
}
else if (e.planType == 16) {
} else if (e.planType == 4 || e.planType == 16) { // 其他预案/文本预案
this.http.put(`/api/PlanComponents/${e.id}`,e).subscribe(info=>{
this.selectPlan = e
let Dom = document.getElementById('uploadFile')
@ -211,7 +205,6 @@ export class EntryPlanLookComponent implements OnInit {
// })
}
else {
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config);
}
}

Loading…
Cancel
Save