diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts index f5c654c..5db1d7e 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts @@ -460,7 +460,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { //console.log(this.buildingsData) if (this.planTemplateData[index].building == undefined) { this.planTemplateData[index].building = [] - if (this.planTemplateData[index].attribute[1].attinf != undefined) { + /* if (this.planTemplateData[index].attribute[1].attinf != undefined) { this.planTemplateData[index].attribute[1].attinf.forEach(pData => { this.buildingsData.forEach((bDara, bi, bArr) => { if (bDara.buildingBasicGroups.length > 0) { @@ -470,7 +470,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { } }) }); - } + } */ for (var i = 0; i < this.buildDataName.length; i++) { if (i == 0) { @@ -567,20 +567,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit { groupName: "单位概况" } getTemplateData() { - console.log(this.planTemplateData) - this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => { - console.log('预案内容', data) - /* if(this.route.snapshot.queryParams.haveNew==true){ - this.planTemplateData=[] - this.planTemplateData.push(this.danweInfo) - } */ - /* this.planTemplateData = JSON.parse(data.webTextData).filter(item => - item.completed == true - ) */ - this.planTemplateData=JSON.parse(data.webTextData) - console.log(this.planTemplateData) - if (this.planTemplateData[0].groupName != '封面') { + if(this.route.snapshot.queryParams.haveNew!=undefined){ + this.planTemplateData=[] let obj = { completed: true, groupName: "封面", @@ -606,59 +595,99 @@ export class CreatePlanOnlineFiveComponent implements OnInit { } } this.planTemplateData.unshift(obj) - } - else if (this.planTemplateData[0].groupName == '封面') { - this.planTemplateData[0].attribute.objName = this.unitData.name - } - this.planTemplateData.forEach(element => { - if (element.groupName == '重点图示') { - if (!element.attribute) { - element.attribute = [{ name: '', imgArr: [] }] + + this.planTemplateData.push(this.danweInfo) + this.planTemplateData.push({completed: true,groupName: '新建'}) + console.log(this.planTemplateData) + }else{ + this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => { + console.log('预案内容', data) + + this.planTemplateData = JSON.parse(data.webTextData).filter(item => + item.completed == true + ) + //this.planTemplateData=JSON.parse(data.webTextData) + console.log(this.planTemplateData) + if (this.planTemplateData[0].groupName != '封面') { + let obj = { + completed: true, + groupName: "封面", + attribute: { + planNumber: '', + planName: this.route.snapshot.queryParams.planName, + objName: this.unitData.name, + unitNature: this.unitData.buildingTypes[0].name, + planLevel: '', + disasterType: '火灾', + fireproofingLevel: '', + fireproofingAdminister: this.unitData.organizationName, + putOutFireAdminister: '', + producer: { + name: '', + duty: '' + }, + verifier: { + name: '', + duty: '' + }, + auditTime: '' + } } + this.planTemplateData.unshift(obj) } - if (element.groupName == '交通水源') { - if (!element.attribute) { - element.attribute = [{ name: '', imgArr: [] }] - } + else if (this.planTemplateData[0].groupName == '封面') { + this.planTemplateData[0].attribute.objName = this.unitData.name } - if (element.groupName == '预案附件') { - if (!element.attribute) { - element.attribute = [{ name: '', imgArr: [] }] + this.planTemplateData.forEach(element => { + if (element.groupName == '重点图示') { + if (!element.attribute) { + element.attribute = [{ name: '', imgArr: [] }] + } } - } - if (element.groupName == '处置要点') { - if (!element.attribute) { - element.attribute = [{ name: '', content: '' }] + if (element.groupName == '交通水源') { + if (!element.attribute) { + element.attribute = [{ name: '', imgArr: [] }] + } } - } - if (element.groupName == '特别警示') { - if (!element.attribute) { - element.attribute = [{ name: '特别警示', content: '' }] + if (element.groupName == '预案附件') { + if (!element.attribute) { + element.attribute = [{ name: '', imgArr: [] }] + } } - } - if(element.groupName=='单位概况'){ - this.clickTitleItem(this.planTemplateData[1]) - } - }); - if(this.planLevel=='4'||this.route.snapshot.queryParams.haveNew){ - this.planTemplateData.push({completed: true,groupName: '新建'}) - } - this.planTemplateData.forEach(element => { - if(element.attribute!=undefined){ - /* element.attribute.forEach((item,index,value) => { - if(value[index].level!=undefined&&value[index].level==1){ - value[index].lieNumber=value[index].tableth.length + if (element.groupName == '处置要点') { + if (!element.attribute) { + element.attribute = [{ name: '', content: '' }] } - }); */ - for(let i=0;i { + if(element.attribute!=undefined){ + /* element.attribute.forEach((item,index,value) => { + if(value[index].level!=undefined&&value[index].level==1){ + value[index].lieNumber=value[index].tableth.length + } + }); */ + for(let i=0;i +
+ 更改三维预案路径 +
+
+ + + + +
+
+ + +
+ 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 a55fbea..aad55ac 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 @@ -90,7 +90,7 @@ 查看 下载 - 删除 + 删除 审批结果 提交审核 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 ff97798..c2f9a45 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 @@ -258,7 +258,7 @@ export class EntryPlanLookComponent implements OnInit { } else if (e.planType == 2) { //三维预案 - if (e.url.indexOf('app') == 0) { + /* if (e.url.indexOf('app') == 0) { window.location.href = e.url } else { sessionStorage.setItem("url", e.url) @@ -267,7 +267,21 @@ export class EntryPlanLookComponent implements OnInit { } else { window.open(`/planManagement/webLook`) } - } + } */ + const dialogRef = this.dialog.open(ChangeUrl, { + data: { element: e } + }); + dialogRef.afterClosed().subscribe( + data => { + if (data) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('修改成功!', '确定', config); + this.getAllPlanComponents() + } + } + ); } else { this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); @@ -1426,4 +1440,37 @@ export class ImgDetails { this.rotationAngle = this.rotationAngle + 90 if (this.rotationAngle === 360) { this.rotationAngle = 0 } } +} + +//修改三维预案地址 +@Component({ + selector: 'changename', + templateUrl: './changeurl.html', + styleUrls: ['./entry-plan-look.component.scss'] +}) +export class ChangeUrl{ + constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } + planUrl: any//预案路径 + ngOnInit(): void { + this.planUrl = this.data.element.url + } + onNoClick(): void { + this.dialogRef.close(); + } + onSubmit(value) { + let headers = new HttpHeaders({ + 'Content-Type': 'text/json' + }); + let options = { + headers + }; + let body = { + url: value.url, + auditStatus:8 + } + this.http.put(`/api/PlanComponents/${this.data.element.id}`, body, options).subscribe(data => { + this.dialogRef.close("success"); + }) + + } } \ No newline at end of file diff --git a/src/app/plan-management/plan-management.module.ts b/src/app/plan-management/plan-management.module.ts index 969afe1..12a9909 100644 --- a/src/app/plan-management/plan-management.module.ts +++ b/src/app/plan-management/plan-management.module.ts @@ -73,12 +73,13 @@ import { yinYong } from './create-plan-online-five/create-plan-online-five.compo import { newTitle } from './create-plan-online-five/create-plan-online-five.component' import { disaster } from './create-plan-online-five/create-plan-online-five.component' import { updataHl } from './create-plan-online-five/create-plan-online-five.component' +import {ChangeUrl} from './entry-plan-look/entry-plan-look.component' @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, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent, - OpenPlanToolDialog,yinYong,newTitle,disaster,updataHl], + OpenPlanToolDialog,yinYong,newTitle,disaster,updataHl,ChangeUrl], imports: [ CommonModule, PlanManagementRoutingModule,