|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Author: sueRimn |
|
|
|
|
* @Date: 2021-03-15 11:32:30 |
|
|
|
|
* @LastEditors: sueRimn |
|
|
|
|
* @LastEditTime: 2021-05-17 17:19:25 |
|
|
|
|
* @LastEditTime: 2021-05-31 10:07:51 |
|
|
|
|
*/ |
|
|
|
|
import { Component, OnInit, ViewChild, Inject } from '@angular/core'; |
|
|
|
|
import { HttpClient } from '@angular/common/http' |
|
|
|
@ -20,7 +20,7 @@ import { TreeService } from '../../http-interceptors/tree.service'
|
|
|
|
|
import { MatTableDataSource } from '@angular/material/table'; |
|
|
|
|
import { Viewer } from 'photo-sphere-viewer'; |
|
|
|
|
declare var CryptoJS |
|
|
|
|
|
|
|
|
|
import Swiper from 'swiper'; |
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-all-plan', |
|
|
|
|
templateUrl: './all-plan.component.html', |
|
|
|
@ -91,6 +91,13 @@ export class AllPlanComponent implements OnInit {
|
|
|
|
|
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'){ |
|
|
|
|
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-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf' |
|
|
|
|
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC' |
|
|
|
|
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */{ |
|
|
|
@ -122,7 +129,11 @@ export class AllPlanComponent implements OnInit {
|
|
|
|
|
var stringjson=JSON.stringify(json) |
|
|
|
|
var wordArray = CryptoJS.enc.Utf8.parse(stringjson); |
|
|
|
|
var base64 = CryptoJS.enc.Base64.stringify(wordArray); |
|
|
|
|
window.open(`http://121.5.10.84:80/apps/editor/openPreview?data=${base64}`) |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('该预案无法查看!','确定',config); |
|
|
|
|
//window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`)
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -169,4 +180,49 @@ export class PsViewer{
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//普通图片弹窗
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'imgdetails', |
|
|
|
|
templateUrl: './previewImg.html', |
|
|
|
|
styleUrls: ['./all-plan.component.scss'] |
|
|
|
|
}) |
|
|
|
|
export class ImgDetails{ |
|
|
|
|
constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<ImgDetails>, |
|
|
|
|
@Inject(MAT_DIALOG_DATA) public data) { } |
|
|
|
|
testSwiper: Swiper; |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
//console.log(this.data)
|
|
|
|
|
this.allImages = [] |
|
|
|
|
this.data.forEach(element => { |
|
|
|
|
element = `/api/Objects/PlanPlatform/${element}?x-oss-process=image/auto-orient,1` |
|
|
|
|
this.allImages.push(element) |
|
|
|
|
}); |
|
|
|
|
//this.allImages.push(`${this.data.attachmentUrls[0]}?x-oss-process=image/auto-orient,1`)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngAfterViewInit() { |
|
|
|
|
this.testSwiper = new Swiper('.swiper-container', { |
|
|
|
|
lazy: true, |
|
|
|
|
direction: 'horizontal', |
|
|
|
|
loop: false, |
|
|
|
|
|
|
|
|
|
// 如果需要前进后退按钮
|
|
|
|
|
navigation: { |
|
|
|
|
nextEl: '.swiper-button-next', |
|
|
|
|
prevEl: '.swiper-button-prev', |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
allImages:any; //展示所有的图片
|
|
|
|
|
rotationAngle:number=0; //旋转角度
|
|
|
|
|
|
|
|
|
|
//旋转图片
|
|
|
|
|
rotate () { |
|
|
|
|
this.rotationAngle = this.rotationAngle+90 |
|
|
|
|
if (this.rotationAngle === 360) {this.rotationAngle = 0} |
|
|
|
|
} |
|
|
|
|
} |