diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.html b/src/app/plan-management/entry-plan-look/entry-plan-look.component.html index c2722ee..eb9e70d 100644 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.html +++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.html @@ -77,7 +77,7 @@ 改名 编辑 - 查看 + 查看 下载 删除 审批结果 @@ -88,7 +88,7 @@ 操作 - 查看 + 查看 下载 diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.spec.ts b/src/app/plan-management/entry-plan-look/entry-plan-look.component.spec.ts deleted file mode 100644 index 381ed6c..0000000 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { EntryPlanLookComponent } from './entry-plan-look.component'; - -describe('EntryPlanLookComponent', () => { - let component: EntryPlanLookComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ EntryPlanLookComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(EntryPlanLookComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts index 786cab4..efaa709 100644 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts +++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts @@ -1,18 +1,18 @@ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; -import { HttpClient,HttpHeaders,HttpErrorResponse } from '@angular/common/http' +import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http' import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; import { FormControl } from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' import { PageEvent } from '@angular/material/paginator'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { TreeService } from '../../http-interceptors/tree.service' -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { async } from '@angular/core/testing'; import { Viewer } from 'photo-sphere-viewer'; -import {STEPPER_GLOBAL_OPTIONS} from '@angular/cdk/stepper'; +import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper'; import Swiper from 'swiper'; declare var CryptoJS @Component({ @@ -21,7 +21,7 @@ declare var CryptoJS styleUrls: ['./entry-plan-look.component.scss'] }) export class EntryPlanLookComponent implements OnInit { - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } pageEvent: PageEvent; private _transformer = (node, level: number) => { //初始化tree return { @@ -39,362 +39,330 @@ export class EntryPlanLookComponent implements OnInit { myControl = new FormControl(); hasChild = (_: number, node: any) => node.expandable; - displayedColumns: string[] = ['planname', 'addpeople', 'addtime','plantype','auditstate', 'isopen','preparethelevel','operation']; - tabledataSource:any + displayedColumns: string[] = ['planname', 'addpeople', 'addtime', 'plantype', 'auditstate', 'isopen', 'preparethelevel', 'operation']; + tabledataSource: any //分页 - @ViewChild(MatPaginator, {static: true}) + @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any = 1; //第几页 + PageNumber: any = 1; //第几页 - unitdata:any = {} + unitdata: any = {} - unittypeId:any //单位类型id - + unittypeId: any //单位类型id + //获取当前单位信息 - compantData:any - getCompanyData () { + compantData: any + getCompanyData() { let CompanyName = sessionStorage.getItem("companyName") - let header = { + let header = { CompanyName: CompanyName || '', } - this.http.get('/api/Plans',{params:header}).subscribe((data:any)=>{ + this.http.get('/api/Plans', { params: header }).subscribe((data: any) => { data.items.forEach(element => { - if (element.companyId===this.route.snapshot.queryParams.unitId) { - this.compantData = element.company - return } }); - // console.log(123,this.compantData) - this.unitdata.unitname = this.compantData.name - this.unitdata.organizationName = this.compantData.organizationName - this.unitdata.unittype = this.compantData.buildingTypes[0].name - this.unitdata.unitaddress = this.compantData.address - this.unittypeId = this.compantData.buildingTypes[0].id + if (element.companyId === this.route.snapshot.queryParams.unitId) { + this.compantData = element.company + return + } + }); + // console.log(123,this.compantData) + this.unitdata.unitname = this.compantData.name + this.unitdata.organizationName = this.compantData.organizationName + this.unitdata.unittype = this.compantData.buildingTypes[0].name + this.unitdata.unitaddress = this.compantData.address + this.unittypeId = this.compantData.buildingTypes[0].id }) } //跳转单位信息 - lookUnitData(){ - sessionStorage.setItem("editable","0") - sessionStorage.setItem("companyName",this.route.snapshot.queryParams.unitName) - sessionStorage.setItem("companyId",this.route.snapshot.queryParams.unitId) + lookUnitData() { + sessionStorage.setItem("editable", "0") + sessionStorage.setItem("companyName", this.route.snapshot.queryParams.unitName) + sessionStorage.setItem("companyId", this.route.snapshot.queryParams.unitId) // sessionStorage.setItem(element.id,JSON.stringify(element.companyIntegrityScore)) window.open(`/keyUnit/viewunitinfo?id=${this.route.snapshot.queryParams.unitId}&usci=${this.route.snapshot.queryParams.usci}`) } - //分页事件 - changePage(e){ - this.PageNumber = e.pageIndex+1 + //分页事件 + changePage(e) { + this.PageNumber = e.pageIndex + 1 this.getAllPlanComponents() } - isoperation:any //判断预案录入 和 审核公开预案 区别变量 + isoperation: any //判断预案录入 和 审核公开预案 区别变量 ngOnInit(): void { this.tabledataSource = [ ] // this.getCompanyData() this.isoperation = this.route.snapshot.queryParams.operation - this.unitdata.unitname = this.route.snapshot.queryParams.unitName - this.unitdata.organizationName = this.route.snapshot.queryParams.orName - this.unitdata.unittype = this.route.snapshot.queryParams.unitType - this.unitdata.unitaddress = this.route.snapshot.queryParams.unitAdd + this.unitdata.unitname = this.route.snapshot.queryParams.unitName + this.unitdata.organizationName = this.route.snapshot.queryParams.orName + this.unitdata.unittype = this.route.snapshot.queryParams.unitType + this.unitdata.unitaddress = this.route.snapshot.queryParams.unitAdd this.companyId = this.route.snapshot.queryParams.unitId this.unittypeId = this.route.snapshot.queryParams.unitTypeId this.getAllPlanComponents() } //查看预案 - lookPlan(e){ - if(e.planType == 16||e.planType == 4||e.planType == 8){ - // console.log(e.attachmentUrls) - var index=e.attachmentUrls[0].indexOf("\/") - if(e.attachmentUrls[0].substr(0,index)=='psw'){ + lookPlan(e) { + console.log(e) + 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', + 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)=='jpeg'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='jpg'){ + } 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-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') */{ - let filename:string - let fetchUrl = e.attachmentUrls[0] - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ - filename=data.fileName - let json={ - doc: { - docId: docId, - title: filename, - fetchUrl: `http://39.106.78.171:8000/api/Objects/PlanPlatform/`+fetchUrl, - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: e.auditStatus!='1'&&e.auditStatus!='16'?[ - 'FILE_READ','FILE_WRITE','FILE_DOWNLOAD', 'FILE_PRINT' - ]:[ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - 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}`) - }) - } - } - /* if(e.planType == 4){ - 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] + const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去 + data: data.attachmentUrls, }); + 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.planType == 1){ //如果是在线编辑 - let id = e.id - sessionStorage.setItem("planId",id) - sessionStorage.setItem("companyId",this.companyId) - sessionStorage.setItem("buildingTypeId",this.unittypeId) - 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.companyId) + sessionStorage.setItem("buildingTypeId", this.unittypeId) + sessionStorage.setItem("editable", "0") + sessionStorage.setItem("planName", e.name) let companyId = sessionStorage.getItem("companyId") window.open(`/keyUnit/viewunitinfoplan?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); } - if(e.planType == 2){ //如果是跳转网页 - sessionStorage.setItem("url",e.url) + if (e.planType == 2) { //如果是跳转网页 + sessionStorage.setItem("url", e.url) window.open(`/planManagement/webLook`) } } //编辑预案 - editPlan(e){ + editPlan(e) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗') - if (isTrue){ - if(e.planType == 1){ //如果是在线编辑 - let id = e.id - sessionStorage.setItem("planId",id) - sessionStorage.setItem("companyId",this.companyId) - sessionStorage.setItem("buildingTypeId",this.unittypeId) - sessionStorage.setItem("editable","1") - sessionStorage.setItem("planName",e.name) + if (isTrue) { + if (e.planType == 1) { //如果是在线编辑 + let id = e.id + sessionStorage.setItem("planId", id) + sessionStorage.setItem("companyId", this.companyId) + sessionStorage.setItem("buildingTypeId", this.unittypeId) + sessionStorage.setItem("editable", "1") + 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==16){ + else if (e.planType == 16) { this.lookPlan(e) - // let body={ - // // id:e.planId, - // // resetAudit:true - // "" - // } let body = JSON.stringify(""); - let resetAudit=true + let resetAudit = true let headers = new HttpHeaders({ 'Content-Type': 'text/json' }); let options = { headers }; - this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data=>{ + this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { this.getAllPlanComponents() - },err => { - this.snackBar.open(err,'确定',config); + }, err => { + this.snackBar.open(err, '确定', config); }) } - else{ - - this.snackBar.open('只有二维预案和文本预案可以编辑!','确定',config); + else { + + this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); } } - + } - allPlanComponents:any //所有预案组件 - companyId : any //新建预案需要使用的id - planId : any //统一预案id + allPlanComponents: any //所有预案组件 + companyId: any //新建预案需要使用的id + planId: any //统一预案id lookUrl //查看文件路径 //改名 - changeName(element){ + changeName(element) { // console.log(element) const dialogRef = this.dialog.open(ChangeName, { - data: {element:element} + data: { element: element } }); dialogRef.afterClosed().subscribe( - data=>{ - if(data){ + data => { + if (data) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('修改成功!','确定',config); + this.snackBar.open('修改成功!', '确定', config); this.getAllPlanComponents() - } + } } ); } //获得所有预案组件 - getAllPlanComponents(){ - let pagetype = this.route.snapshot.queryParams.pagetype - let unitId = this.route.snapshot.queryParams.unitId - let paramsData:any - if(pagetype == 'entryplan'){ + getAllPlanComponents() { + let pagetype = this.route.snapshot.queryParams.pagetype + let unitId = this.route.snapshot.queryParams.unitId + let paramsData: any + if (pagetype == 'entryplan') { paramsData = { - companyId:unitId, + companyId: unitId, pageNumber: this.PageNumber, pageSize: "", sort: "" } } - if(pagetype == 'passplan'){ + if (pagetype == 'passplan') { paramsData = { - companyId:unitId, + companyId: unitId, pageNumber: this.PageNumber, pageSize: "", - AuditStatus:2, + AuditStatus: 2, sort: "" } } - if(pagetype == 'openplan'){ + if (pagetype == 'openplan') { paramsData = { - companyId:unitId, + companyId: unitId, pageNumber: this.PageNumber, pageSize: "", - IsPublic:true, + IsPublic: true, sort: "" } } - - this.http.get("/api/PlanComponents",{params:paramsData}).subscribe((data:any)=>{ + + this.http.get("/api/PlanComponents", { params: paramsData }).subscribe((data: any) => { this.length = data.totalCount this.allPlanComponents = data this.tabledataSource = data.items }) } //删除预案 - deletePlan(plandata){ - + deletePlan(plandata) { + const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 let isTrue = confirm('您确定要删除吗') if (isTrue) { - if(plandata.planType == 1){//如果删除的是二维预案 - this.http.delete(`/api/PlanComponents2D/${plandata.id}`).subscribe(data=>{ - this.snackBar.open('删除成功!','确定',config); + if (plandata.planType == 1) {//如果删除的是二维预案 + this.http.delete(`/api/PlanComponents2D/${plandata.id}`).subscribe(data => { + this.snackBar.open('删除成功!', '确定', config); this.getAllPlanComponents() }) - }else{ - this.http.delete(`/api/PlanComponents/${plandata.id}`).subscribe(data=>{ + } else { + this.http.delete(`/api/PlanComponents/${plandata.id}`).subscribe(data => { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('删除成功!','确定',config); + this.snackBar.open('删除成功!', '确定', config); this.getAllPlanComponents() }) } } - + } //提交审核 - submitAudit(element){ + submitAudit(element) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - /* if(element.auditStatus == 4){ - this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!','确定',config); - } */ - if(element.planType == 1){//如果提交审核的是二维预案 - if(element.auditStatus ==8){ - this.http.put(`/api/PlanComponents2D/${element.id}/Commit`,"").subscribe(data=>{ - this.getAllPlanComponents() - },err => { - this.snackBar.open(err,'确定',config); - }) - } - else{ - this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!','确定',config); - } - }else{ - this.http.put(`/api/PlanComponents/${element.id}/Commit`,"").subscribe(data=>{ + /* if(element.auditStatus == 4){ + this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!','确定',config); + } */ + if (element.planType == 1) {//如果提交审核的是二维预案 + if (element.auditStatus == 8) { + this.http.put(`/api/PlanComponents2D/${element.id}/Commit`, "").subscribe(data => { this.getAllPlanComponents() - },err => { - this.snackBar.open(err,'确定',config); + }, err => { + this.snackBar.open(err, '确定', config); }) } - - + else { + this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!', '确定', config); + } + } else { + this.http.put(`/api/PlanComponents/${element.id}/Commit`, "").subscribe(data => { + this.getAllPlanComponents() + }, err => { + this.snackBar.open(err, '确定', config); + }) + } + + } //撤销审核 - cancelAudit(element){ - if(element.planType == 1){//如果撤销审核的是二维预案 - this.http.put(`/api/PlanComponents2D/${element.id}/Cancel`,"").subscribe(data=>{ + cancelAudit(element) { + if (element.planType == 1) {//如果撤销审核的是二维预案 + this.http.put(`/api/PlanComponents2D/${element.id}/Cancel`, "").subscribe(data => { this.getAllPlanComponents() }) - }else{ - this.http.put(`/api/PlanComponents/${element.id}/Cancel`,"").subscribe(data=>{ + } else { + this.http.put(`/api/PlanComponents/${element.id}/Cancel`, "").subscribe(data => { this.getAllPlanComponents() - },err => { + }, err => { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open(err,'确定',config); + this.snackBar.open(err, '确定', config); }) } } //审核结果 - auditResult(element){ + auditResult(element) { // console.log(element) const dialogRef = this.dialog.open(AuditResult, { - width:"395px", - data: {element:element} + width: "395px", + data: { element: element } }); dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - - } + data => { + if (data) { + + } } ); } //下载↓ - selectDownloadFile:any; //选择下载的文件 - download:any; //下载文件元数据 - downloadisLoading:boolean = false; //进度条loading加载 - downloadProgress:number=0; //进度条进度 - downloadFileName:any + selectDownloadFile: any; //选择下载的文件 + download: any; //下载文件元数据 + downloadisLoading: boolean = false; //进度条loading加载 + downloadProgress: number = 0; //进度条进度 + downloadFileName: any - uploadFileLonging:any + uploadFileLonging: any //读取下载文件信息 - readFile (element) { + readFile(element) { this.uploadFileLonging = element const dialogRef = this.dialog.open(DownloadFile, { - width:"435px", + width: "435px", // height:"410px", - data: {fileUrls:element.attachmentUrls,compantData:this.unitdata.unitname,element:element} + data: { fileUrls: element.attachmentUrls, compantData: this.unitdata.unitname, element: element } }); dialogRef.afterClosed().subscribe( - data=>{ - if(data){ + data => { + if (data) { this.downloadFileName = data.fileName this.download = data this.downloadFile() @@ -404,30 +372,30 @@ export class EntryPlanLookComponent implements OnInit { } //初始化下载 - downloadFile () { + downloadFile() { this.downloadProgress = 0 let file = this.download let fileSize = file.fileLength//下载文件的总大小 let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB - if (file && fileSize<=shardSize) { //<=10MB时直接下载 + if (file && fileSize <= shardSize) { //<=10MB时直接下载 this.downloadisLoading = true // this.setFileLoading() - this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{ + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { responseType: 'blob' },).subscribe(data => { let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址 let link = document.createElement("a"); link.style.display = "none"; link.href = url; - let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; - link.setAttribute("download", file.fileName ? file.fileName : this.unitdata.unitname + "-" +this.uploadFileLonging.name + "." + suffix); + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); + link.setAttribute("download", file.fileName ? file.fileName : this.unitdata.unitname + "-" + this.uploadFileLonging.name + "." + suffix); document.body.appendChild(link); link.click(); this.downloadisLoading = false // this.setFileLoading() }) - } else if (file && fileSize > shardSize) { //>10MB时分块下载 + } else if (file && fileSize > shardSize) { //>10MB时分块下载 this.blockingDownload() //分段下载 this.downloadisLoading = true // this.setFileLoading() @@ -436,31 +404,32 @@ export class EntryPlanLookComponent implements OnInit { } //分段下载并合并 - async blockingDownload () { + async blockingDownload() { let file = this.download let fileSize = file.fileLength //下载文件的总大小 let shardSize = 3 * 1024 * 1024 //3MB一个分片 let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段 - let allFile:any = [] //所有的file分段 + let allFile: any = [] //所有的file分段 - for (let i=0;i{ - this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ - result(data) }) + let result = await new Promise((result, reject) => { + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => { + result(data) + }) }) allFile.push(result) - this.downloadProgress = Number((i/allSlice).toFixed(2))*100 + this.downloadProgress = Number((i / allSlice).toFixed(2)) * 100 if (allFile.length === allSlice) { //合并文件输出给浏览器 let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址 let link = document.createElement("a"); link.style.display = "none"; link.href = url; - let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; - link.setAttribute("download", file.fileName ? file.fileName : this.unitdata.unitname + "-" +this.uploadFileLonging.name + "." + suffix); + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); + link.setAttribute("download", file.fileName ? file.fileName : this.unitdata.unitname + "-" + this.uploadFileLonging.name + "." + suffix); document.body.appendChild(link); link.click(); // this.downloadProgress = 0 @@ -473,11 +442,11 @@ export class EntryPlanLookComponent implements OnInit { } //取消分块下载 - cancelDowload () { + cancelDowload() { } //封装函数设置当前文件loading状态 - setFileLoading () { + setFileLoading() { // let id = this.selectDownloadFile.id // this.CADList.forEach(element => { // if (element.id === id) { element.loading = !element.loading } @@ -485,28 +454,28 @@ export class EntryPlanLookComponent implements OnInit { } //新建预案弹出框 - addplan () { + addplan() { const dialogRef = this.dialog.open(AddPlanone, { - width:"585px", - height:"430px", - data: {companyId:this.companyId}, - disableClose:true + width: "585px", + height: "430px", + data: { companyId: this.companyId }, + disableClose: true }); dialogRef.afterClosed().subscribe( - data=>{ - if(data){ + data => { + if (data) { // this.route.snapshot.queryParams.id = data.planId this.planId = data.planId this.getAllPlanComponents() - if(data.planMode == 2){//如果添加方式为在线编辑 - sessionStorage.setItem("planId",data.id); - sessionStorage.setItem("companyId",this.companyId) - sessionStorage.setItem("buildingTypeId",this.unittypeId) - sessionStorage.setItem("editable","1") + if (data.planMode == 2) {//如果添加方式为在线编辑 + sessionStorage.setItem("planId", data.id); + sessionStorage.setItem("companyId", this.companyId) + sessionStorage.setItem("buildingTypeId", this.unittypeId) + sessionStorage.setItem("editable", "1") let companyId = sessionStorage.getItem("companyId") window.open(`/keyUnit/editunitinfo?id=${companyId}`); } - } + } } ); } @@ -518,18 +487,18 @@ export class EntryPlanLookComponent implements OnInit { selector: 'AddPlanone', templateUrl: './AddPlanone.html', styleUrls: ['./entry-plan-look.component.scss'], - + }) export class AddPlanone { isLinear = true; //是否为线性步进器 firstFormGroup: FormGroup; secondFormGroup: FormGroup; - constructor(private _formBuilder: FormBuilder,private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar,private tree: TreeService) {} - - - + constructor(private _formBuilder: FormBuilder, private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar, private tree: TreeService) { } + + + ngOnInit(): void { - this.levels=sessionStorage.getItem("level") + this.levels = sessionStorage.getItem("level") this.firstFormGroup = this._formBuilder.group({ firstCtrlone: ['', Validators.required], firstCtrltwo: ['', Validators.required], @@ -538,133 +507,135 @@ export class AddPlanone { this.secondFormGroup = this._formBuilder.group({ secondCtrl: ['', Validators.required] }); - + } onNoClick(): void { this.dialogRef.close(); } levels// - isup:boolean = true //上传input框是否显示 - isweb:boolean = false //web输入框是否显示 - isinput:boolean = false //导入是否显示 + isup: boolean = true //上传input框是否显示 + isweb: boolean = false //web输入框是否显示 + isinput: boolean = false //导入是否显示 defaultisshow = '0' //默认显示上传input框 - pswShow=false //是否为全景图选项默认不显示 + pswShow = false //是否为全景图选项默认不显示 psw//是否为全景图 cadPlan//是否为卡片预案 //选择radio - selectradio(e){ - if(e.value == "0"){ //如果点击本地上传 + selectradio(e) { + if (e.value == "0") { //如果点击本地上传 this.isup = true this.isinput = false this.isweb = false this.webaddress = "" } - if(e.value == "1"){ //如果点击导入word文档 + if (e.value == "1") { //如果点击导入word文档 this.isinput = true this.isup = false this.isweb = false this.webaddress = "" } - if(e.value == "2"){ //如果点击在线编辑 + if (e.value == "2") { //如果点击在线编辑 this.isinput = false this.isup = false this.isweb = false this.webaddress = "" } - if(e.value == "3"){ //如果点击输入网址 + if (e.value == "3") { //如果点击输入网址 this.isweb = true this.isup = false this.isinput = false this.webaddress = "" } } - file2:any = null; //导入的文件 - webaddress:any = "" //输入的网页地址 + file2: any = null; //导入的文件 + webaddress: any = "" //输入的网页地址 //上传文件↓ - file:any; //上传的文件 - fileName:any; //上传文件name - uploadisLoading:boolean = false; //进度条loading加载 - uploadProgress:number=0; //进度条进度 - objectName:any; //上传对象名 - uploadId:any; //上传分块上传事件编号 - //上传文件input - filechange(e){ - this.psw=false - this.file = e.target.files[0] || null //上传的文件 - if(this.selectedPLanType=='4'&&this.file.type!=null&&this.file.type!=undefined){ - if(this.file.type=='image/png'||this.file.type=='image/jpeg'){ - this.pswShow=true - }else{this.pswShow=false} - }else{this.pswShow=false} - - // this.startUploading() -} + file: any; //上传的文件 + fileName: any; //上传文件name + uploadisLoading: boolean = false; //进度条loading加载 + uploadProgress: number = 0; //进度条进度 + objectName: any; //上传对象名 + uploadId: any; //上传分块上传事件编号 + //上传文件input + filechange(e) { + this.psw = false + this.file = e.target.files[0] || null //上传的文件 + if (this.selectedPLanType == '4' && this.file.type != null && this.file.type != undefined) { + if (this.file.type == 'image/png' || this.file.type == 'image/jpeg') { + this.pswShow = true + } else { this.pswShow = false } + } else { this.pswShow = false } + + // this.startUploading() + } //上传文件 - startUploading (planType) { + startUploading(planType) { let file = this.file || null //获取上传的文件 let fileSize = file.size || null //上传文件的总大小 let shardSize = 5 * 1024 * 1024 //5MB一个分片 // console.log(this.psw) - if (file && fileSize<=shardSize) { //上传文件<=5MB时 + if (file && fileSize <= shardSize) { //上传文件<=5MB时 let formData = new FormData() - formData.append("file",file) - this.http.post(this.psw?'/api/Objects/PlanPlatform/psw': `/api/Objects/PlanPlatform/${this.data.companyId}/2D`,formData).subscribe((data:any)=>{ + formData.append("file", file) + this.http.post(this.psw ? '/api/Objects/PlanPlatform/psw' : `/api/Objects/PlanPlatform/${this.data.companyId}/2D`, formData).subscribe((data: any) => { this.objectName = data.objectName const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('上传成功!','确定',config); + this.snackBar.open('上传成功!', '确定', config); this.uploadover = true let level = sessionStorage.getItem("level") // console.log(level) - let PlanLevel - if(level == '0'){ - PlanLevel = 1 + let PlanLevel + if (level == '0') { + PlanLevel = 1 } - if(level == '1'){ - PlanLevel = 2 + if (level == '1') { + PlanLevel = 2 } - if(level == '2'){ - PlanLevel = 4 + if (level == '2') { + PlanLevel = 4 } - if(level == '3'){ - PlanLevel = 8 + if (level == '3') { + PlanLevel = 8 } let uploadUrl - if(planType == "非二维"){ + if (planType == "非二维") { uploadUrl = "/api/PlanComponents" - }else{ + } else { uploadUrl = "/api/PlanComponents2D" } - if(this.uploadover){ - this.http.post(uploadUrl,{ + if (this.uploadover) { + this.http.post(uploadUrl, { id: "", name: this.selectedPLanName, - planType:Number(this.selectedPLanType), + planType: Number(this.selectedPLanType), planMode: Number(this.defaultisshow), planLevel: PlanLevel, planCategory: Number(this.selectedPLanLevel), url: "", attachmentUrls: [`${this.objectName}`] - },{params:{ - companyId : this.data.companyId - }}).subscribe(data=>{ + }, { + params: { + companyId: this.data.companyId + } + }).subscribe(data => { this.dialogRef.close(data); }) - }else{ + } else { console.log("上传出错") } - + }) - } else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传 - let data = {filename: file.name} + } else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传 + let data = { filename: file.name } this.uploadisLoading = true - this.http.post(this.psw?'/api/NewMultipartUpload/PlanPlatform/psw':`/api/NewMultipartUpload/PlanPlatform/${this.data.companyId}/2D`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传 + this.http.post(this.psw ? '/api/NewMultipartUpload/PlanPlatform/psw' : `/api/NewMultipartUpload/PlanPlatform/${this.data.companyId}/2D`, {}, { params: data }).subscribe((data: any) => { //初始化分段上传 this.objectName = data.objectName this.uploadId = data.uploadId this.subsectionUploading(planType) @@ -672,206 +643,210 @@ export class AddPlanone { } } - - PartNumberETag:any=[]; //每次返回需要保存的信息 + + PartNumberETag: any = []; //每次返回需要保存的信息 //开始分段上传 - async subsectionUploading (planType) { + async subsectionUploading(planType) { let file = this.file || null //获取上传的文件 let fileSize = file.size || null //上传文件的总大小 let shardSize = 5 * 1024 * 1024 //5MB一个分片 let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整 - for (let i = 0;i < allSlice;i++) { //循环分段上传 - let start = i * shardSize //切割文件开始位置 - let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数) - let formData = new FormData() - formData.append("file",file.slice(start, end)) - - //同步写法实现异步调用 - let result = await new Promise((resolve, reject) => { - // await 需要后面返回一个 promise 对象 - this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ - let msg = { - "partNumber":data.partNumber || null, - "eTag": data.eTag || null} - resolve(msg) // 调用 promise 内置方法处理成功 - }) - }); - this.PartNumberETag.push(result) - this.uploadProgress = Number((i/allSlice).toFixed(2))*100 + for (let i = 0; i < allSlice; i++) { //循环分段上传 + let start = i * shardSize //切割文件开始位置 + let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数) + let formData = new FormData() + formData.append("file", file.slice(start, end)) + + //同步写法实现异步调用 + let result = await new Promise((resolve, reject) => { + // await 需要后面返回一个 promise 对象 + this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i + 1}`, formData).subscribe((data: any) => { + let msg = { + "partNumber": data.partNumber || null, + "eTag": data.eTag || null + } + resolve(msg) // 调用 promise 内置方法处理成功 + }) + }); + this.PartNumberETag.push(result) + this.uploadProgress = Number((i / allSlice).toFixed(2)) * 100 - if (this.PartNumberETag.length === allSlice) { - this.uploadProgress = 100 - this.endUploading(planType)} + if (this.PartNumberETag.length === allSlice) { + this.uploadProgress = 100 + this.endUploading(planType) + } }//for循环 } - uploadover:any = false //上传完成之后提示 + uploadover: any = false //上传完成之后提示 //完成分块上传 - endUploading (planType) { + endUploading(planType) { let data = this.PartNumberETag - let paramsData = {uploadId:this.uploadId} - this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('上传成功!','确定',config); - this.uploadProgress = 0; - this.uploadisLoading = false - this.PartNumberETag =[] //清空保存返回的信息 - this.uploadover = true - let level = sessionStorage.getItem("level") - // console.log(level) - let PlanLevel - if(level == '0'){ - PlanLevel = 1 - } - if(level == '1'){ - PlanLevel = 2 - } - if(level == '2'){ - PlanLevel = 4 - } - if(level == '3'){ - PlanLevel = 8 - } - let uploadUrl - if(planType == "非二维"){ - uploadUrl = "/api/PlanComponents" - }else{ - uploadUrl = "/api/PlanComponents2D" - } - if(this.uploadover){//如果上次成功了才创建 - this.http.post(uploadUrl,{ - id: "", - name: this.selectedPLanName, - planType:Number(this.selectedPLanType), - planMode: Number(this.defaultisshow), - planLevel: PlanLevel, - planCategory: Number(this.selectedPLanLevel), - url: "", - attachmentUrls: [`${this.objectName}`] - },{params:{ - companyId : this.data.companyId - }}).subscribe(data=>{ - this.dialogRef.close(data); - }) - }else{ - console.log("上传出错!") - } - + let paramsData = { uploadId: this.uploadId } + this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`, data, { params: paramsData }).subscribe(data => { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('上传成功!', '确定', config); + this.uploadProgress = 0; + this.uploadisLoading = false + this.PartNumberETag = [] //清空保存返回的信息 + this.uploadover = true + let level = sessionStorage.getItem("level") + // console.log(level) + let PlanLevel + if (level == '0') { + PlanLevel = 1 + } + if (level == '1') { + PlanLevel = 2 + } + if (level == '2') { + PlanLevel = 4 + } + if (level == '3') { + PlanLevel = 8 + } + let uploadUrl + if (planType == "非二维") { + uploadUrl = "/api/PlanComponents" + } else { + uploadUrl = "/api/PlanComponents2D" + } + if (this.uploadover) {//如果上次成功了才创建 + this.http.post(uploadUrl, { + id: "", + name: this.selectedPLanName, + planType: Number(this.selectedPLanType), + planMode: Number(this.defaultisshow), + planLevel: PlanLevel, + planCategory: Number(this.selectedPLanLevel), + url: "", + attachmentUrls: [`${this.objectName}`] + }, { + params: { + companyId: this.data.companyId + } + }).subscribe(data => { + this.dialogRef.close(data); + }) + } else { + console.log("上传出错!") + } + }) } - + //取消分块上传 - cancel () { - this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ + cancel() { + this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data => { this.uploadProgress = 0; - this.uploadisLoading= false; - (document.getElementById('uploadFile')).value = null - this.PartNumberETag =[] //清空保存返回的信息 + this.uploadisLoading = false; + (document.getElementById('uploadFile')).value = null + this.PartNumberETag = [] //清空保存返回的信息 const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('取消上传成功!','确定',config); + this.snackBar.open('取消上传成功!', '确定', config); this.uploadover = false this.file = null }) } - - + + //导入word文件 - fileInput(e){ + fileInput(e) { this.file2 = e.target.files[0] } //点击下一步 - selectedPLanType:any//所选预案类型 - selectedPLanName:any//所选预案名称 - selectedPLanLevel:any//所选预案级别 - localup:boolean = false //本地上传 - inputword:boolean = false //导入文档 - onlineedit:boolean = false //在线编辑 - website:boolean = false //网页地址 - next(formdata){ + selectedPLanType: any//所选预案类型 + selectedPLanName: any//所选预案名称 + selectedPLanLevel: any//所选预案级别 + localup: boolean = false //本地上传 + inputword: boolean = false //导入文档 + onlineedit: boolean = false //在线编辑 + website: boolean = false //网页地址 + next(formdata) { //console.log(formdata.value.firstCtrlthree) //console.log(this.file) - this.psw=false + this.psw = false this.selectedPLanName = formdata.value.firstCtrlone this.selectedPLanType = formdata.value.firstCtrltwo - this.selectedPLanLevel= formdata.value.firstCtrlthree - if(formdata.value.firstCtrltwo=='16'){ //如果是卡片预案 + this.selectedPLanLevel = formdata.value.firstCtrlthree + if (formdata.value.firstCtrltwo == '16') { //如果是卡片预案 this.localup = true this.inputword = true this.onlineedit = false this.website = false } - if(formdata.value.firstCtrltwo=='1'){ //如果是2D预案 + if (formdata.value.firstCtrltwo == '1') { //如果是2D预案 this.localup = true this.inputword = false this.onlineedit = true this.website = true - } - if(formdata.value.firstCtrltwo=='2' || formdata.value.firstCtrltwo=='4'){ + } + if (formdata.value.firstCtrltwo == '2' || formdata.value.firstCtrltwo == '4') { this.localup = true this.inputword = false this.onlineedit = false this.website = true - this.pswShow=true - } - if(this.selectedPLanType=='4'&&this.file!=undefined&&this.file.type!=null){ - if(this.file.type=='image/png'||this.file.type=='image/jpeg'){ - this.pswShow=true - this.website=false - }else{this.pswShow=false} - }else{this.pswShow=false} - + this.pswShow = true + } + if (this.selectedPLanType == '4' && this.file != undefined && this.file.type != null) { + if (this.file.type == 'image/png' || this.file.type == 'image/jpeg') { + this.pswShow = true + this.website = false + } else { this.pswShow = false } + } else { this.pswShow = false } + } - setttt(){ - this.pswShow=false - this.psw=false + setttt() { + this.pswShow = false + this.psw = false } - closediv(){ + closediv() { //console.log(this.file) - if(this.file!=undefined){ + if (this.file != undefined) { this.cancel(); } - + this.dialogRef.close(); } - + // 提交创建 - onSubmit(value){ + onSubmit(value) { let level = sessionStorage.getItem("level") // console.log(level) - let PlanLevel - if(level == '0'){ - PlanLevel = 1 + let PlanLevel + if (level == '0') { + PlanLevel = 1 } - if(level == '1'){ - PlanLevel = 2 + if (level == '1') { + PlanLevel = 2 } - if(level == '2'){ - PlanLevel = 4 + if (level == '2') { + PlanLevel = 4 } - if(level == '3'){ - PlanLevel = 8 + if (level == '3') { + PlanLevel = 8 } - if(this.selectedPLanType != "1"){//如果创建的不是二维预案 - if(this.defaultisshow == '0' && this.file == null){ //如果是本地上传 + if (this.selectedPLanType != "1") {//如果创建的不是二维预案 + if (this.defaultisshow == '0' && this.file == null) { //如果是本地上传 const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请先上传文件','确定',config); + this.snackBar.open('请先上传文件', '确定', config); } - if(this.defaultisshow == '0' && this.file){ //如果是本地上传并且有文件 + if (this.defaultisshow == '0' && this.file) { //如果是本地上传并且有文件 //先上传成功 this.startUploading("非二维") - + //再创建预案 // this.http.post("/api/PlanComponents",{ // id: "", @@ -888,26 +863,26 @@ export class AddPlanone { // }) } - if(this.defaultisshow == '1'){//如果是导入则很复杂 + if (this.defaultisshow == '1') {//如果是导入则很复杂 const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('暂不支持导入','确定',config); + this.snackBar.open('暂不支持导入', '确定', config); } - if(this.defaultisshow == '3' && (this.webaddress == "" || this.webaddress == null)){ //如果是填写网址 + if (this.defaultisshow == '3' && (this.webaddress == "" || this.webaddress == null)) { //如果是填写网址 const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请先输入网址','确定',config); + this.snackBar.open('请先输入网址', '确定', config); } - if(this.defaultisshow == '3' && this.webaddress){ //如果是填写网址 + if (this.defaultisshow == '3' && this.webaddress) { //如果是填写网址 // console.log(99999,this.selectedPLanType) - var reg = new RegExp('(http|https):\/\/([\w.!@#$%^&*()_+-=])*\s*') - if(reg.test(this.webaddress)){ - let body = { + var reg = new RegExp('(http|https):\/\/([\w.!@#$%^&*()_+-=])*\s*') + if (reg.test(this.webaddress)) { + let body = { id: "", name: this.selectedPLanName, - planType:Number(this.selectedPLanType), + planType: Number(this.selectedPLanType), planMode: Number(this.defaultisshow), planCategory: Number(this.selectedPLanLevel), planLevel: PlanLevel, @@ -915,28 +890,30 @@ export class AddPlanone { attachmentUrls: null } //console.log(body) - this.http.post("/api/PlanComponents",body,{params:{ - companyId : this.data.companyId - }}).subscribe(data=>{ + this.http.post("/api/PlanComponents", body, { + params: { + companyId: this.data.companyId + } + }).subscribe(data => { // console.log("创建成功") this.dialogRef.close(data); }) - }else{ + } else { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请填写正确网址格式,需以http://或者https://开头的正确网址','确定',config); + this.snackBar.open('请填写正确网址格式,需以http://或者https://开头的正确网址', '确定', config); } } - }else{ //如果创建的是二维预案 - if(this.defaultisshow == '0' && this.file == null){ //如果是本地上传 + } else { //如果创建的是二维预案 + if (this.defaultisshow == '0' && this.file == null) { //如果是本地上传 const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请先上传文件','确定',config); + this.snackBar.open('请先上传文件', '确定', config); } - if(this.defaultisshow == '0' && this.file){ + if (this.defaultisshow == '0' && this.file) { this.startUploading("二维") // let body = { // id: "", @@ -954,38 +931,40 @@ export class AddPlanone { // this.dialogRef.close(data); // }) } - if(this.defaultisshow == '2'){ //如果是在线编辑------>跳转编制工具 - let body = { + if (this.defaultisshow == '2') { //如果是在线编辑------>跳转编制工具 + let body = { id: "", name: this.selectedPLanName, - planType:Number(this.selectedPLanType), + planType: Number(this.selectedPLanType), planMode: Number(this.defaultisshow), planLevel: PlanLevel, - planCategory:Number(this.selectedPLanLevel), + planCategory: Number(this.selectedPLanLevel), url: "", attachmentUrls: null } - this.http.post("/api/PlanComponents2D",body,{params:{ - companyId : this.data.companyId - }}).subscribe(data=>{ + this.http.post("/api/PlanComponents2D", body, { + params: { + companyId: this.data.companyId + } + }).subscribe(data => { // console.log("创建成功") this.dialogRef.close(data); }) } - if(this.defaultisshow == '3' && (this.webaddress == "" || this.webaddress == null)){ //如果是填写网址 + if (this.defaultisshow == '3' && (this.webaddress == "" || this.webaddress == null)) { //如果是填写网址 const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请先输入网址','确定',config); + this.snackBar.open('请先输入网址', '确定', config); } - if(this.defaultisshow == '3' && this.webaddress){ //如果是填写网址 + if (this.defaultisshow == '3' && this.webaddress) { //如果是填写网址 - var reg = new RegExp('(http|https):\/\/([\w.!@#$%^&*()_+-=])*\s*') - if(reg.test(this.webaddress)){ - let body = { + var reg = new RegExp('(http|https):\/\/([\w.!@#$%^&*()_+-=])*\s*') + if (reg.test(this.webaddress)) { + let body = { id: "", name: this.selectedPLanName, - planType:Number(this.selectedPLanType), + planType: Number(this.selectedPLanType), planMode: Number(this.defaultisshow), planCategory: Number(this.selectedPLanLevel), planLevel: PlanLevel, @@ -993,28 +972,30 @@ export class AddPlanone { attachmentUrls: null } //console.log(body) - this.http.post("/api/PlanComponents2D",body,{params:{ - companyId : this.data.companyId - }}).subscribe(data=>{ + this.http.post("/api/PlanComponents2D", body, { + params: { + companyId: this.data.companyId + } + }).subscribe(data => { // console.log("创建成功") this.dialogRef.close(data); }) - }else{ + } else { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请填写正确网址格式,需以http://或者https://开头的正确网址','确定',config); + this.snackBar.open('请填写正确网址格式,需以http://或者https://开头的正确网址', '确定', config); } - + } - + } } - onSubmit2(value){ + onSubmit2(value) { // console.log(this.webaddress) - var reg = new RegExp('(http|https):\/\/([\w.!@#$%^&*()_+-=])*\s*') + var reg = new RegExp('(http|https):\/\/([\w.!@#$%^&*()_+-=])*\s*') //console.log(reg.test(this.webaddress)) } @@ -1035,20 +1016,20 @@ export class AddPlanone { styleUrls: ['./entry-plan-look.component.scss'] }) export class DownloadFile { - - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} - fileUrls:any //当前预案附件地址 - fileDatas:any = [] - selectedFileIndex : any = 0 - selectedFileData : any - - name2:any //如果真实姓名为空时 + + constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } + fileUrls: any //当前预案附件地址 + fileDatas: any = [] + selectedFileIndex: any = 0 + selectedFileData: any + + name2: any //如果真实姓名为空时 ngOnInit(): void { this.name2 = this.data.element.name this.fileUrls = this.data.fileUrls - this.fileUrls.forEach(item=>{ - this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{ - data.filePige = (data.fileLength / (1024*1024)).toFixed(2) + this.fileUrls.forEach(item => { + this.http.get('/api/ObjectMetadata/PlanPlatform/' + item).subscribe((data: any) => { + data.filePige = (data.fileLength / (1024 * 1024)).toFixed(2) this.fileDatas.push(data) this.selectedFileData = data }) @@ -1058,12 +1039,12 @@ export class DownloadFile { this.dialogRef.close(); } - confirm(){ + confirm() { this.dialogRef.close(this.selectedFileData); } - + //点击想要下载的文件 - addurl(item,key){ + addurl(item, key) { // console.log(item,key) this.selectedFileIndex = key this.selectedFileData = item @@ -1078,18 +1059,18 @@ export class DownloadFile { styleUrls: ['./entry-plan-look.component.scss'] }) export class AuditResult { - - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} - planName:any = this.data.element.name - commitTime:any = this.data.element.committedTime - commitOrganizationName:any = this.data.element.committerOrganizationName + constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } - auditOrganizationName:any = this.data.element.auditorOrganizationName - auditResult:any = this.data.element.auditStatus - auditOpinion:any = this.data.element.auditOpinion + planName: any = this.data.element.name + commitTime: any = this.data.element.committedTime + commitOrganizationName: any = this.data.element.committerOrganizationName + + auditOrganizationName: any = this.data.element.auditorOrganizationName + auditResult: any = this.data.element.auditStatus + auditOpinion: any = this.data.element.auditOpinion ngOnInit(): void { - + } onNoClick(): void { this.dialogRef.close(); @@ -1104,16 +1085,16 @@ export class AuditResult { styleUrls: ['./entry-plan-look.component.scss'] }) export class ChangeName { - - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} - planName:any//预案名称 + + constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } + planName: any//预案名称 ngOnInit(): void { this.planName = this.data.element.name } onNoClick(): void { this.dialogRef.close(); } - onSubmit(value){ + onSubmit(value) { let headers = new HttpHeaders({ 'Content-Type': 'text/json' }); @@ -1121,12 +1102,12 @@ export class ChangeName { headers }; let body = JSON.stringify(value.name); - if(this.data.element.planType == 1){//如果是二维预案 - this.http.put(`/api/PlanComponents2D/${this.data.element.id}`,body,options).subscribe(data=>{ + if (this.data.element.planType == 1) {//如果是二维预案 + this.http.put(`/api/PlanComponents2D/${this.data.element.id}`, body, options).subscribe(data => { this.dialogRef.close("success"); }) - }else{ - this.http.put(`/api/PlanComponents/${this.data.element.id}`,body,options).subscribe(data=>{ + } else { + this.http.put(`/api/PlanComponents/${this.data.element.id}`, body, options).subscribe(data => { this.dialogRef.close("success"); }) } @@ -1139,14 +1120,14 @@ export class ChangeName { templateUrl: './Photo-Sphere-Viewer.html', styleUrls: ['./entry-plan-look.component.scss'] }) -export class PsViewer{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} +export class PsViewer { + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } ngOnInit(): void { // console.log(this.data) const viewer = new Viewer({ container: document.querySelector('#viewer'), - panorama:'/api/Objects/PlanPlatform/'+ this.data, - + panorama: '/api/Objects/PlanPlatform/' + this.data, + }); } } @@ -1157,41 +1138,41 @@ export class PsViewer{ templateUrl: './previewImg.html', styleUrls: ['./entry-plan-look.component.scss'] }) -export class ImgDetails{ - constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef, +export class ImgDetails { + constructor(private http: HttpClient, public dialog: MatDialog, public dialogRef: MatDialogRef, @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} - } + 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 } + } } \ No newline at end of file diff --git a/src/app/plan-management/open-plan/open-plan.component.scss b/src/app/plan-management/open-plan/open-plan.component.scss index 7e795ed..1f75fe5 100644 --- a/src/app/plan-management/open-plan/open-plan.component.scss +++ b/src/app/plan-management/open-plan/open-plan.component.scss @@ -1,103 +1,174 @@ .header { - width: 100%; - padding: 12px 5px; + width: 100%; + padding: 12px 5px; // margin-bottom: 10px; - box-sizing: border-box; + box-sizing: border-box; + // border-bottom: 1px solid black; - .queryBox { - box-sizing: border-box; - padding: 5px 0 0 15px; - display: flex; - flex-direction: row; - flex-wrap: wrap; - align-items:center; - // justify-content:center; - .queryField { - //margin: 3px 10px; - input { + .queryBox { + box-sizing: border-box; + padding: 5px 0 0 15px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items: center; + + // justify-content:center; + .queryField { + + //margin: 3px 10px; + input { + width: 180px; + height: 22px; + line-height: 22px; + border-radius: 3px; + } + + @media screen and (min-device-width:1400px) { + margin: 3px 20px; + } + + @media screen and (max-device-width:1400px)and (min-device-width:1200px) { + margin: 3px 10px; + + mat-form-field { width: 180px; - height: 22px; - line-height: 22px; - border-radius: 3px; - } - @media screen and (min-device-width:1400px){ - margin: 3px 20px; - } - @media screen and (max-device-width:1400px)and (min-device-width:1200px){ - margin: 3px 10px; - mat-form-field{ - width: 180px; - } - } - @media screen and (max-device-width:1200px){ - margin: 3px 0 3px 10px; - mat-form-field{ - width: 130px; - } } } - - } //queryBox - .ordiv{ - position: relative; - - .organizationbox{ - width:450px; - height: 200px; - background: white; - position: absolute; - top: 48px; - left: 77px; - z-index: 999; - border: 1px solid grey; - overflow-y: auto; - li{ - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - mat-tree-node{ - cursor: pointer; - white-space:pre; - } - mat-tree-node:hover{ - background: rgba(225, 225, 225, 0.8); - } - .closediv{ - z-index: 100; - position: absolute; - right: 0; - top: 0; - width: 30px; - height: 30px; - cursor: pointer; - line-height: 30px; - text-align: center; - } - .closediv:hover{ - background:rgba(225, 225, 225, 0.8); - } + + @media screen and (max-device-width:1200px) { + margin: 3px 0 3px 10px; + + mat-form-field { + width: 130px; } - + } } + } - .body{ - .buttonbox{ - padding-left: 50px; - button{ - margin:0 10px - } + + //queryBox + .ordiv { + position: relative; + + .organizationbox { + width: 450px; + height: 200px; + background: white; + position: absolute; + top: 48px; + left: 77px; + z-index: 999; + border: 1px solid grey; + overflow-y: auto; + + li { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + mat-tree-node { + cursor: pointer; + white-space: pre; + } + + mat-tree-node:hover { + background: rgba(225, 225, 225, 0.8); } - .tablebox{ - table{ - width: 100%; - margin-top: 15px; - } - th,td{ - text-align: center; - } - mat-paginator{ - width: 100%; - } + + .closediv { + z-index: 100; + position: absolute; + right: 0; + top: 0; + width: 30px; + height: 30px; + cursor: pointer; + line-height: 30px; + text-align: center; } - } \ No newline at end of file + + .closediv:hover { + background: rgba(225, 225, 225, 0.8); + } + } + + } +} + +.body { + .buttonbox { + padding-left: 50px; + + button { + margin: 0 10px + } + } + + .tablebox { + table { + width: 100%; + margin-top: 15px; + } + + th, + td { + text-align: center; + } + + mat-paginator { + width: 100%; + } + } +} + +@media screen and (max-width:1200px) { + .bigimgbox { + width: 880px; + height: 580px; + + //预览图片 + .previewImgBox { + width: 800px; + height: 475px; + text-align: center; + } + } +} + +@media screen and (min-width:1200px) and (max-width:1400px) { + .bigimgbox { + width: 880px; + height: 610px; + + //预览图片 + .previewImgBox { + width: 800px; + height: 500px; + text-align: center; + } + } + +} + +@media screen and (min-width:1400px) { + .bigimgbox { + width: 1110px; + height: 860px; + + //预览图片 + .previewImgBox { + width: 900px; + height: 100%; + text-align: center; + } + + .previewImgBottom { + text-align: center; + height: 30px; + margin: 20px auto; + } + } + +} diff --git a/src/app/plan-management/open-plan/open-plan.component.spec.ts b/src/app/plan-management/open-plan/open-plan.component.spec.ts deleted file mode 100644 index 9a257ca..0000000 --- a/src/app/plan-management/open-plan/open-plan.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { OpenPlanComponent } from './open-plan.component'; - -describe('OpenPlanComponent', () => { - let component: OpenPlanComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ OpenPlanComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(OpenPlanComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/plan-management/open-plan/open-plan.component.ts b/src/app/plan-management/open-plan/open-plan.component.ts index 2182d1a..8ec87f1 100644 --- a/src/app/plan-management/open-plan/open-plan.component.ts +++ b/src/app/plan-management/open-plan/open-plan.component.ts @@ -4,13 +4,14 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree' import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; import { FormControl } from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' import { PageEvent } from '@angular/material/paginator'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { TreeService } from '../../http-interceptors/tree.service' import { Viewer } from 'photo-sphere-viewer'; declare var CryptoJS +import Swiper from 'swiper'; @Component({ selector: 'app-open-plan', templateUrl: './open-plan.component.html', @@ -18,8 +19,8 @@ declare var CryptoJS }) export class OpenPlanComponent implements OnInit { - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } - + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } + private _transformer = (node, level: number) => { //初始化tree return { expandable: !!node.children && node.children.length > 0, @@ -35,145 +36,145 @@ export class OpenPlanComponent implements OnInit { dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); myControl = new FormControl(); hasChild = (_: number, node: any) => node.expandable; - //分页 - @ViewChild(MatPaginator, {static: true}) + //分页 + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any; //第几页 + PageNumber: any; //第几页 + + displayedColumns: string[] = ['unitname', 'planname', 'addpeople', 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation']; - displayedColumns: string[] = ['unitname', 'planname', 'addpeople','addtime','plantype','auditStatus','openRange','projectlevel','operation']; - - allorganizations:any //所有组织机构 - allunittype:any //所有单位类型 - tabledataSource:any //表格数据 - preparelevels:any //编制级别 + allorganizations: any //所有组织机构 + allunittype: any //所有单位类型 + tabledataSource: any //表格数据 + preparelevels: any //编制级别 ngOnInit(): void { - if(window.matchMedia("(max-width: 1400px)").matches){ - this.pcMore=false - this.padMore=true - this.pcfind=false - this.padjt=true - }else{ - this.pcfind=true - this.pcMore=true - this.padMore=false - this.padjt=false + if (window.matchMedia("(max-width: 1400px)").matches) { + this.pcMore = false + this.padMore = true + this.pcfind = false + this.padjt = true + } else { + this.pcfind = true + this.pcMore = true + this.padMore = false + this.padjt = false } this.getunitdata(); this.getOrganizations(); this.getUnittype(); this.getAllPlanInfo(); //得到所有单位 let level = sessionStorage.getItem("level"); - if(level == "0"){//如果是总队 + if (level == "0") {//如果是总队 this.preparelevels = [ - {name:"总队",value:"1"}, - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "总队", value: "1" }, + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "1"){//如果是支队 + if (level == "1") {//如果是支队 this.preparelevels = [ - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "2"){//如果是大队 + if (level == "2") {//如果是大队 this.preparelevels = [ - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "3"){//如果是中队 + if (level == "3") {//如果是中队 this.preparelevels = [ - {name:"中队",value:"8"} + { name: "中队", value: "8" } ] } } pcMore//pc更多 - pcput=false//pc收起 + pcput = false//pc收起 pcfind//pc查询 - padjt=false - padMore=true//pad收缩控制 - padput=false//pad收起按钮 - imgsrcopen="../../../assets/images/routdown2.png" - imgsrcdown="../../../assets/images/routup2.png" - pcInfo(){ - this.pcMore=!this.pcMore - this.pcput=!this.pcput + padjt = false + padMore = true//pad收缩控制 + padput = false//pad收起按钮 + imgsrcopen = "../../../assets/images/routdown2.png" + imgsrcdown = "../../../assets/images/routup2.png" + pcInfo() { + this.pcMore = !this.pcMore + this.pcput = !this.pcput } - padInfo(){ - this.padMore=!this.padMore - this.padput=!this.padput + padInfo() { + this.padMore = !this.padMore + this.padput = !this.padput } - allPlanInfo:any //存储所有预案信息 + allPlanInfo: any //存储所有预案信息 //获得所有预案信息 - getAllPlanInfo(){ - let paramsdata:any = { + getAllPlanInfo() { + let paramsdata: any = { CompanyName: this.companyName || '', - OrganizationId: '', - HasChildrenOrganization:'', - BuildingTypeId: this.unittype || '', + OrganizationId: '', + HasChildrenOrganization: '', + BuildingTypeId: this.unittype || '', PlanType: this.reservePlanType || '', - AuditStatus:'', //审核状态 - PlanLevel: this.preparelevel || '', + AuditStatus: '', //审核状态 + PlanLevel: this.preparelevel || '', HasChildrenPlanLevel: this.plcheck || '', PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], + PageSize: this.pageSizeOptions[0], Sort: '' } - this.http.get("/api/PublicPlans",{params:paramsdata}).subscribe((data:any)=>{ + this.http.get("/api/PublicPlans", { params: paramsdata }).subscribe((data: any) => { // console.log(111,data) this.length = data.totalCount this.allPlanInfo = data - this.tabledataSource = data.items + this.tabledataSource = data.items }) } //得到当前单位信息 - getunitdata(){ + getunitdata() { this.http.get("/api/Account/Profiles").subscribe( - (data:any)=>{ - this.organizationName = data.organizationName + (data: any) => { + this.organizationName = data.organizationName } ) } - organizationName:any //当前单位组织机构名称 - treedata:any //组织机构树型数据 - newArr:any = [] - newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 + organizationName: any //当前单位组织机构名称 + treedata: any //组织机构树型数据 + newArr: any = [] + newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段 //得到当前单位所在组织机构的tree型数据 - getpresentOrganization(){ + getpresentOrganization() { this.newallorganizations = this.allorganizations this.newallorganizations.forEach(item => { item.children = [] this.newallorganizations.forEach(element => { - if(element.parentId == item.id){ + if (element.parentId == item.id) { item.children.push(element) } }); }); // console.log(666,this.organizationName) - if(this.organizationName){ + if (this.organizationName) { this.newallorganizations.forEach(item => { - if(item.name == this.organizationName){ + if (item.name == this.organizationName) { this.dataSource.data = [item] } }); - }else{ + } else { this.dataSource.data = this.tree.toTree(this.treedata); } - + } //获得所有组织机构 - getOrganizations(){ + getOrganizations() { this.http.get('/api/Organizations').subscribe( - (data:any)=>{ + (data: any) => { this.allorganizations = data this.treedata = this.tree.toTree(data); this.getpresentOrganization(); @@ -182,87 +183,72 @@ export class OpenPlanComponent implements OnInit { } //获得所有单位类型 - getUnittype(){ + getUnittype() { this.http.get('/api/BuildingTypes/Simple').subscribe( - data=>{ + data => { this.allunittype = data } ) } //跳转查看预案页面 公开预案 - routerTo(e){ - /* sessionStorage.setItem("companyName",element.companyName) - window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=2`); */ - - // console.log(e) - if(e.planMode == 0||e.planMode == 1){ - //console.log(e.attachmentUrls) - var index=e.attachmentUrls[0].indexOf("\/") - if(e.attachmentUrls[0].substr(0,index)=='psw'){ - const dialogRef = this.dialog.open(GkhtmlPsViewer, { - width: '1500px', - height:'800px', - data: e.attachmentUrls[0] - }); + routerTo(e) { + console.log(e) + if (e.planMode == 0 || e.planMode == 1) { + var index = e.attachmentUrls[0].indexOf("\/") + if (e.attachmentUrls[0].substr(0, index) == 'psw') { + const dialogRef = this.dialog.open(GkhtmlPsViewer, { + 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(OpenImgDetails, {//调用open方法打开对话框并且携带参数过去 + data: data.attachmentUrls, + }); + 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); + } } - 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') */{ - let filename:string - let fetchUrl = e.attachmentUrls[0] - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ - filename=data.fileName - let json={ - doc: { - docId: docId, - title: filename, - fetchUrl: `http://39.106.78.171:8000/api/Objects/PlanPlatform/`+fetchUrl, - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: [ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - 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}`) - }) - } - } - - if(e.planMode == 2){ //如果是在线编辑 - let id = e.id - sessionStorage.setItem("planId",id) - sessionStorage.setItem("companyId",e.companyId) - //sessionStorage.setItem("buildingTypeId",this.unittypeId) - sessionStorage.setItem("editable","0") - sessionStorage.setItem("planName",e.name) - let companyId = sessionStorage.getItem("companyId") - window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); - } - if(e.planMode == 3){ //如果是跳转网页 - sessionStorage.setItem("url",e.url) - window.open(`/planManagement/webLook`) } + } + + if (e.planMode == 2) { //如果是在线编辑 + let id = e.id + sessionStorage.setItem("planId", id) + sessionStorage.setItem("companyId", e.companyId) + //sessionStorage.setItem("buildingTypeId",this.unittypeId) + sessionStorage.setItem("editable", "0") + sessionStorage.setItem("planName", e.name) + let companyId = sessionStorage.getItem("companyId") + window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); + } + if (e.planMode == 3) { //如果是跳转网页 + sessionStorage.setItem("url", e.url) + window.open(`/planManagement/webLook`) + } } //分页事件 - chagePage(e){ - this.PageNumber = e.pageIndex+1 + chagePage(e) { + this.PageNumber = e.pageIndex + 1 this.getAllPlanInfo(); - } + } //辖区中队div是否显示 - isorganizationbox:boolean = false + isorganizationbox: boolean = false //点击辖区中队树,将选择的辖区中队添加到变量 add(node) { this.isorganizationbox = false @@ -278,23 +264,23 @@ export class OpenPlanComponent implements OnInit { this.isorganizationbox = true } //关闭出现的组织机构div - closediv(){ + closediv() { this.isorganizationbox = false } //查询 - onSubmit (e) { + onSubmit(e) { this.getAllPlanInfo() } - companyName:any //单位名称 - js:any //所选组织机构 - jsId:any //所选组织机构的id + companyName: any //单位名称 + js: any //所选组织机构 + jsId: any //所选组织机构的id // jscheck:boolean //所选组织机构勾选框 - unittype:any //单位类型 - reservePlanType:any //预案类型 - preparelevel:any //编制级别 - plcheck:boolean //编制级别勾选框 + unittype: any //单位类型 + reservePlanType: any //预案类型 + preparelevel: any //编制级别 + plcheck: boolean //编制级别勾选框 //重置 - reset(){ + reset() { this.companyName = '' // this.js = '' // this.jsId = '' @@ -307,7 +293,7 @@ export class OpenPlanComponent implements OnInit { this.pageEvent.pageIndex = 0 this.PageNumber = 1 this.getAllPlanInfo(); - + } } @@ -316,14 +302,58 @@ export class OpenPlanComponent implements OnInit { templateUrl: './PsvShow.html', styleUrls: ['./open-plan.component.scss'] }) -export class GkhtmlPsViewer{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} +export class GkhtmlPsViewer { + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } ngOnInit(): void { // console.log(this.data) const viewer = new Viewer({ container: document.querySelector('#viewer'), - panorama:'/api/Objects/PlanPlatform/'+ this.data, - + panorama: '/api/Objects/PlanPlatform/' + this.data, + }); } } + + +//普通图片弹窗 +@Component({ + selector: 'imgdetails', + templateUrl: './previewImg.html', + styleUrls: ['./open-plan.component.scss'] +}) +export class OpenImgDetails { + constructor(private http: HttpClient, public dialog: MatDialog, public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data) { } + testSwiper: Swiper; + + ngOnInit(): void { + this.allImages = [] + this.data.forEach(element => { + element = `/api/Objects/PlanPlatform/${element}?x-oss-process=image/auto-orient,1` + this.allImages.push(element) + }); + } + + 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 } + } +} \ No newline at end of file diff --git a/src/app/plan-management/open-plan/previewImg.html b/src/app/plan-management/open-plan/previewImg.html new file mode 100644 index 0000000..2eb4a8a --- /dev/null +++ b/src/app/plan-management/open-plan/previewImg.html @@ -0,0 +1,29 @@ + + +
+ +
+
+
+ +
+
+
+ + +
+
+
+ +
+ +
+
diff --git a/src/app/plan-management/pass-plan/pass-plan.component.scss b/src/app/plan-management/pass-plan/pass-plan.component.scss index 6b834aa..9b85e67 100644 --- a/src/app/plan-management/pass-plan/pass-plan.component.scss +++ b/src/app/plan-management/pass-plan/pass-plan.component.scss @@ -1,233 +1,327 @@ .header { - width: 100%; - padding: 12px 10px; + width: 100%; + padding: 12px 10px; + box-sizing: border-box; + + .queryBox { box-sizing: border-box; - .queryBox { - box-sizing: border-box; - padding: 5px 0 0 5px; - // margin-left: 50px; - display: flex; - flex-direction: row; - flex-wrap: wrap; - align-items:center; - // justify-content:center; + padding: 5px 0 0 5px; + // margin-left: 50px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items: center; + + // justify-content:center; .queryField { + //margin: 0 10px; input { width: 180px; height: 22px; line-height: 22px; border-radius: 3px; - } - @media screen and (min-device-width:1400px){ - margin: 3px 20px; - } - @media screen and (max-device-width:1400px)and (min-device-width:1200px){ - margin: 3px 10px; - mat-form-field{ - width: 180px; - } + } + + @media screen and (min-device-width:1400px) { + margin: 3px 20px; + } + + @media screen and (max-device-width:1400px)and (min-device-width:1200px) { + margin: 3px 10px; + + mat-form-field { + width: 180px; } - @media screen and (max-device-width:1200px){ - margin: 3px 0 3px 10px; - mat-form-field{ - width: 120px; - } + } + + @media screen and (max-device-width:1200px) { + margin: 3px 0 3px 10px; + + mat-form-field { + width: 120px; } - - } - + } - } //queryBox - .butclass{ - button{ - width: 80px;height: 36px; - font-size: 16px; } -} - .ordiv{ - position: relative; - .organizationbox{ - width:450px; - height: 200px; - background: white; - position: absolute; - top: 48px; - left: 77px; - z-index: 999; - border: 1px solid grey; - overflow-y: auto; - li{ - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - mat-tree-node{ - cursor: pointer; - white-space:pre; - } - mat-tree-node:hover{ - background: rgba(225, 225, 225, 0.8); - } - .closediv{ - z-index: 100; - position: absolute; - right: 0; - top: 0; - width: 30px; - height: 30px; - cursor: pointer; - line-height: 30px; - text-align: center; - } - .closediv:hover{ - background:rgba(225, 225, 225, 0.8); - } - } - + + + } + + //queryBox + .butclass { + button { + width: 80px; + height: 36px; + font-size: 16px; } } - .body{ - .buttonbox{ - padding-left: 50px; - button{ - margin:0 10px - } + + .ordiv { + position: relative; + + .organizationbox { + width: 450px; + height: 200px; + background: white; + position: absolute; + top: 48px; + left: 77px; + z-index: 999; + border: 1px solid grey; + overflow-y: auto; + + li { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } - .tablebox{ - table{ - width: 100%; - // margin-left: 2%; - margin-top: 15px; - } - mat-paginator{ - width:100%; - // margin-left: 2%; - // margin-top: 30px; - } + + mat-tree-node { + cursor: pointer; + white-space: pre; + } + + mat-tree-node:hover { + background: rgba(225, 225, 225, 0.8); } + + .closediv { + z-index: 100; + position: absolute; + right: 0; + top: 0; + width: 30px; + height: 30px; + cursor: pointer; + line-height: 30px; + text-align: center; + } + + .closediv:hover { + background: rgba(225, 225, 225, 0.8); + } + } + } - .mat-header-cell{ - text-align: center; } -.mat-cell{ - text-align: center; - + +.body { + .buttonbox { + padding-left: 50px; + + button { + margin: 0 10px + } + } + + .tablebox { + table { + width: 100%; + // margin-left: 2%; + margin-top: 15px; + } + + mat-paginator { + width: 100%; + // margin-left: 2%; + // margin-top: 30px; + } + } +} + +.mat-header-cell { + text-align: center; +} + +.mat-cell { + text-align: center; + } //完整度 -.integrityDiv{ - width: 180px; - height: 30px; - background-color: #e2e7ee; - // background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32); - margin: 0 auto; - position: relative; - .integrityNum{ - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - color: black; +.integrityDiv { + width: 180px; + height: 30px; + background-color: #e2e7ee; + // background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32); + margin: 0 auto; + position: relative; + + .integrityNum { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + color: black; + font-weight: 800; + font-size: 15px; + cursor: default; + } + + .integrityColorDiv { + height: 100%; + } + + .integrityDetails { + position: absolute; + display: none; + width: 350px; + height: 280px; + border: 1px solid rgba(0, 0, 0, 0.22); + background-color: white; + + .integrityDetailsTop { + width: 100%; + height: 23px; + line-height: 23px; + border-bottom: 1px solid rgba(0, 0, 0, 0.22); + margin-bottom: 1px; + font-size: 14px; + + span { + display: inline-block; + text-align: center; font-weight: 800; - font-size: 15px; - cursor: default; - } - .integrityColorDiv{ - height: 100%; + } + + .span1 { + width: 25%; + } + + .span2 { + width: 60%; + } + + .span3 { + width: 15%; + } } - .integrityDetails{ - position: absolute; - display: none; - width: 350px; - height:280px; - border: 1px solid rgba(0, 0, 0, 0.22); - background-color: white; - .integrityDetailsTop{ - width: 100%; - height: 23px; - line-height:23px; - border-bottom: 1px solid rgba(0, 0, 0, 0.22); - margin-bottom: 1px; - font-size: 14px; - span{ - display: inline-block; - text-align: center; - font-weight: 800; - } - .span1{ - width: 25%; - } - .span2{ - width: 60%; - } - .span3{ - width: 15%; + + .integrityDetailsBody { + ul { + li { + width: 100%; + height: 23px; + line-height: 23px; + margin: 3px 0; + + div { + float: left; + font-size: 13px; + } + + .name { + width: 25%; + height: 100%; + } + + .colorDiv { + width: 60%; + height: 100%; + position: relative; + + .colorDivBac { + width: 90%; + height: 100%; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + background-color: #dfe5ec; + border-radius: 5px; + + .colorDivCon { + border-radius: 5px; + height: 100%; + background-color: #2398f1; + } } - } - .integrityDetailsBody{ - ul{ - li{ - width: 100%; - height: 23px; - line-height: 23px; - margin: 3px 0; - div{ - float: left; - font-size: 13px; - } - .name{ - width: 25%; - height: 100%; - } - .colorDiv{ - width: 60%; - height: 100%; - position: relative; - .colorDivBac{ - width: 90%; - height: 100%; - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%,-50%); - background-color: #dfe5ec; - border-radius: 5px; - .colorDivCon{ - border-radius: 5px; - height: 100%; - background-color: #2398f1; - } - } - span{ - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%,-50%); - // color: white; - font-weight: 600; - } - } - .number{ - width: 15%; - height: 100%; - } - } + + span { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + // color: white; + font-weight: 600; } - + } + + .number { + width: 15%; + height: 100%; + } } + } + } - .bottomposition{ - top: 2px; - left: 188px; + } + + .bottomposition { + top: 2px; + left: 188px; + } + + .topposition { + top: -252px; + left: 188px; + } +} + +.integrityDiv:hover { + .integrityDetails { + display: block; + } +} + + +@media screen and (max-width:1200px) { + .bigimgbox { + width: 880px; + height: 580px; + + //预览图片 + .previewImgBox { + width: 800px; + height: 475px; + text-align: center; } - .topposition{ - top: -252px; - left: 188px; + } +} + +@media screen and (min-width:1200px) and (max-width:1400px) { + .bigimgbox { + width: 880px; + height: 610px; + + //预览图片 + .previewImgBox { + width: 800px; + height: 500px; + text-align: center; } + } + } -.integrityDiv:hover{ - .integrityDetails{ - display: block; + +@media screen and (min-width:1400px) { + .bigimgbox { + width: 1110px; + height: 860px; + + //预览图片 + .previewImgBox { + width: 900px; + height: 100%; + text-align: center; + } + + .previewImgBottom { + text-align: center; + height: 30px; + margin: 20px auto; } -} \ No newline at end of file + } + +} diff --git a/src/app/plan-management/pass-plan/pass-plan.component.spec.ts b/src/app/plan-management/pass-plan/pass-plan.component.spec.ts deleted file mode 100644 index 7ee8878..0000000 --- a/src/app/plan-management/pass-plan/pass-plan.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PassPlanComponent } from './pass-plan.component'; - -describe('PassPlanComponent', () => { - let component: PassPlanComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ PassPlanComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PassPlanComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/plan-management/pass-plan/pass-plan.component.ts b/src/app/plan-management/pass-plan/pass-plan.component.ts index 86e1bd5..76a13d5 100644 --- a/src/app/plan-management/pass-plan/pass-plan.component.ts +++ b/src/app/plan-management/pass-plan/pass-plan.component.ts @@ -4,13 +4,14 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree' import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; import { FormControl } from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' import { PageEvent } from '@angular/material/paginator'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { TreeService } from '../../http-interceptors/tree.service' import { Viewer } from 'photo-sphere-viewer'; declare var CryptoJS +import Swiper from 'swiper'; @Component({ selector: 'app-pass-plan', templateUrl: './pass-plan.component.html', @@ -18,8 +19,8 @@ declare var CryptoJS }) export class PassPlanComponent implements OnInit { - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } - + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } + private _transformer = (node, level: number) => { //初始化tree return { expandable: !!node.children && node.children.length > 0, @@ -35,239 +36,239 @@ export class PassPlanComponent implements OnInit { dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); myControl = new FormControl(); hasChild = (_: number, node: any) => node.expandable; - //分页 - @ViewChild(MatPaginator, {static: true}) + //分页 + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any; //第几页 + PageNumber: any; //第几页 - displayedColumns: string[] = ['planname', 'addpeople','level','addtime','plantype','auditStatus','openRange','projectlevel','operation']; - allorganizations:any //所有组织机构 - allunittype:any //所有单位类型 - tabledataSource:any //表格数据 + displayedColumns: string[] = ['planname', 'addpeople', 'level', 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation']; + allorganizations: any //所有组织机构 + allunittype: any //所有单位类型 + tabledataSource: any //表格数据 url - preparelevels:any + preparelevels: any ngOnInit(): void { - if(window.matchMedia("(max-width: 1400px)").matches){ - this.pcMore=false - this.padMore=true - this.pcfind=false - this.padjt=true - }else{ - this.pcfind=true - this.pcMore=true - this.padMore=false - this.padjt=false + if (window.matchMedia("(max-width: 1400px)").matches) { + this.pcMore = false + this.padMore = true + this.pcfind = false + this.padjt = true + } else { + this.pcfind = true + this.pcMore = true + this.padMore = false + this.padjt = false } this.getunitdata(); this.getOrganizations(); this.getUnittype(); this.getAllPlanInfo(); let level = sessionStorage.getItem("level"); - if(level == "0"){//如果是总队 + if (level == "0") {//如果是总队 this.preparelevels = [ - {name:"总队",value:"1"}, - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "总队", value: "1" }, + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "1"){//如果是支队 + if (level == "1") {//如果是支队 this.preparelevels = [ - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "2"){//如果是大队 + if (level == "2") {//如果是大队 this.preparelevels = [ - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "3"){//如果是中队 + if (level == "3") {//如果是中队 this.preparelevels = [ - {name:"中队",value:"8"} + { name: "中队", value: "8" } ] } - this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) + this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length) //console.log(this.url) } pcMore//pc更多 - pcput=false//pc收起 + pcput = false//pc收起 pcfind//pc查询 - padjt=false - padMore=true//pad收缩控制 - padput=false//pad收起按钮 - imgsrcopen="../../../assets/images/routdown2.png" - imgsrcdown="../../../assets/images/routup2.png" - pcInfo(){ - this.pcMore=!this.pcMore - this.pcput=!this.pcput + padjt = false + padMore = true//pad收缩控制 + padput = false//pad收起按钮 + imgsrcopen = "../../../assets/images/routdown2.png" + imgsrcdown = "../../../assets/images/routup2.png" + pcInfo() { + this.pcMore = !this.pcMore + this.pcput = !this.pcput } - padInfo(){ - this.padMore=!this.padMore - this.padput=!this.padput + padInfo() { + this.padMore = !this.padMore + this.padput = !this.padput } - allPlanInfo:any //存储所有预案信息 + allPlanInfo: any //存储所有预案信息 //获得所有预案信息 - getAllPlanInfo(){ + getAllPlanInfo() { let reservePlanType this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = '' - if(this.reservePlanType && this.reservePlanType.length != 0){ + if (this.reservePlanType && this.reservePlanType.length != 0) { reservePlanType = eval(this.reservePlanType.join("|")) - } - let paramsdata:any = { + } + let paramsdata: any = { CompanyName: this.companyName || '', OrganizationId: this.jsId || '', - HasChildrenOrganization:this.jscheck || '', - BuildingTypeId: this.unittype || '', + HasChildrenOrganization: this.jscheck || '', + BuildingTypeId: this.unittype || '', PlanType: this.reservePlanType || '', - AuditStatus:'', //审核状态 - PlanLevel: this.preparelevel || '', + AuditStatus: '', //审核状态 + PlanLevel: this.preparelevel || '', HasChildrenPlanLevel: this.plcheck || '', - CreationTimeRangeStart:this.addtime||'', - CreationTimeRangeEnd:this.endtime||'', + CreationTimeRangeStart: this.addtime || '', + CreationTimeRangeEnd: this.endtime || '', PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], + PageSize: this.pageSizeOptions[0], Sort: '', - PlanCategories:this.planCategory + PlanCategories: this.planCategory } - this.http.get("/api/ApprovedPlans",{params:paramsdata}).subscribe((data:any)=>{ + this.http.get("/api/ApprovedPlans", { params: paramsdata }).subscribe((data: any) => { this.length = data.totalCount this.allPlanInfo = data - this.tabledataSource = data.items + this.tabledataSource = data.items }) } - colorRgb(sColor){ + colorRgb(sColor) { var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var sColor = sColor.toLowerCase(); if (sColor && reg.test(sColor)) { - if (sColor.length === 4) { - var sColorNew = "#"; - for (var i = 1; i < 4; i += 1) { - sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); - } - sColor = sColorNew; - } - //处理六位的颜色值 - var sColorChange = []; - for (var i = 1; i < 7; i += 2) { - sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); + if (sColor.length === 4) { + var sColorNew = "#"; + for (var i = 1; i < 4; i += 1) { + sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); } - return sColorChange; + sColor = sColorNew; + } + //处理六位的颜色值 + var sColorChange = []; + for (var i = 1; i < 7; i += 2) { + sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); + } + return sColorChange; } else { - return sColor; + return sColor; } } - colorHex(rgb){ + colorHex(rgb) { var _this = rgb; var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; if (/^(rgb|RGB)/.test(_this)) { - var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); - var strHex = "#"; - for (var i = 0; i < aColor.length; i++) { - var hex:any = Number(aColor[i]).toString(16); - hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位 - if (hex === "0") { - hex += hex; - } - strHex += hex; - } - if (strHex.length !== 7) { - strHex = _this; + var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); + var strHex = "#"; + for (var i = 0; i < aColor.length; i++) { + var hex: any = Number(aColor[i]).toString(16); + hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位 + if (hex === "0") { + hex += hex; } - return strHex; + strHex += hex; + } + if (strHex.length !== 7) { + strHex = _this; + } + return strHex; } else if (reg.test(_this)) { - var aNum = _this.replace(/#/, "").split(""); - if (aNum.length === 6) { - return _this; - } else if (aNum.length === 3) { - var numHex = "#"; - for (var i = 0; i < aNum.length; i += 1) { - numHex += (aNum[i] + aNum[i]); - } - return numHex; + var aNum = _this.replace(/#/, "").split(""); + if (aNum.length === 6) { + return _this; + } else if (aNum.length === 3) { + var numHex = "#"; + for (var i = 0; i < aNum.length; i += 1) { + numHex += (aNum[i] + aNum[i]); } + return numHex; + } } else { - return _this; + return _this; } } gradientColor(startColor, endColor, step) { let _this = this - let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式 - let startR = startRGB[0]; - let startG = startRGB[1]; - let startB = startRGB[2]; + let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式 + let startR = startRGB[0]; + let startG = startRGB[1]; + let startB = startRGB[2]; - let endRGB = _this.colorRgb(endColor); - let endR = endRGB[0]; - let endG = endRGB[1]; - let endB = endRGB[2]; + let endRGB = _this.colorRgb(endColor); + let endR = endRGB[0]; + let endG = endRGB[1]; + let endB = endRGB[2]; - let sR = (endR - startR) / step;//总差值 - let sG = (endG - startG) / step; - let sB = (endB - startB) / step; + let sR = (endR - startR) / step;//总差值 + let sG = (endG - startG) / step; + let sB = (endB - startB) / step; var colorArr = []; for (var i = 0; i < step; i++) { - //计算每一步的hex值 - var hex = _this.colorHex('rgb('+ parseInt((sR * i + startR))+ ',' + parseInt((sG * i + startG))+ ',' + parseInt((sB * i + startB)) + ')'); - colorArr.push(hex); + //计算每一步的hex值 + var hex = _this.colorHex('rgb(' + parseInt((sR * i + startR)) + ',' + parseInt((sG * i + startG)) + ',' + parseInt((sB * i + startB)) + ')'); + colorArr.push(hex); } return colorArr; -} - integrity(width){ + } + integrity(width) { let _this = this - - let style:any = {} - style.width = width +'%'; - if(width < 30){ - let colorArr = this.gradientColor('#D50000', '#E53935', 30); - for(let i = 0; i < 30; i++){ - if( i == width){ + + let style: any = {} + style.width = width + '%'; + if (width < 30) { + let colorArr = this.gradientColor('#D50000', '#E53935', 30); + for (let i = 0; i < 30; i++) { + if (i == width) { style.background = colorArr[i] } } } - if(width >= 30 && width < 60){ - let colorArr = this.gradientColor('#FF9800', '#E65100', 30); - for(let i = 30; i < 60; i++){ - if( i == width){ - style.background = colorArr[i-30] + if (width >= 30 && width < 60) { + let colorArr = this.gradientColor('#FF9800', '#E65100', 30); + for (let i = 30; i < 60; i++) { + if (i == width) { + style.background = colorArr[i - 30] } } } - if(width >= 60){ - let colorArr = this.gradientColor('#81C784', '#2E7D32', 41); - for(let i = 60; i <= 100; i++){ - if( i == width){ - style.background = colorArr[i-60] + if (width >= 60) { + let colorArr = this.gradientColor('#81C784', '#2E7D32', 41); + for (let i = 60; i <= 100; i++) { + if (i == width) { + style.background = colorArr[i - 60] } } } return style } - integrityDetails(width,zong){ - let style:any = {} - style.width = (width/zong)*100 +'%'; + integrityDetails(width, zong) { + let style: any = {} + style.width = (width / zong) * 100 + '%'; return style } //得到当前单位信息 - getunitdata(){ + getunitdata() { this.http.get("/api/Account/Profiles").subscribe( - (data:any)=>{ - this.organizationName = data.organizationName + (data: any) => { + this.organizationName = data.organizationName } ) } @@ -275,41 +276,41 @@ export class PassPlanComponent implements OnInit { endtime//结束时间 integrityScoreMin//完整度最小值 integrityScoreMax//完整度最大值 - organizationName:any //当前单位组织机构名称 - treedata:any //组织机构树型数据 - newArr:any = [] - newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 + organizationName: any //当前单位组织机构名称 + treedata: any //组织机构树型数据 + newArr: any = [] + newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段 //得到当前单位所在组织机构的tree型数据 - getpresentOrganization(){ + getpresentOrganization() { this.newallorganizations = this.allorganizations this.newallorganizations.forEach(item => { item.children = [] this.newallorganizations.forEach(element => { - if(element.parentId == item.id){ + if (element.parentId == item.id) { item.children.push(element) } }); }); this.http.get("/api/Account/Profiles").subscribe( - (data:any)=>{ + (data: any) => { this.organizationName = data.organizationName - if(this.organizationName){ + if (this.organizationName) { this.newallorganizations.forEach(item => { - if(item.name == this.organizationName){ + if (item.name == this.organizationName) { this.dataSource.data = [item] } }); - }else{ + } else { this.dataSource.data = this.tree.toTree(this.treedata); } } ) - + } //获得所有组织机构 - getOrganizations(){ + getOrganizations() { this.http.get('/api/Organizations').subscribe( - (data:any)=>{ + (data: any) => { this.allorganizations = data this.treedata = this.tree.toTree(data); this.getpresentOrganization(); @@ -318,120 +319,103 @@ export class PassPlanComponent implements OnInit { } //获得所有单位类型 - getUnittype(){ + getUnittype() { this.http.get('/api/BuildingTypes/Simple').subscribe( - data=>{ + data => { this.allunittype = data } ) } //查看单位信息 - lookUnitInfo(element){ - // console.log(element) - // const dialogRef = this.dialog.open(UnitInfo, { - // width: '1500px', - // height:'800px' - // }); - sessionStorage.setItem("editable","0") - sessionStorage.setItem("companyName",element.company.name) - sessionStorage.setItem("companyId",element.company.id) - sessionStorage.setItem(element.company.id,JSON.stringify(element.company.companyIntegrityScore)) - window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`,'_blank'); + lookUnitInfo(element) { + sessionStorage.setItem("editable", "0") + sessionStorage.setItem("companyName", element.company.name) + sessionStorage.setItem("companyId", element.company.id) + sessionStorage.setItem(element.company.id, JSON.stringify(element.company.companyIntegrityScore)) + window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`, '_blank'); } //跳转查看预案页面 审核通过预案 - routerTo(e){ - // console.log(e) - if(e.planMode == 0||e.planMode == 1){ - //console.log(e.attachmentUrls) - var index=e.attachmentUrls[0].indexOf("\/") - if(e.attachmentUrls[0].substr(0,index)=='psw'){ + routerTo(e) { + console.log(e) + if (e.planMode == 0 || e.planMode == 1) { + var index = e.attachmentUrls[0].indexOf("\/") + if (e.attachmentUrls[0].substr(0, index) == 'psw') { const dialogRef = this.dialog.open(GkPsViewer, { width: '1500px', - height:'800px', + height: '800px', data: e.attachmentUrls[0] }); - } - 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') */{ - let filename:string - let fetchUrl = e.attachmentUrls[0] - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ - filename=data.fileName - let json={ - doc: { - docId: docId, - title: filename, - fetchUrl: `http://39.106.78.171:8000/api/Objects/PlanPlatform/`+fetchUrl, - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: [ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - 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}`) - }) + } 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(PassImgDetails, {//调用open方法打开对话框并且携带参数过去 + data: data.attachmentUrls, + }); + 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",e.companyId) + } + + if (e.planMode == 2) { //如果是在线编辑 + let id = e.id + sessionStorage.setItem("planId", id) + sessionStorage.setItem("companyId", e.companyId) //sessionStorage.setItem("buildingTypeId",this.unittypeId) - sessionStorage.setItem("editable","0") - sessionStorage.setItem("planName",e.name) + sessionStorage.setItem("editable", "0") + sessionStorage.setItem("planName", e.name) let companyId = sessionStorage.getItem("companyId") window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); } - if(e.planMode == 3){ //如果是跳转网页 - sessionStorage.setItem("url",e.url) + if (e.planMode == 3) { //如果是跳转网页 + sessionStorage.setItem("url", e.url) window.open(`/planManagement/webLook`) } } //预案公开 - openReserve (e) { - this.http.put(`/api/PlanAudits/${e.id}/Public`,[]).subscribe(data=>{ + openReserve(e) { + this.http.put(`/api/PlanAudits/${e.id}/Public`, []).subscribe(data => { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('预案已公开','确定',config); + this.snackBar.open('预案已公开', '确定', config); }) } //预案取消公开 - closeReserve (e) { - this.http.put(`/api/PlanAudits/${e.id}/Unpublic`,[]).subscribe(data=>{ + closeReserve(e) { + this.http.put(`/api/PlanAudits/${e.id}/Unpublic`, []).subscribe(data => { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('预案已取消公开','确定',config); + this.snackBar.open('预案已取消公开', '确定', config); }) } - + //分页事件 - chagePage(e){ - this.PageNumber = e.pageIndex+1 + chagePage(e) { + this.PageNumber = e.pageIndex + 1 this.getAllPlanInfo(); } //辖区中队div是否显示 - isorganizationbox:boolean = false + isorganizationbox: boolean = false //点击辖区中队树,将选择的辖区中队添加到变量 add(node) { this.isorganizationbox = false @@ -447,26 +431,26 @@ export class PassPlanComponent implements OnInit { this.isorganizationbox = true } //关闭出现的组织机构div - closediv(){ + closediv() { this.isorganizationbox = false } //查询 - onSubmit (e) { + onSubmit(e) { this.PageNumber = 1 this.pageEvent.pageIndex = 0 this.getAllPlanInfo(); } - companyName:any //单位名称 - js:any //所选组织机构 - jsId:any //所选组织机构的id - jscheck:boolean //所选组织机构勾选框 - unittype:any //单位类型 - reservePlanType:any //预案类型 - preparelevel:any //编制级别 - plcheck:boolean //编制级别勾选框 - planCategory=[]//预案级别 + companyName: any //单位名称 + js: any //所选组织机构 + jsId: any //所选组织机构的id + jscheck: boolean //所选组织机构勾选框 + unittype: any //单位类型 + reservePlanType: any //预案类型 + preparelevel: any //编制级别 + plcheck: boolean //编制级别勾选框 + planCategory = []//预案级别 //重置 - reset(){ + reset() { this.companyName = '' this.js = '' this.jsId = '' @@ -474,13 +458,13 @@ export class PassPlanComponent implements OnInit { this.unittype = '' this.reservePlanType = '' this.preparelevel = '' - this.addtime='' - this.endtime='' + this.addtime = '' + this.endtime = '' this.plcheck = false //重新获取初始化列表 this.pageEvent.pageIndex = 0 this.PageNumber = 1 - this.planCategory=[] + this.planCategory = [] this.getAllPlanInfo(); } } @@ -490,14 +474,14 @@ export class PassPlanComponent implements OnInit { templateUrl: './PsvShow.html', styleUrls: ['./pass-plan.component.scss'] }) -export class GkPsViewer{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} +export class GkPsViewer { + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } ngOnInit(): void { // console.log(this.data) const viewer = new Viewer({ container: document.querySelector('#viewer'), - panorama:'/api/Objects/PlanPlatform/'+ this.data, - + panorama: '/api/Objects/PlanPlatform/' + this.data, + }); } } @@ -508,9 +492,53 @@ export class GkPsViewer{ templateUrl: './unitInfo.html', styleUrls: ['./pass-plan.component.scss'] }) -export class UnitInfo{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} +export class UnitInfo { + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } ngOnInit(): void { // console.log(this.data) } +} + + +//普通图片弹窗 +@Component({ + selector: 'imgdetails', + templateUrl: './previewImg.html', + styleUrls: ['./pass-plan.component.scss'] +}) +export class PassImgDetails { + constructor(private http: HttpClient, public dialog: MatDialog, public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data) { } + testSwiper: Swiper; + + ngOnInit(): void { + this.allImages = [] + this.data.forEach(element => { + element = `/api/Objects/PlanPlatform/${element}?x-oss-process=image/auto-orient,1` + this.allImages.push(element) + }); + } + + 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 } + } } \ No newline at end of file diff --git a/src/app/plan-management/pass-plan/previewImg.html b/src/app/plan-management/pass-plan/previewImg.html new file mode 100644 index 0000000..2eb4a8a --- /dev/null +++ b/src/app/plan-management/pass-plan/previewImg.html @@ -0,0 +1,29 @@ + + +
+ +
+
+
+ +
+
+
+ + +
+
+
+ +
+ +
+
diff --git a/src/app/plan-management/plan-management.module.ts b/src/app/plan-management/plan-management.module.ts index 9022c43..99ba19b 100644 --- a/src/app/plan-management/plan-management.module.ts +++ b/src/app/plan-management/plan-management.module.ts @@ -45,8 +45,8 @@ import { MatTooltipModule } from '@angular/material/tooltip'; import { MatTreeModule } from '@angular/material/tree'; import { EntryPlanComponent } from './entry-plan/entry-plan.component'; -import { PassPlanComponent, UnitInfo } from './pass-plan/pass-plan.component'; -import { OpenPlanComponent } from './open-plan/open-plan.component'; +import { PassPlanComponent, UnitInfo, PassImgDetails } from './pass-plan/pass-plan.component'; +import { OpenPlanComponent,OpenImgDetails } from './open-plan/open-plan.component'; import { EntryPlanLookComponent, AddPlanone, DownloadFile, AuditResult, ChangeName, ImgDetails } from './entry-plan-look/entry-plan-look.component'; import { PlanType, AuditSatus, PlanLevel, state } from '../pipes/boolean.pipe'; import { WebLookComponent } from './web-look/web-look.component'; @@ -70,7 +70,7 @@ import { ReinforcePlanComponent } from './reinforce-plan/reinforce-plan.componen @NgModule({ declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName, WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult, - typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails], + typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails,PassImgDetails,OpenImgDetails], imports: [ CommonModule, PlanManagementRoutingModule,