From d05e550dec722c6129a144b959bf1863b4a73d26 Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Sat, 27 Nov 2021 10:53:03 +0800 Subject: [PATCH 01/12] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E9=A2=84=E6=A1=88?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=96=B0=E5=BB=BA=E8=B7=9F=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-plan-online-five.component.html | 9 +- .../create-plan-online-five.component.ts | 2 +- .../plan-template.component.scss | 1 + .../plan-template/plan-template.component.ts | 119 +++++++++++++----- src/app/ui/plan-template/zdyaddgroup.html | 2 +- 5 files changed, 98 insertions(+), 35 deletions(-) diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html index d34426d..0021644 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html @@ -838,7 +838,8 @@ width: 100%; background-color: #FFFBE8; text-align: center;"> - + + {{attack.name}} - - + {{parts.heafName}} --> + color: #b99a00;" *ngIf="pattern == 'look'">{{parts.heafName}}
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 01bf697..7519825 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 @@ -1710,7 +1710,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { :(this.unitData.buildingTypes[0].name=='商市场'||this.unitData.buildingTypes[0].name=='医院'||this.unitData.buildingTypes[0].name=='学校' ||this.unitData.buildingTypes[0].name=='宾馆'||this.unitData.buildingTypes[0].name=='娱乐场所'||this.unitData.buildingTypes[0].name=='餐饮业' ||this.unitData.buildingTypes[0].name=='影剧院'||this.unitData.buildingTypes[0].name=='展览建筑'||this.unitData.buildingTypes[0].name=='养老院' - ||this.unitData.buildingTypes[0].name=='会议中心')?4:this.unitData.buildingTypes[0].name=='储罐类'?'StorageTankFivePlan':this.unitData.buildingTypes[0].name=='化工生产'?'hgFivePlan':'' + ||this.unitData.buildingTypes[0].name=='会议中心')?4:this.unitData.buildingTypes[0].name=='储罐类'?'StorageTankFivePlan':this.unitData.buildingTypes[0].name=='化工生产'?'ChemicalProductionFivePlan':'' /* let fileData={ type:this.unitData.buildingTypes[0].name=='高层建筑'?1:2, file:formData diff --git a/src/app/ui/plan-template/plan-template.component.scss b/src/app/ui/plan-template/plan-template.component.scss index e5ab3c3..472ef30 100644 --- a/src/app/ui/plan-template/plan-template.component.scss +++ b/src/app/ui/plan-template/plan-template.component.scss @@ -63,6 +63,7 @@ width: 100%; display: flex; flex-direction: column; + overflow-y: auto; .selectedTr { background-color: #e1f1ff; span { diff --git a/src/app/ui/plan-template/plan-template.component.ts b/src/app/ui/plan-template/plan-template.component.ts index 9d2c261..f9396b5 100644 --- a/src/app/ui/plan-template/plan-template.component.ts +++ b/src/app/ui/plan-template/plan-template.component.ts @@ -234,11 +234,6 @@ export class PlanTemplateComponent implements OnInit { if(this.unitName==undefined){ this.snackBar.open('请选择预案模板!','确定',config); }else{ - /* this.newleftTabledata.forEach((value,index,array)=>{ - if(array[index].buildingTypeId==this.buildingTypeId){ - this.group=array[index].data - } - }) */ const dialogRef = this.dialog.open(addGroup, {//调用open方法打开对话框并且携带参数过去 width: '240px', height:'620px', @@ -247,19 +242,6 @@ export class PlanTemplateComponent implements OnInit { }); dialogRef.afterClosed().subscribe(result => { console.log(result,this.newleftTabledata) - /* if(result.length>this.newleftTabledata[this.leftclicki].data.length){ - this.newleftTabledata[this.leftclicki].data.forEach((item,i,value)=>{ - result.forEach((element,ri,rval) => { - if(value[i].groupName==rval[ri].groupName){ - console.log('000') - } - }); - }) - - this.newleftTabledata[this.leftclicki].data.push(result) - } */ - //this.newleftTabledata[this.leftclicki].data.push({groupName: '预案附件', completed: false}) - console.log(result) this.newleftTabledata.forEach((value,index,array)=>{ if(array[index].buildingTypeId==this.buildingTypeId&&array[index].planCategory==this.planCategory){ if(result!=undefined){ @@ -269,7 +251,12 @@ export class PlanTemplateComponent implements OnInit { array[index].data=result } else{ - array[index].data[i].completed=rarr[i].completed + array[index].data.forEach((group,gi,garr) => { + if(garr[gi].groupName==rarr[i].groupName){ + garr[gi].completed=rarr[i].completed + } + }); + //array[index].data[i].completed=rarr[i].completed } }); @@ -299,9 +286,13 @@ export class PlanTemplateComponent implements OnInit { dialogRef.afterClosed().subscribe(result => { console.log(result) if(result!=undefined){ - this.newleftTabledata[this.leftclicki].data.push({groupName:result,completed: true,attribute:[],zdy:true}) + if(this.newleftTabledata[this.leftclicki].data==null){ + //this.newleftTabledata[this.leftclicki].data=[] + this.newleftTabledata[this.leftclicki].data=result.addgtoup + } + this.newleftTabledata[this.leftclicki].data.push({groupName:result.groupName,completed: true,attribute:[],zdy:true}) } - + this.group=this.newleftTabledata[this.leftclicki].data }); } @@ -344,7 +335,12 @@ export class PlanTemplateComponent implements OnInit { if(array[index].attribute==null){ array[index].attribute=result }else{ - array[index].attribute[i].completed=rarr[i].completed + array[index].attribute.forEach((att,atti,attary) => { + if(rarr[i].surveyName==attary[atti].surveyName){ + attary[atti].completed=rarr[i].completed + } + }); + //array[index].attribute[i].completed=rarr[i].completed } }); @@ -403,7 +399,10 @@ export class PlanTemplateComponent implements OnInit { dialogRef.afterClosed().subscribe(result => { console.log(result) if(result!=undefined){ - this.newleftTabledata[this.leftclicki].data[0].attribute.push({completed: true, surveyName: result,zdy:true,attinf:[]}) + if(this.newleftTabledata[this.leftclicki].data[0].attribute==null){ + this.newleftTabledata[this.leftclicki].data[0].attribute=result.addwsurvey + } + this.newleftTabledata[this.leftclicki].data[0].attribute.push({completed: true, surveyName: result.groupName,zdy:true,attinf:[]}) } console.log(this.group) }); @@ -1450,20 +1449,52 @@ export class zdyaddGroup{ //console.log(this.data) } groupName + addgtoup=[ + {groupName:'单位概况',completed:false},{groupName:'灾情设定',completed:false},{groupName:'力量调集',completed:false}, + {groupName:'组织指挥',completed:false},{groupName:'作战行动',completed:false},{groupName:'社会联动',completed:false}, + {groupName:'勤务保障',completed:false},{groupName:'特别警示',completed:false},{groupName:'辅助决策',completed:false}, + {groupName:'交通水源',completed:false},{groupName:'重点图示',completed:false},{groupName:'处置要点',completed:false}, + {groupName:'预案附件',completed:false} + ] + newGroups:boolean //取消按钮 close(){ this.dialogRef.close(); } + //判断是否是分组存在的数据 + groupHave(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + try{ + this.addgtoup.forEach(item=>{ + if(item.groupName==this.groupName){ + this.newGroups=false + this.snackBar.open('您输入的内容跟新增分组里面的内容重复,请点击新增分组寻找!','确定',config); + throw Error(); + }else{ + this.newGroups=true + } + }) + }catch(e){ + + } + + } //确定提交 newGroup(){ console.log(this.groupName) const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; - config.duration = 3000 + config.duration = 5000 if(this.groupName==''||this.groupName==undefined){ this.snackBar.open('请输入分组名称!','确定',config); }else{ - this.dialogRef.close(this.groupName); + if(this.newGroups==true){ + + this.dialogRef.close({groupName:this.groupName,addgtoup:this.addgtoup}); + } + } } } @@ -1487,8 +1518,8 @@ ngOnInit(): void{ this.data=JSON.parse(JSON.stringify(this.data)) this.data.forEach(element => { if(element.groupName=='单位概况'&&element.attribute!=undefined){ - this.addwsurvey=element.attribute - /* element.attribute.forEach((datavalue,index,dataarr) => { + //this.addwsurvey=element.attribute + element.attribute.forEach((datavalue,index,dataarr) => { this.addwsurvey.forEach((value,i,arr)=>{ if(dataarr[index].surveyName==arr[i].surveyName){ if(dataarr[index].completed==true&&arr[i].completed==false){ @@ -1496,7 +1527,7 @@ ngOnInit(): void{ } } }) - }); */ + }); } }); console.log(this.addwsurvey) @@ -1521,11 +1552,38 @@ export class zdyaddattinf{ ngOnInit(): void{ //console.log(this.data) } + newGroups:boolean groupName + addwsurvey=[ + {surveyName:'单位基本信息',completed:false},{surveyName:'建筑信息',completed:false}, + {surveyName:'四周毗邻',completed:false,attinf:[{name:'东',value:''},{name:'西',value:''},{name:'南',value:''},{name:'北',value:''}]}, + {surveyName:'消防设施',completed:false},{surveyName:'进攻通道',completed:false}, + {surveyName:'重点部位',completed:false,attinf:[{heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}]}, + {surveyName:'功能分区',completed:false,attinf:[{name:'',value:''}]} + ] //取消按钮 close(){ this.dialogRef.close(); } + //判断是否跟系统内置的名称重复 + groupHave(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + try{ + this.addwsurvey.forEach(item=>{ + if(item.surveyName==this.groupName){ + this.newGroups=false + this.snackBar.open('您输入的内容跟编辑里面的内容重复,请点击编辑寻找!','确定',config); + throw Error(); + }else{ + this.newGroups=true + } + }) + }catch(e){ + + } + } //确定提交 newGroup(){ console.log(this.groupName) @@ -1535,7 +1593,10 @@ export class zdyaddattinf{ if(this.groupName==''||this.groupName==undefined){ this.snackBar.open('请输入属性名称!','确定',config); }else{ - this.dialogRef.close(this.groupName); + if(this.newGroups){ + this.dialogRef.close({groupName:this.groupName,addwsurvey:this.addwsurvey}); + } + } } } diff --git a/src/app/ui/plan-template/zdyaddgroup.html b/src/app/ui/plan-template/zdyaddgroup.html index bf7bcd5..46633d9 100644 --- a/src/app/ui/plan-template/zdyaddgroup.html +++ b/src/app/ui/plan-template/zdyaddgroup.html @@ -6,7 +6,7 @@
- +
From 1b9fdd3afd4e92af9cf35f5b671c63d28154fb66 Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Mon, 29 Nov 2021 11:32:48 +0800 Subject: [PATCH 02/12] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E9=A2=84=E6=A1=88?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=BF=AE=E6=94=B9=E4=B8=A4=E4=B8=AA=E5=BB=BA?= =?UTF-8?q?=E7=AD=91=E5=8F=AA=E5=AF=BC=E5=85=A5=E4=B8=80=E4=B8=AA=E5=BB=BA?= =?UTF-8?q?=E7=AD=91=E7=9A=84=E4=BF=A1=E6=81=AF=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-plan-online-five.component.ts | 11 +++--- .../entry-plan-look.component.html | 1 + .../entry-plan-look.component.ts | 34 +++++++++++++++++-- 3 files changed, 38 insertions(+), 8 deletions(-) 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 7519825..c79a28e 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 @@ -235,7 +235,6 @@ export class CreatePlanOnlineFiveComponent implements OnInit { }) this.buData = JSON.parse(JSON.stringify(this.buData)) - console.log(this.buData) this.buData[0].forEach((pvalue, pindex, parr) => { if (parr[pindex].length > 0) { parr[pindex].forEach((nval, nindex, narr) => { @@ -1700,21 +1699,20 @@ export class CreatePlanOnlineFiveComponent implements OnInit { fileData iftrue=false fileSc(e){ + this.clickTitleItem(this.planTemplateData[1]) this.iftrue=true const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 let formData = new FormData() formData.append("file", e.target.files[0]) + console.log(formData) let type=this.unitData.buildingTypes[0].name=='高层建筑'?1:this.unitData.buildingTypes[0].name=='居民小区'?2:this.unitData.buildingTypes[0].name=='厂房'?3 :(this.unitData.buildingTypes[0].name=='商市场'||this.unitData.buildingTypes[0].name=='医院'||this.unitData.buildingTypes[0].name=='学校' ||this.unitData.buildingTypes[0].name=='宾馆'||this.unitData.buildingTypes[0].name=='娱乐场所'||this.unitData.buildingTypes[0].name=='餐饮业' ||this.unitData.buildingTypes[0].name=='影剧院'||this.unitData.buildingTypes[0].name=='展览建筑'||this.unitData.buildingTypes[0].name=='养老院' ||this.unitData.buildingTypes[0].name=='会议中心')?4:this.unitData.buildingTypes[0].name=='储罐类'?'StorageTankFivePlan':this.unitData.buildingTypes[0].name=='化工生产'?'ChemicalProductionFivePlan':'' - /* let fileData={ - type:this.unitData.buildingTypes[0].name=='高层建筑'?1:2, - file:formData - } */ + this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{ console.log(data) if(data==null){ @@ -1729,6 +1727,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { } this.planTemplateData.forEach((pvalue,pindex,parr) => { if(parr[1].building==undefined){ + this.planTemplateData[index].building = [] if(array[index].groupName==parr[pindex].groupName){ parr[pindex].attribute=array[index].attribute } @@ -1740,7 +1739,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { } } }); - + }); //console.log(this.fileData) this.snackBar.open('解析成功!', '确定', config); 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 64f92cd..9afe20c 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 @@ -81,6 +81,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 5b41a30..3ee04c3 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 @@ -456,12 +456,12 @@ export class EntryPlanLookComponent implements OnInit { let file = this.download let fileSize = file.fileLength//下载文件的总大小 let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB - + console.log(file) if (file && fileSize <= shardSize) { //<=10MB时直接下载 this.downloadisLoading = true // this.setFileLoading() this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { responseType: 'blob' },).subscribe(data => { - + console.log(data) let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址 let link = document.createElement("a"); link.style.display = "none"; @@ -558,6 +558,36 @@ export class EntryPlanLookComponent implements OnInit { } ); } + //上传word转在线编制 + async upzhuanMb(element){ + console.log(element) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + let formData = new FormData() + let type=this.unitdata.unittype=='高层建筑'?1:this.unitdata.unittype=='居民小区'?2:this.unitdata.unittype=='厂房'?3 + :(this.unitdata.unittype=='商市场'||this.unitdata.unittype=='医院'||this.unitdata.unittype=='学校' + ||this.unitdata.unittype=='宾馆'||this.unitdata.unittype=='娱乐场所'||this.unitdata.unittype=='餐饮业' + ||this.unitdata.unittype=='影剧院'||this.unitdata.unittype=='展览建筑'||this.unitdata.unittype=='养老院' + ||this.unitdata.unittype=='会议中心')?4:this.unitdata.unittype=='储罐类'?'StorageTankFivePlan':this.unitdata.unittype=='化工生产'?'ChemicalProductionFivePlan':'' + let file=[] + let fileResult=await new Promise((resolve, reject) => { + this.http.get(`/api/Objects/PlanPlatform/${element}?x-oss-process=image/auto-orient,1`, { responseType: 'blob' }).subscribe((data: any) => { + resolve(data) + }) + }) + //file.push(fileResult) + console.log(file) + //formData.append('file',file) + /* this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{ + console.log(data) + if(data==null){ + this.snackBar.open('解析失败,请确定好格式再重新上传!', '确定', config); + }else{ + console.log(data) + } + }) */ + } } From cdc82bcf116c8c1276615fccecd36e2474e41a98 Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Wed, 1 Dec 2021 10:05:05 +0800 Subject: [PATCH 03/12] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E6=B6=88=E9=98=B2?= =?UTF-8?q?=E8=AE=BE=E6=96=BD=E6=9C=80=E9=87=8C=E5=B1=82=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=B7=9F=E6=8E=A5=E5=8F=A3=E6=AF=94=E8=BE=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-plan-online-five.component.ts | 8 +- .../entry-plan-look.component.html | 7 +- .../entry-plan-look.component.scss | 13 ++++ .../entry-plan-look.component.ts | 77 +++++++++++++------ .../plan-template.component.html | 2 +- .../plan-template/plan-template.component.ts | 67 ++++++++++++---- 6 files changed, 132 insertions(+), 42 deletions(-) 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 c79a28e..d57d5c4 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 @@ -62,8 +62,10 @@ export class CreatePlanOnlineFiveComponent implements OnInit { if (this.route.snapshot.queryParams.pattern == 'false') { this.pattern = 'look' this.blockyl = false - this.clickTitleItem('单位概况') + this.selectedItem='单位概况' + //this.clickTitleItem(this.planTemplateData[1]) } else { + this.selectedItem='封面' this.pattern = 'edit' } this.getUnitData() @@ -609,8 +611,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit { element.attribute = [{ name: '特别警示', content: '' }] } } - if(element.groupName=='三位概况'){ - this.clickTitleItem('单位概况') + if(element.groupName=='单位概况'){ + this.clickTitleItem(this.planTemplateData[1]) } }); if(this.planLevel=='4'){ 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 9afe20c..4be31bc 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 @@ -7,6 +7,9 @@ * @LastEditTime: 2021-08-24 14:01:03 --> +
+ +
@@ -81,7 +84,7 @@ 操作 改名 - 转在线导入 + 转在线导入 编辑 查看 @@ -110,4 +113,4 @@
-
\ No newline at end of file + diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.scss b/src/app/plan-management/entry-plan-look/entry-plan-look.component.scss index 2826925..8cd793d 100644 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.scss +++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.scss @@ -171,4 +171,17 @@ } } +} +.shadow{ + height: 100%; + width: 100%; + + z-index:998; + background-color:#FFFFFF; + opacity:0.3; + mat-spinner{ + position: relative; + top: 40%; + left: 40%; + } } \ No newline at end of file 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 3ee04c3..84c567d 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 @@ -14,6 +14,7 @@ import { async } from '@angular/core/testing'; import { Viewer } from 'photo-sphere-viewer'; import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper'; import Swiper from 'swiper'; +import { resolve } from 'dns'; declare var CryptoJS @Component({ selector: 'app-entry-plan-look', @@ -559,34 +560,71 @@ export class EntryPlanLookComponent implements OnInit { ); } //上传word转在线编制 + spinner=false//圈圈是否存在 async upzhuanMb(element){ - console.log(element) + this.spinner=true const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 + let objectName//预案文件名称 let formData = new FormData() + //模板导入接口传参 let type=this.unitdata.unittype=='高层建筑'?1:this.unitdata.unittype=='居民小区'?2:this.unitdata.unittype=='厂房'?3 :(this.unitdata.unittype=='商市场'||this.unitdata.unittype=='医院'||this.unitdata.unittype=='学校' ||this.unitdata.unittype=='宾馆'||this.unitdata.unittype=='娱乐场所'||this.unitdata.unittype=='餐饮业' ||this.unitdata.unittype=='影剧院'||this.unitdata.unittype=='展览建筑'||this.unitdata.unittype=='养老院' ||this.unitdata.unittype=='会议中心')?4:this.unitdata.unittype=='储罐类'?'StorageTankFivePlan':this.unitdata.unittype=='化工生产'?'ChemicalProductionFivePlan':'' - let file=[] - let fileResult=await new Promise((resolve, reject) => { - this.http.get(`/api/Objects/PlanPlatform/${element}?x-oss-process=image/auto-orient,1`, { responseType: 'blob' }).subscribe((data: any) => { - resolve(data) + let blob=[] + /* + 调用下载接口获取文件流,并赋值给blob + */ + let fileRuquest=await new Promise((resolve,reject)=>{ + this.http.get(`/api/ObjectMetadata/PlanPlatform/`+element.attachmentUrls[0]).subscribe((obdata: any) => { + objectName=obdata.objectName + this.http.get(`/api/Objects/PlanPlatform/${objectName}`, { responseType: 'blob' },).subscribe(blobdata => { + resolve(blobdata) + }) }) - }) - //file.push(fileResult) - console.log(file) - //formData.append('file',file) - /* this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{ - console.log(data) - if(data==null){ + }) + blob.push(fileRuquest)//接收返回的blob类型数据 + let file=new File(blob,objectName)//转化为file类型 + formData.append('file',file) + let pData//接受返回的模板信息数据 + /* + 调用模板导入接口,获取在线编制的json,并赋值给pData + */ + let pRequest=await new Promise((resolve,rejest)=>{ + this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{ + resolve(data) + },err=>{ + this.spinner=false this.snackBar.open('解析失败,请确定好格式再重新上传!', '确定', config); - }else{ - console.log(data) - } - }) */ + }) + }) + pData=pRequest + /* 调用新建预案接口,新建一条新的预案,并跳转新建在线编制页面 */ + let body={ + name:(element.planCategory==3?'Ⅲ级':element.planCategory==4?'Ⅳ级':element.planCategory==5?'Ⅴ级':'')+ element.name+'转在线编制', + planType: element.planType, + planMode: 2, + planLevel: element.planLevel, + planCategory:element.planCategory, + webTextData:JSON.stringify(pData) + } + let planData + let newyuan=await new Promise((resolve,reject)=>{ + this.http.post('/api/PlanComponents', body, { + params: { + companyId: this.route.snapshot.queryParams.unitId + } + }).subscribe(plandata => { + resolve(plandata) + }) + }) + planData=newyuan + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.route.snapshot.queryParams.unitId}&planName=${planData.name}&unitName=${this.unitdata.unitname}&planCategory=${planData.planCategory}&planId=${planData.id}`) + this.getAllPlanComponents() + this.spinner=false } } @@ -1182,13 +1220,6 @@ export class AddPlanone { } - - - - - - - //下载文件弹出框 @Component({ selector: 'downloadfile', diff --git a/src/app/ui/plan-template/plan-template.component.html b/src/app/ui/plan-template/plan-template.component.html index 813f4ef..99bd492 100644 --- a/src/app/ui/plan-template/plan-template.component.html +++ b/src/app/ui/plan-template/plan-template.component.html @@ -175,7 +175,7 @@ (click)='delattAndfileOne(item.groupName,element.surveyName,i)'> 删除 diff --git a/src/app/ui/plan-template/plan-template.component.ts b/src/app/ui/plan-template/plan-template.component.ts index f9396b5..bbb6d1f 100644 --- a/src/app/ui/plan-template/plan-template.component.ts +++ b/src/app/ui/plan-template/plan-template.component.ts @@ -529,13 +529,13 @@ export class PlanTemplateComponent implements OnInit { console.log(this.newleftTabledata) } //消防设施表格具体属性编辑 - fileAdd(facilityItems,filei){ + fileAdd(facilityItems,filei,filename){ if(facilityItems.length!=0){ const dialogRef = this.dialog.open(addattinf, {//调用open方法打开对话框并且携带参数过去 width: '240px', height:'400px', disableClose:true, - data:{facilityItems:facilityItems} + data:{facilityItems:facilityItems,filename,newleftTabledata:this.newleftTabledata,leftclicki:this.leftclicki} }); dialogRef.afterClosed().subscribe(result => { console.log(result) @@ -549,7 +549,7 @@ export class PlanTemplateComponent implements OnInit { }); } }) - this.group=this.newleftTabledata[this,this.leftclicki].data + this.group=this.newleftTabledata[this.leftclicki].data } console.log(this.newleftTabledata) }); @@ -1744,7 +1744,7 @@ async getattinf(){ }); this.filenewDate.forEach(element => { element.completed=false - element.olddata=element.propertyValue + //element.olddata=element.propertyValue }); }) }) @@ -1752,26 +1752,26 @@ async getattinf(){ let temp=0 this.filenewDate.forEach((buildval,buindi,buildarr)=>{ temp=0 - this.filenewDate.forEach((addval,addi,addarr)=>{ - if(buildval.propertyName==addval.propertyName){ + this.addAttinfFile.forEach((addval,addi,addarr)=>{ + if(buildval.name==addval.name){ temp++ } }) if(temp==0){ console.log(buildval) - this.filenewDate.push(buildval) + this.addAttinfFile.push(buildval) } }) - this.filenewDate.forEach((addval,addi,addarr)=>{ + this.addAttinfFile.forEach((addval,addi,addarr)=>{ temp=0 this.filenewDate.forEach((buildval,buindi,buildarr)=>{ - if(buildarr[buindi].propertyName==addarr[addi].propertyName){ + if(buildarr[buindi].name==addarr[addi].name){ temp++ } }) if(temp==0){ console.log(addarr[addi]) - this.filenewDate.splice(addi,1) + this.addAttinfFile.splice(addi,1) } }) } @@ -1779,11 +1779,52 @@ async getattinf(){ } }); }else{ + //消防设施最里层数据 + let apifile this.facilityItems=JSON.parse(JSON.stringify(this.data.facilityItems)) console.log(this.facilityItems) - /* this.facilityItems.forEach(element => { - element.completed=false - }); */ + //请求接口,看数据是否有变化 + let paramsdata:any ={ + categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId + } + let fileResult=await new Promise((resolve) => { + this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{ + resolve(data) + }) + }) + apifile=fileResult + let apifileData//消防设施最内层数据 + apifile.forEach(element => { + if(element.name==this.data.filename){ + apifileData=element.facilityItems + } + }); + console.log(apifileData) + let temp=0 + apifileData.forEach((buildval,buindi,buildarr)=>{ + temp=0 + this.facilityItems.forEach((addval,addi,addarr)=>{ + if(buildval.name==addval.name){ + temp++ + } + }) + if(temp==0){ + console.log(buildval) + this.facilityItems.push(buildval) + } + }) + this.facilityItems.forEach((addval,addi,addarr)=>{ + temp=0 + apifileData.forEach((buildval,buindi,buildarr)=>{ + if(buildarr[buindi].name==addarr[addi].name){ + temp++ + } + }) + if(temp==0){ + console.log(addarr[addi]) + this.facilityItems.splice(addi,1) + } + }) } } From 14bc1f4035281f740a5957911ff39f9d8fafac50 Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Thu, 2 Dec 2021 08:35:44 +0800 Subject: [PATCH 04/12] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E5=9C=B0=E4=B8=8B?= =?UTF-8?q?=E5=BB=BA=E7=AD=91=EF=BC=8C=E8=BD=A8=E9=81=93=E4=BA=A4=E9=80=9A?= =?UTF-8?q?=E4=BA=94=E7=BA=A7=E6=A8=A1=E6=9D=BF=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-plan-online-five.component.html | 2 +- .../create-plan-online-five.component.ts | 17 +++++++++++------ .../entry-plan-look.component.ts | 2 +- .../ui/plan-template/plan-template.component.ts | 8 ++++++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html index 0021644..a0e28e6 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html @@ -3,7 +3,7 @@
+ [cdkDragDisabled]="item.groupName == '封面'" [style.display]="item.completed==true?'block':'none'"> {{item.groupName!='新建'?key + 1:''}}.{{item.groupName}} 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 d57d5c4..a0031f0 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 @@ -58,6 +58,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { blockyl = true zaixianDr=false ngOnInit(): void { + console.log(this.route.snapshot.queryParams.wordChange) this.planLevel = this.route.snapshot.queryParams.planCategory if (this.route.snapshot.queryParams.pattern == 'false') { this.pattern = 'look' @@ -165,7 +166,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit { ||this.unitData.buildingTypes[0].name=='商市场'||this.unitData.buildingTypes[0].name=='医院'||this.unitData.buildingTypes[0].name=='学校' ||this.unitData.buildingTypes[0].name=='宾馆'||this.unitData.buildingTypes[0].name=='娱乐场所'||this.unitData.buildingTypes[0].name=='餐饮业' ||this.unitData.buildingTypes[0].name=='影剧院'||this.unitData.buildingTypes[0].name=='展览建筑'||this.unitData.buildingTypes[0].name=='养老院' - ||this.unitData.buildingTypes[0].name=='会议中心'||this.unitData.buildingTypes[0].name=='储罐类'||this.unitData.buildingTypes[0].name=='化工生产')&&this.planLevel=='5'){ + ||this.unitData.buildingTypes[0].name=='会议中心'||this.unitData.buildingTypes[0].name=='储罐类'||this.unitData.buildingTypes[0].name=='化工生产' + ||this.unitData.buildingTypes[0].name=='轨道交通'||this.unitData.buildingTypes[0].name=='地下建筑')&&this.planLevel=='5'){ this.zaixianDr=true } //console.log('单位列表信息', this.unitData) @@ -549,12 +551,14 @@ export class CreatePlanOnlineFiveComponent implements OnInit { planTemplateData: any //获得模板信息 getTemplateData() { + //console.log(this.planTemplateData) 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 => + console.log('预案内容', data) + /* this.planTemplateData = JSON.parse(data.webTextData).filter(item => item.completed == true - ) - //console.log(this.planTemplateData) + ) */ + this.planTemplateData=JSON.parse(data.webTextData) + console.log(this.planTemplateData) if (this.planTemplateData[0].groupName != '封面') { let obj = { completed: true, @@ -1713,7 +1717,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit { :(this.unitData.buildingTypes[0].name=='商市场'||this.unitData.buildingTypes[0].name=='医院'||this.unitData.buildingTypes[0].name=='学校' ||this.unitData.buildingTypes[0].name=='宾馆'||this.unitData.buildingTypes[0].name=='娱乐场所'||this.unitData.buildingTypes[0].name=='餐饮业' ||this.unitData.buildingTypes[0].name=='影剧院'||this.unitData.buildingTypes[0].name=='展览建筑'||this.unitData.buildingTypes[0].name=='养老院' - ||this.unitData.buildingTypes[0].name=='会议中心')?4:this.unitData.buildingTypes[0].name=='储罐类'?'StorageTankFivePlan':this.unitData.buildingTypes[0].name=='化工生产'?'ChemicalProductionFivePlan':'' + ||this.unitData.buildingTypes[0].name=='会议中心')?4:this.unitData.buildingTypes[0].name=='储罐类'?'StorageTankFivePlan': + this.unitData.buildingTypes[0].name=='化工生产'?'ChemicalProductionFivePlan':this.unitData.buildingTypes[0].name=='轨道交通'?'MetroFivePlan':this.unitData.buildingTypes[0].name=='地下建筑'?'UndergroundBuildingFivePlan':'' this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{ console.log(data) 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 84c567d..82f34ec 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 @@ -622,7 +622,7 @@ export class EntryPlanLookComponent implements OnInit { }) }) planData=newyuan - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.route.snapshot.queryParams.unitId}&planName=${planData.name}&unitName=${this.unitdata.unitname}&planCategory=${planData.planCategory}&planId=${planData.id}`) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.route.snapshot.queryParams.unitId}&planName=${planData.name}&unitName=${this.unitdata.unitname}&planCategory=${planData.planCategory}&planId=${planData.id}&&wordChange=true`) this.getAllPlanComponents() this.spinner=false } diff --git a/src/app/ui/plan-template/plan-template.component.ts b/src/app/ui/plan-template/plan-template.component.ts index bbb6d1f..9204b84 100644 --- a/src/app/ui/plan-template/plan-template.component.ts +++ b/src/app/ui/plan-template/plan-template.component.ts @@ -1669,12 +1669,13 @@ async getattinf(){ //console.log(this.addAttinfBuild) }) }else if(value.surveyName=='建筑信息'&&value.attinf!=undefined){ - this.buildnewDate=[] - this.addAttinfBuild=value.attinf + this.buildnewDate=[] //接受接口返回的新数据 + this.addAttinfBuild=value.attinf //模板传过来的数据 this.addAttinfBuild=JSON.parse(JSON.stringify(this.addAttinfBuild)) let paramsdata:any ={ categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId } + /* 请求接口,做差异化对比 */ let restlt=await new Promise((resolve) => { this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{ data.forEach((buildDate,buildi,buildarr) => { @@ -1688,6 +1689,7 @@ async getattinf(){ }) }) this.buildnewDate=JSON.parse(JSON.stringify(this.buildnewDate)) + //差异化比较 let temp=0 this.buildnewDate.forEach((buildval,buindi,buildarr)=>{ temp=0 @@ -1697,6 +1699,7 @@ async getattinf(){ } }) if(temp==0){ + //模板数据少于接口数据 console.log(buildval) this.addAttinfBuild.push(buildval) } @@ -1710,6 +1713,7 @@ async getattinf(){ }) if(temp==0){ console.log(addarr[addi]) + //模板数据多了 this.addAttinfBuild.splice(addi,1) } }) From 9c155bd2b9f17b5a8522b8761648abc8f9fbd1ae Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Fri, 3 Dec 2021 11:04:30 +0800 Subject: [PATCH 05/12] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E5=8A=A0=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=9A=E5=8F=AA=E6=9C=89=E4=BA=94=E7=BA=A7=E9=A2=84?= =?UTF-8?q?=E6=A1=88=E5=8F=AF=E4=BB=A5=E8=BD=AC=E5=9C=A8=E7=BA=BF=E7=BC=96?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry-plan-look/entry-plan-look.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4be31bc..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 @@ -84,7 +84,7 @@ 操作 改名 - 转在线导入 + 转在线导入 编辑 查看 From c842a56497fd11551f127f79b9e1a114bf5f5cc3 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Mon, 6 Dec 2021 13:32:11 +0800 Subject: [PATCH 06/12] =?UTF-8?q?gis=E6=A8=A1=E5=9D=97=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=B8=89=E7=BB=B4=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gis-labeling/gis-labeling.component.ts | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.ts b/src/app/gis-management/gis-labeling/gis-labeling.component.ts index 52da73d..f452aab 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.ts +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.ts @@ -423,7 +423,7 @@ export class GisLabelingComponent implements OnInit {
防火监督员:
-
责任队站:
+
责任队站:
总建筑面积:
@@ -437,7 +437,6 @@ export class GisLabelingComponent implements OnInit {
基本信息
导航
全景漫游
-
三维场景
查看预案
分享
@@ -452,7 +451,7 @@ export class GisLabelingComponent implements OnInit { this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(item) })//基本信息点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(item) })//导航点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(item) })//全景漫游点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(item) })//三维场景点击事件 + //this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(item) })//三维场景点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(item) })//查看预案点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(item) })//分享点击事件 } @@ -1200,7 +1199,7 @@ export class GisLabelingComponent implements OnInit {
防火监督员:
-
责任队站:
+
责任队站:
总建筑面积:
@@ -1214,7 +1213,6 @@ export class GisLabelingComponent implements OnInit {
基本信息
导航
全景漫游
-
三维场景
查看预案
分享
@@ -1229,7 +1227,7 @@ export class GisLabelingComponent implements OnInit { this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(e) })//基本信息点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(e) })//导航点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(e) })//全景漫游点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(e) })//三维场景点击事件 + //this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(e) })//三维场景点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(e) })//查看预案点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(e) })//分享点击事件 marker.on('click', (ev) => { //marker点击事件 @@ -1242,7 +1240,7 @@ export class GisLabelingComponent implements OnInit { this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(e) })//基本信息点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(e) })//导航点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(e) })//全景漫游点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(e) })//三维场景点击事件 + //this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(e) })//三维场景点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(e) })//查看预案点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(e) })//分享点击事件 }) @@ -1617,8 +1615,16 @@ export class LookPlanDialog { window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); } if (e.planMode == 3) { //如果是跳转网页 + if (e.url.indexOf('app') == 0) { + window.location.href = e.url + } else { sessionStorage.setItem("url", e.url) - window.open(`/planManagement/webLook`) + if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案 + window.open(`${e.url}?unitId=${this.data.id}&unitName=${this.data.name}&editMode=false`) + } else { + window.open(`/planManagement/webLook`) + } + } } } From b46c963ac48c93fd07b7261e11132c997188c43a Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Thu, 9 Dec 2021 11:39:39 +0800 Subject: [PATCH 07/12] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E9=A2=84=E6=A1=88=E6=94=BE=E5=BC=80=E5=88=A0=E9=99=A4=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-plan-online-five.component.ts | 25 +- .../entry-plan-look/AddPlanone.html | 9 +- .../entry-plan-look.component.html | 2 +- .../entry-plan-look.component.ts | 51 +++- .../plan-template/plan-template.component.ts | 275 +----------------- 5 files changed, 81 insertions(+), 281 deletions(-) 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 a0031f0..f5c654c 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 @@ -550,10 +550,31 @@ export class CreatePlanOnlineFiveComponent implements OnInit { planTemplateData: any //获得模板信息 + danweInfo={ + //若选择自定义,默认三条信息 + attribute:[ + { + attinf:[ + {completed: true,olddata: "",propertyName: "联系人",propertyType: 0,propertyValue: "",value: ""}, + {completed: true,olddata: "",propertyName: "联系电话",propertyType: 0,propertyValue: "",value: ""}, + {completed: true,olddata: "",propertyName: "单位地址",propertyType: 0,propertyValue: "",value: ""} + ], + completed: true, + surveyName: "单位基本信息" + } + ], + completed: true, + groupName: "单位概况" + } getTemplateData() { - //console.log(this.planTemplateData) + 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 ) */ @@ -619,7 +640,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { this.clickTitleItem(this.planTemplateData[1]) } }); - if(this.planLevel=='4'){ + if(this.planLevel=='4'||this.route.snapshot.queryParams.haveNew){ this.planTemplateData.push({completed: true,groupName: '新建'}) } this.planTemplateData.forEach(element => { diff --git a/src/app/plan-management/entry-plan-look/AddPlanone.html b/src/app/plan-management/entry-plan-look/AddPlanone.html index b6b0e40..084ca02 100644 --- a/src/app/plan-management/entry-plan-look/AddPlanone.html +++ b/src/app/plan-management/entry-plan-look/AddPlanone.html @@ -62,9 +62,13 @@ (已上传)
- 在线编制 - + 模板在线编制 +
+
+ 自定义在线编制 +
+
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 aad55ac..a55fbea 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 82f34ec..ff97798 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 @@ -917,6 +917,7 @@ export class AddPlanone { inputword: boolean = false //导入文档 onlineedit: boolean = false //在线编辑 website: boolean = false //网页地址 + inputNew :boolean=false //自定义编辑 next(formdata) { //console.log(formdata.value.firstCtrlthree) //console.log(this.file) @@ -935,16 +936,26 @@ export class AddPlanone { this.inputword = true this.onlineedit = false this.website = false + this.inputNew=false + } + if (formdata.value.firstCtrltwo == '16' && formdata.value.firstCtrlthree != '4') {//&& formdata.value.firstCtrlthree != '4' + this.localup = true + this.inputword = true + this.inputNew=true + this.onlineedit = false + this.website = false } if (formdata.value.firstCtrltwo == '1') { //如果是2D预案 this.localup = true this.inputword = false this.onlineedit = true this.website = true + this.inputNew=false } if (formdata.value.firstCtrltwo == '2' || formdata.value.firstCtrltwo == '4') { this.localup = true this.inputword = false + this.inputNew=false this.onlineedit = false this.website = true this.pswShow = true @@ -972,7 +983,7 @@ export class AddPlanone { //文本预案在线编制跳转 newleftTabledata planData - createWord() { + createWord(haveNew) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -1008,12 +1019,12 @@ export class AddPlanone { let open = this.newleftTabledata.filter((value, index, array) => { return value.unitname == this.data.unitType && value.planCategory == this.selectedPLanLevel }) - if (open.length > 0) { + if(haveNew==true){ this.http.post('/api/PlanComponents', { id: "", name: this.selectedPLanName, planType: Number(this.selectedPLanType), - planMode: Number(this.defaultisshow), + planMode: 2, planLevel: PlanLevel, planCategory: Number(this.selectedPLanLevel), url: "", @@ -1026,11 +1037,34 @@ export class AddPlanone { this.planData = plandata this.dialogRef.close(plandata); //console.log(plandata) - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}`) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}&haveNew=${haveNew}`) }) - } else { - this.snackBar.open('请先创建模板!', '确定', config); + }else{ + if (open.length > 0) { + this.http.post('/api/PlanComponents', { + 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(plandata => { + this.planData = plandata + this.dialogRef.close(plandata); + //console.log(plandata) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}&haveNew=${haveNew}`) + }) + } else { + this.snackBar.open('请先创建模板!', '确定', config); + } } + }) @@ -1087,7 +1121,10 @@ export class AddPlanone { config.verticalPosition = 'top'; config.duration = 3000 //this.snackBar.open('暂不支持导入','确定',config); - this.createWord() + this.createWord(false) + } + if(this.defaultisshow == '4'){ + this.createWord(true) } if (this.defaultisshow == '3' && (this.webaddress == "" || this.webaddress == null)) { //如果是填写网址 const config = new MatSnackBarConfig(); diff --git a/src/app/ui/plan-template/plan-template.component.ts b/src/app/ui/plan-template/plan-template.component.ts index 9204b84..94b4987 100644 --- a/src/app/ui/plan-template/plan-template.component.ts +++ b/src/app/ui/plan-template/plan-template.component.ts @@ -29,10 +29,6 @@ export class PlanTemplateComponent implements OnInit { ngOnInit(): void { this.getLeftdata() - this.tree = { - json:this.treedate, - config: this.treeConfig - }; } groupPanle=true//分组展开 attPanle=true @@ -41,23 +37,7 @@ export class PlanTemplateComponent implements OnInit { /* {planCategory:3,basicCategoryId:"5e7c49e861550e2754d461ce",buildingTypeId: "5e7c8ffba3050b1a840ed4b6",unitname:'高层建筑',data:[]}, {planCategory:5,basicCategoryId:"60127efe2757e904e5721d83",buildingTypeId: "5e7c9018a3050b1a840ed4b7",unitname:'地下建筑',data:[]} */ ] - //树形结构数据 - treedate=[ - { - "guid": "bc4c7a02-5379-4046-92be-12c67af4295a", - "displayName": "Elentrix", - "children": [ - /* "85d412c2-ebc1-4d56-96c9-7da433ac9bb2", - "28aac445-83b1-464d-9695-a4157dab6eac" */ - ] - } - - ] - tree - treeConfig = { - nodeWidth: 90, - nodeHeight: 60 -}; + group=[] getLeftdata(){ this.http.get("/api/PlanTemplate").subscribe((data:any)=>{ @@ -435,6 +415,7 @@ export class PlanTemplateComponent implements OnInit { addAttInfo(surveyName,suri){ if(surveyName!='单位基本信息'&&surveyName!='建筑信息'&&surveyName!='四周毗邻'&&surveyName!='消防设施'&&surveyName!='重点部位'&&surveyName!='功能分区'){ if(surveyName=='进攻通道'){ + //进攻通道只有表格 if(this.group[0].attribute[suri].attinf==undefined){ this.group[0].attribute[suri].attinf=[] this.group[0].attribute[suri].attinf.push({head:'',tableth:[],completed:true}) @@ -651,242 +632,6 @@ export class PlanTemplateComponent implements OnInit { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - let linshi=[ - { - "attribute": [ - { - "attinf": [ - { - "value": "", - "olddata": "", - "completed": false, - "propertyName": "统一社会信用代码", - "propertyType": 0 - }, - { - "value": "", - "olddata": "", - "completed": false, - "propertyName": "单位类型", - "propertyType": 0 - }, - { - "value": "", - "olddata": "", - "completed": true, - "propertyName": "单位地址", - "propertyType": 0, - "analysisWord": { - "valueAxis": [ 1, 1 ], - "tableIndex": 0, - "valueField": "propertyValue" - } - }, - { - "value": "", - "olddata": "", - "completed": true, - "propertyName": "联系人", - "propertyType": 0, - "analysisWord": { - "valueAxis": [ 1, 5 ], - "tableIndex": 0, - "valueField": "propertyValue" - } - }, - { - "value": "", - "olddata": "", - "completed": false, - "propertyName": "辖区中队", - "propertyType": 0 - }, - { - "value": "", - "olddata": "", - "completed": true, - "propertyName": "联系电话", - "propertyType": 0, - "analysisWord": { - "valueAxis": [ 1, 5 ], - "tableIndex": 0, - "valueField": "propertyValue" - } - } - ], - "completed": true, - "surveyName": "单位基本信息" - }, - { - "completed": false, - "surveyName": "建筑信息" - }, - { - "attinf": [ - { - "name": "东", - "value": "", - "analysisWord": { - "valueAxis": [ 2, 2 ], - "tableIndex": 0, - "valueField": "value" - } - }, - { - "name": "西", - "value": "", - "analysisWord": { - "valueAxis": [ 2, 4 ], - "tableIndex": 0, - "valueField": "value" - } - }, - { - "name": "南", - "value": "", - "analysisWord": { - "valueAxis": [ 3, 2 ], - "tableIndex": 0, - "valueField": "value" - } - }, - { - "name": "北", - "value": "", - "analysisWord": { - "valueAxis": [ 3, 4 ], - "tableIndex": 0, - "valueField": "value" - } - } - ], - "completed": true, - "surveyName": "四周毗邻" - }, - { - "completed": false, - "surveyName": "消防设施" - }, - { - "completed": false, - "surveyName": "进攻通道" - }, - { - "attinf": [ - { - "body": [ - { - "name": "重点部位名称", - "value": "" - }, - { - "name": "重点部位所在位置", - "value": "" - }, - { - "name": "建筑结构", - "value": "" - }, - { - "name": "使用性质", - "value": "" - }, - { - "name": "主要危险性", - "value": "" - } - ], - "heafName": "" - } - ], - "completed": false, - "surveyName": "重点部位" - }, - { - "attinf": [ - { - "name": "", - "value": "" - } - ], - "completed": false, - "surveyName": "功能分区" - }, - { - "zdy": true, - "attinf": [ - { - "level": "3", - "tableth": "", - "headName": "备注详情", - "analysisWord": { - "valueAxis": [ 4, 1 ], - "tableIndex": 0, - "valueField": "tableth" - } - } - ], - "completed": true, - "surveyName": "备注" - } - ], - "completed": true, - "groupName": "单位概况" - }, - { - "completed": false, - "groupName": "灾情设定" - }, - { - "completed": false, - "groupName": "力量调集" - }, - { - "completed": false, - "groupName": "组织指挥" - }, - { - "completed": false, - "groupName": "作战行动" - }, - { - "completed": false, - "groupName": "社会联动" - }, - { - "completed": false, - "groupName": "勤务保障" - }, - { - "completed": false, - "groupName": "特别警示" - }, - { - "completed": false, - "groupName": "辅助决策" - }, - { - "completed": true, - "groupName": "交通水源", - "manualWord": { - "valueAxis": [ 1, 6 ], - "KeyAxis": [ 0, 6 ], - "tableIndex": 0 - } - }, - { - "completed": true, - "groupName": "重点图示" - }, - { - "completed": false, - "groupName": "处置要点" - }, - { - "completed": false, - "groupName": "预案附件" - } - ] let body={ id:this.Id, @@ -1107,7 +852,7 @@ export class PlanTemplateComponent implements OnInit { } } - ////修改多行文本,表格行列数量 + //修改多行文本,表格行列数量 updataHl(...num:number[]){ const dialogRef = this.dialog.open(updataHl, {//调用open方法打开对话框并且携带参数过去 width: '340px', @@ -1257,6 +1002,7 @@ export class addPlanname{ close(){ this.dialogRef.close(); } + //确定按钮 newplan(){ this.unitname=document.getElementById('unit').innerText const config = new MatSnackBarConfig(); @@ -1403,17 +1149,7 @@ export class addGroup{ //复选框点击事件 clicki checkClick(){ - //this.clicki=i - //console.log(e,item) - /* if (e.checked) { - this.groupName.push(item) - }else { - this.groupName.forEach((value,index,array)=>{ - if(value==item){ - this.groupName.splice(index,1) - } - }) - } */ + console.log(this.data) } //确定提交 @@ -1575,6 +1311,7 @@ export class zdyaddattinf{ if(item.surveyName==this.groupName){ this.newGroups=false this.snackBar.open('您输入的内容跟编辑里面的内容重复,请点击编辑寻找!','确定',config); + //跳出foreach循环 throw Error(); }else{ this.newGroups=true From f49e55cce0f34067cad0435a7967088324541ff1 Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Thu, 9 Dec 2021 17:21:43 +0800 Subject: [PATCH 08/12] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E9=A2=84=E6=A1=88=E5=AE=A1=E6=A0=B8=E7=8A=B6=E6=80=81=E5=8F=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-plan-online-five.component.ts | 145 +++++++++++------- .../entry-plan-look/changeUrl.html | 16 ++ .../entry-plan-look.component.html | 2 +- .../entry-plan-look.component.ts | 51 +++++- .../plan-management/plan-management.module.ts | 3 +- 5 files changed, 155 insertions(+), 62 deletions(-) create mode 100644 src/app/plan-management/entry-plan-look/changeUrl.html 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, From affc0c437824e2db800fbb1fd6c11710c60fd25f Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Mon, 13 Dec 2021 10:27:50 +0800 Subject: [PATCH 09/12] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E9=A2=84=E6=A1=88=E9=9D=9E=E5=AE=A1=E6=A0=B8=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-plan-online-five.component.html | 4 +- .../create-plan-online-five.component.scss | 7 + .../create-plan-online-five.component.ts | 288 +++++++++++------- .../entry-plan-look.component.ts | 40 ++- .../plan-template/plan-template.component.ts | 4 +- 5 files changed, 224 insertions(+), 119 deletions(-) diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html index a0e28e6..a02421d 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html @@ -721,6 +721,7 @@ opacity: 1; height: 40px; line-height: 40px;">{{itemunit.name}} +
{{element.surveyName}} + (click)='unitadd(element.surveyName,uniti,elei)' *ngIf="pattern == 'edit'"> +
diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss index f5573d9..7ab6a1d 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss @@ -744,6 +744,13 @@ height: 40px; line-height: 40px; } + img{ + cursor: pointer; + float: right; + position: relative; + top: 10px; + right: 10px; + } } .unitbody { height: 100%; 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 5db1d7e..c1ab71a 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 @@ -20,6 +20,7 @@ import { TreeService } from '../../http-interceptors/tree.service' import Viewer from 'viewerjs'; import { async } from 'rxjs/internal/scheduler/async'; import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; +import { adddwsurvey, addGroup } from '@src/app/ui/plan-template/plan-template.component'; declare var $: any @Component({ selector: 'app-create-plan-online-five', @@ -57,7 +58,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit { planLevel: string//预案级别 blockyl = true zaixianDr=false + haveNew=false ngOnInit(): void { + this.haveNew=this.route.snapshot.queryParams.haveNew console.log(this.route.snapshot.queryParams.wordChange) this.planLevel = this.route.snapshot.queryParams.planCategory if (this.route.snapshot.queryParams.pattern == 'false') { @@ -357,13 +360,29 @@ export class CreatePlanOnlineFiveComponent implements OnInit { let index = this.getArrayIndex(this.planTemplateData,'单位概况') this.planTemplateData[index].building.forEach(element => { if(element.body[0].completed){ - element.body[0].attinf[0].value = element.body[0].attinf[0].olddata = this.unitData.usci + element.body[0].attinf.forEach((arrval,atti,attarr) => { + if(arrval.propertyName=='统一社会信用代码'){ + arrval.value=arrval.olddata=this.unitData.usci + }else if(arrval.propertyName=='单位类型'){ + arrval.value=arrval.olddata=this.unitData.buildingTypes[0].name + }else if(arrval.propertyName=='联系人'){ + arrval.value=arrval.olddata=this.unitData.contacts + }else if(arrval.propertyName=='联系电话'){ + arrval.value=arrval.olddata=this.unitData.phone + }else if(arrval.propertyName=='辖区中队'){ + arrval.value=arrval.olddata=this.unitData.organizationName + }else if(arrval.propertyName=='单位地址'){ + arrval.value=arrval.olddata=this.unitData.address + } + }); + /* element.body[0].attinf[0].value = element.body[0].attinf[0].olddata = this.unitData.usci element.body[0].attinf[1].value = element.body[0].attinf[1].olddata = this.unitData.buildingTypes[0].name element.body[0].attinf[2].value = element.body[0].attinf[2].olddata = this.unitData.contacts element.body[0].attinf[3].value = element.body[0].attinf[3].olddata = this.unitData.phone element.body[0].attinf[4].value = element.body[0].attinf[4].olddata = this.unitData.organizationName - element.body[0].attinf[5].value = element.body[0].attinf[5].olddata = this.unitData.address - if (element.body[1].attinf != undefined) { + element.body[0].attinf[5].value = element.body[0].attinf[5].olddata = this.unitData.address */ + + if (element.body.length>1&&element.body[1].attinf != undefined) { element.body[1].attinf.forEach(eBuild => { this.buildZong.forEach(oldBuild => { if (oldBuild.buildingBasicGroups.length > 0) { @@ -378,8 +397,6 @@ export class CreatePlanOnlineFiveComponent implements OnInit { }); - - console.log(this.planTemplateData) } else if (this.selectedItem == '预案附件') { this.getTwoDPlanList() @@ -567,127 +584,125 @@ export class CreatePlanOnlineFiveComponent implements OnInit { groupName: "单位概况" } getTemplateData() { - - if(this.route.snapshot.queryParams.haveNew!=undefined){ - this.planTemplateData=[] - 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) - - 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 != '封面') { + if(this.route.snapshot.queryParams.haveNew!=undefined&&data.webTextData==null){ + this.planTemplateData=[] 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: '' - } + 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) - } - 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 if(data.webTextData!=null){ + 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 { + console.log(result) + if(result!=undefined){ + if(result.length>this.planTemplateData.length){ + result.forEach((valuer,i,rarr) => { + let temp=0 + this.planTemplateData[index].attribute.forEach((group,gi,garr) => { + if(valuer.surveyName==group.surveyName){ + temp++ + } + }) + if(temp==0){ + //将缺少的填上 + this.planTemplateData[index].attribute.push(valuer) + } + }); + } + result.forEach((valuer,i,rarr) => { + this.planTemplateData[index].attribute.forEach((group,gi,garr) => { + if(garr[gi].surveyName==rarr[i].surveyName){ + garr[gi].completed=rarr[i].completed + } + }); + }) + this.planTemplateData[index].building[this.clicki].body=this.planTemplateData[index].attribute + } + + console.log(this.planTemplateData) + }) + + } } @@ -2056,4 +2121,5 @@ export class updataHl{ } this.dialogRef.close(result); } -} \ No newline at end of file +} + 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 c2f9a45..fcf5fcc 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 @@ -187,7 +187,12 @@ export class EntryPlanLookComponent implements OnInit { } else if (e.planType == 16) { if (e.attachmentUrls == null) { - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true`) + if(e.planMode==4){ + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&haveNew=true`) + }else{ + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true`) + } + } else { let body = {}; @@ -208,7 +213,22 @@ export class EntryPlanLookComponent implements OnInit { } else if (e.planType == 2) { //三维预案 - if (e.url.indexOf('app') == 0) { + 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() + } + } + ); + /* if (e.url.indexOf('app') == 0) { window.location.href = e.url } else { sessionStorage.setItem("url", e.url) @@ -217,7 +237,7 @@ export class EntryPlanLookComponent implements OnInit { } else { window.open(`/planManagement/webLook`) } - } + } */ } else { this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); } @@ -279,6 +299,7 @@ export class EntryPlanLookComponent implements OnInit { config.duration = 3000 this.snackBar.open('修改成功!', '确定', config); this.getAllPlanComponents() + } } ); @@ -950,7 +971,7 @@ export class AddPlanone { this.inputword = true this.onlineedit = false this.website = false - this.inputNew=false + this.inputNew=true } if (formdata.value.firstCtrltwo == '16' && formdata.value.firstCtrlthree != '4') {//&& formdata.value.firstCtrlthree != '4' this.localup = true @@ -1038,7 +1059,7 @@ export class AddPlanone { id: "", name: this.selectedPLanName, planType: Number(this.selectedPLanType), - planMode: 2, + planMode: Number(this.defaultisshow), planLevel: PlanLevel, planCategory: Number(this.selectedPLanLevel), url: "", @@ -1451,6 +1472,7 @@ export class ImgDetails { export class ChangeUrl{ constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } planUrl: any//预案路径 + updata//修改后的data ngOnInit(): void { this.planUrl = this.data.element.url } @@ -1469,7 +1491,15 @@ export class ChangeUrl{ auditStatus:8 } this.http.put(`/api/PlanComponents/${this.data.element.id}`, body, options).subscribe(data => { + console.log(data) + this.updata=data this.dialogRef.close("success"); + sessionStorage.setItem("url", this.updata.url) + if ((this.updata.url as string).includes('gis/threeDimensionalHome')) { //三维预案 + window.open(`${this.updata.url}?unitId=${this.updata.companyId}&unitName=${this.updata.name}&editMode=true`) + } else { + window.open(`/planManagement/webLook`) + } }) } diff --git a/src/app/ui/plan-template/plan-template.component.ts b/src/app/ui/plan-template/plan-template.component.ts index 94b4987..ffbcad5 100644 --- a/src/app/ui/plan-template/plan-template.component.ts +++ b/src/app/ui/plan-template/plan-template.component.ts @@ -1245,10 +1245,10 @@ export class adddwsurvey{ addwsurvey=[ {surveyName:'单位基本信息',completed:false},{surveyName:'建筑信息',completed:false}, {surveyName:'四周毗邻',completed:false,attinf:[{name:'东',value:''},{name:'西',value:''},{name:'南',value:''},{name:'北',value:''}]}, - {surveyName:'消防设施',completed:false},{surveyName:'进攻通道',completed:false}, + {surveyName:'消防设施',completed:false}, {surveyName:'重点部位',completed:false,attinf:[{heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}]}, {surveyName:'功能分区',completed:false,attinf:[{name:'',value:''}]} -] +]//{surveyName:'进攻通道',completed:false}, ngOnInit(): void{ console.log(this.data) this.data=JSON.parse(JSON.stringify(this.data)) From e5c5c2934386a8bfd970d92c5d72a4bf6fb6debc Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Mon, 13 Dec 2021 11:25:55 +0800 Subject: [PATCH 10/12] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E9=A2=84=E6=A1=88?= =?UTF-8?q?=E7=BC=96=E5=88=B6=E6=8C=89=E9=92=AE=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry-plan-look.component.ts | 182 +++++++++--------- 1 file changed, 94 insertions(+), 88 deletions(-) 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 fcf5fcc..23d25ee 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 @@ -174,76 +174,9 @@ export class EntryPlanLookComponent implements OnInit { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - if (e.auditStatus == 8) { - 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) { - if (e.attachmentUrls == null) { - if(e.planMode==4){ - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&haveNew=true`) - }else{ - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true`) - } - - } - else { - let body = {}; - 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.getAllPlanComponents() - this.lookPlan(e) - }/* ,err => { - this.snackBar.open(err,'确定',config); - } */) - } - - } - else if (e.planType == 2) { //三维预案 - 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() - } - } - ); - /* if (e.url.indexOf('app') == 0) { - window.location.href = e.url - } else { - sessionStorage.setItem("url", e.url) - if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案 - window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`) - } else { - window.open(`/planManagement/webLook`) - } - } */ - } else { - this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); - } - } else { - let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗') - if (isTrue) { + let isTrue = confirm('您确定编辑吗,若是公开预案会变成未公开状态') + if(isTrue){ + if (e.auditStatus == 8) { if (e.planType == 1) { //如果是在线编辑 let id = e.id sessionStorage.setItem("planId", id) @@ -256,8 +189,12 @@ export class EntryPlanLookComponent implements OnInit { } else if (e.planType == 16) { if (e.attachmentUrls == null) { - console.log(this.compantData) - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) + if(e.planMode==4){ + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&haveNew=true`) + }else{ + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true`) + } + } else { let body = {}; @@ -272,23 +209,14 @@ export class EntryPlanLookComponent implements OnInit { this.getAllPlanComponents() this.lookPlan(e) }/* ,err => { - this.snackBar.open(err,'确定',config); - } */) + this.snackBar.open(err,'确定',config); + } */) } - + } else if (e.planType == 2) { //三维预案 - /* if (e.url.indexOf('app') == 0) { - window.location.href = e.url - } else { - sessionStorage.setItem("url", e.url) - if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案 - window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`) - } else { - window.open(`/planManagement/webLook`) - } - } */ const dialogRef = this.dialog.open(ChangeUrl, { + //改网址 data: { element: e } }); dialogRef.afterClosed().subscribe( @@ -299,18 +227,92 @@ export class EntryPlanLookComponent implements OnInit { config.duration = 3000 this.snackBar.open('修改成功!', '确定', config); this.getAllPlanComponents() - } } ); + /* if (e.url.indexOf('app') == 0) { + window.location.href = e.url + } else { + sessionStorage.setItem("url", e.url) + if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案 + window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`) + } else { + window.open(`/planManagement/webLook`) + } + } */ } else { - this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); } + } else { + 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) + 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) { + if (e.attachmentUrls == null) { + console.log(this.compantData) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) + } + else { + let body = {}; + 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.getAllPlanComponents() + this.lookPlan(e) + }/* ,err => { + this.snackBar.open(err,'确定',config); + } */) + } + + } + else if (e.planType == 2) { //三维预案 + /* if (e.url.indexOf('app') == 0) { + window.location.href = e.url + } else { + sessionStorage.setItem("url", e.url) + if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案 + window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`) + } 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); + } + } } } - } allPlanComponents: any //所有预案组件 companyId: any //新建预案需要使用的id @@ -384,6 +386,8 @@ export class EntryPlanLookComponent implements OnInit { this.http.delete(`/api/PlanComponents2D/${plandata.id}`).subscribe(data => { this.snackBar.open('删除成功!', '确定', config); this.getAllPlanComponents() + },err=>{ + this.snackBar.open(err, '确定', config); }) } else { this.http.delete(`/api/PlanComponents/${plandata.id}`).subscribe(data => { @@ -392,6 +396,8 @@ export class EntryPlanLookComponent implements OnInit { config.duration = 3000 this.snackBar.open('删除成功!', '确定', config); this.getAllPlanComponents() + },err=>{ + this.snackBar.open(err, '确定', config); }) } } From 5a9ef6e53140e285dd43134f6e353fac425724b3 Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Mon, 13 Dec 2021 16:06:06 +0800 Subject: [PATCH 11/12] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E4=BA=94=E7=BA=A7?= =?UTF-8?q?=E5=86=9C=E6=9D=91=E6=A8=A1=E6=9D=BF=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-plan-online-five.component.ts | 15 +++++++-------- .../scheduled-updates.component.html | 11 +++++++++-- 2 files changed, 16 insertions(+), 10 deletions(-) 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 c1ab71a..4ace18d 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 @@ -165,12 +165,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { data.items.forEach(element => { if (element.id == this.route.snapshot.queryParams.companyId) { this.unitData = element - if((this.unitData.buildingTypes[0].name=='高层建筑'||this.unitData.buildingTypes[0].name=='居民小区'||this.unitData.buildingTypes[0].name=='厂房' - ||this.unitData.buildingTypes[0].name=='商市场'||this.unitData.buildingTypes[0].name=='医院'||this.unitData.buildingTypes[0].name=='学校' - ||this.unitData.buildingTypes[0].name=='宾馆'||this.unitData.buildingTypes[0].name=='娱乐场所'||this.unitData.buildingTypes[0].name=='餐饮业' - ||this.unitData.buildingTypes[0].name=='影剧院'||this.unitData.buildingTypes[0].name=='展览建筑'||this.unitData.buildingTypes[0].name=='养老院' - ||this.unitData.buildingTypes[0].name=='会议中心'||this.unitData.buildingTypes[0].name=='储罐类'||this.unitData.buildingTypes[0].name=='化工生产' - ||this.unitData.buildingTypes[0].name=='轨道交通'||this.unitData.buildingTypes[0].name=='地下建筑')&&this.planLevel=='5'){ + if(this.planLevel=='5'){ this.zaixianDr=true } //console.log('单位列表信息', this.unitData) @@ -1792,7 +1787,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit { ||this.unitData.buildingTypes[0].name=='宾馆'||this.unitData.buildingTypes[0].name=='娱乐场所'||this.unitData.buildingTypes[0].name=='餐饮业' ||this.unitData.buildingTypes[0].name=='影剧院'||this.unitData.buildingTypes[0].name=='展览建筑'||this.unitData.buildingTypes[0].name=='养老院' ||this.unitData.buildingTypes[0].name=='会议中心')?4:this.unitData.buildingTypes[0].name=='储罐类'?'StorageTankFivePlan': - this.unitData.buildingTypes[0].name=='化工生产'?'ChemicalProductionFivePlan':this.unitData.buildingTypes[0].name=='轨道交通'?'MetroFivePlan':this.unitData.buildingTypes[0].name=='地下建筑'?'UndergroundBuildingFivePlan':'' + this.unitData.buildingTypes[0].name=='化工生产'?'ChemicalProductionFivePlan':this.unitData.buildingTypes[0].name=='轨道交通'?'MetroFivePlan': + this.unitData.buildingTypes[0].name=='地下建筑'?'UndergroundBuildingFivePlan':this.unitData.buildingTypes[0].name=='农村'?'CountrysideFivePlan':'' this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{ console.log(data) @@ -1803,7 +1799,10 @@ export class CreatePlanOnlineFiveComponent implements OnInit { this.fileData.forEach((value,index,array) => { if(value.groupName=='交通水源'||value.groupName=='重点图示'){ value.attribute.forEach(element => { - element.imgArr[0]=element.imgArr[0].slice(25,element.imgArr[0].length) + if(element.imgArr!=undefined){ + element.imgArr[0]=element.imgArr[0].slice(25,element.imgArr[0].length) + } + }); } this.planTemplateData.forEach((pvalue,pindex,parr) => { diff --git a/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.html b/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.html index dec496c..bbda33a 100644 --- a/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.html +++ b/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.html @@ -31,9 +31,16 @@
-
-
+ + autorenew + +
+ +
+ + autorenew +
\ No newline at end of file From 5eb2d516a23b2c3bc287fec3186ccba953365085 Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Thu, 16 Dec 2021 11:35:45 +0800 Subject: [PATCH 12/12] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=BA=94=E7=BA=A7?= =?UTF-8?q?=E5=86=9C=E6=9D=91=E9=A2=84=E6=A1=88=E4=B8=8A=E4=BC=A0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-plan-online-five.component.html | 12 ++-- .../create-plan-online-five.component.ts | 2 +- .../entry-plan-look.component.ts | 3 +- src/app/tabbar/tabbar.component.html | 8 +-- src/app/tabbar/tabbar.component.ts | 56 +++++++++++-------- 5 files changed, 45 insertions(+), 36 deletions(-) diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html index a02421d..4642e56 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html @@ -679,17 +679,17 @@ border: 0; box-sizing: border-box; padding: 0 5px;"> {{ i.name }} - delete - + +
- delete - + + 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 4ace18d..90442c8 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 @@ -1799,7 +1799,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { this.fileData.forEach((value,index,array) => { if(value.groupName=='交通水源'||value.groupName=='重点图示'){ value.attribute.forEach(element => { - if(element.imgArr!=undefined){ + if(element.imgArr!=undefined&&element.imgArr.length>0){ element.imgArr[0]=element.imgArr[0].slice(25,element.imgArr[0].length) } 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 23d25ee..2727df6 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 @@ -614,7 +614,8 @@ export class EntryPlanLookComponent implements OnInit { :(this.unitdata.unittype=='商市场'||this.unitdata.unittype=='医院'||this.unitdata.unittype=='学校' ||this.unitdata.unittype=='宾馆'||this.unitdata.unittype=='娱乐场所'||this.unitdata.unittype=='餐饮业' ||this.unitdata.unittype=='影剧院'||this.unitdata.unittype=='展览建筑'||this.unitdata.unittype=='养老院' - ||this.unitdata.unittype=='会议中心')?4:this.unitdata.unittype=='储罐类'?'StorageTankFivePlan':this.unitdata.unittype=='化工生产'?'ChemicalProductionFivePlan':'' + ||this.unitdata.unittype=='会议中心')?4:this.unitdata.unittype=='储罐类'?'StorageTankFivePlan' + :this.unitdata.unittype=='化工生产'?'ChemicalProductionFivePlan':this.unitdata.unittype=='农村'?'CountrysideFivePlan':'' let blob=[] /* 调用下载接口获取文件流,并赋值给blob diff --git a/src/app/tabbar/tabbar.component.html b/src/app/tabbar/tabbar.component.html index 9774d50..fba1820 100644 --- a/src/app/tabbar/tabbar.component.html +++ b/src/app/tabbar/tabbar.component.html @@ -214,15 +214,15 @@
- 提交审核 - 撤销审核 + 撤销审核 --> - ( + (审核通过) { + this.contentVerify = data + sessionStorage.setItem('contentVerify',JSON.stringify(data)) + },err=>{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open(err,'确定',config); + }) } - this.http.post(`/api/ContentVerifies`,body).subscribe(data=>{ - this.contentVerify = data - sessionStorage.setItem('contentVerify',JSON.stringify(data)) - },err=>{ + + } + //撤销单位审核 + cancelAudit(){ + let isTrue = confirm('您确定要撤销审核该条信息吗') + if(isTrue){ + this.http.delete(`/api/ContentVerifies/${this.contentVerify.id}`).subscribe(data=>{ + this.contentVerify = data + sessionStorage.setItem('contentVerify',JSON.stringify(data)) + }, + err=>{ const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 this.snackBar.open(err,'确定',config); - }) - } - //撤销单位审核 - cancelAudit(){ - this.http.delete(`/api/ContentVerifies/${this.contentVerify.id}`).subscribe(data=>{ - this.contentVerify = data - sessionStorage.setItem('contentVerify',JSON.stringify(data)) - }, - err=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open(err,'确定',config); - }) + }) + } + } //初始化下载 downloadFile () {