From e37dde65b506957408ba82194ed2aa13e638711a Mon Sep 17 00:00:00 2001 From: chenjingyu <1148019379@qq.com> Date: Fri, 24 Sep 2021 15:54:27 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E4=BA=94=E7=BA=A7=E9=AB=98?= =?UTF-8?q?=E5=B1=82=E5=9C=A8=E7=BA=BF=E7=BC=96=E5=88=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?word=E5=AF=B9=E6=8E=A5=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= 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.scss | 17 +++++ .../create-plan-online-five.component.ts | 62 +++++++++++++++++-- 3 files changed, 80 insertions(+), 8 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 f1823c6..2b4e290 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 @@ -14,7 +14,7 @@ - + @@ -27,7 +27,9 @@ visibility 退出预览
- +
+ +
@@ -262,7 +264,8 @@
-
+
+
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 b6bfc31..e03f010 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 @@ -79,6 +79,22 @@ box-sizing: border-box; padding-top: 66px; overflow-y: auto; + .shadow{ + height: 95%; + width: 97%; + margin: 10px 10px 10px 10px; + /* position:absolute; + left:0; + top:0; */ + z-index:998; + background-color:#FFFFFF; + opacity:0.6; + mat-spinner{ + position: relative; + top: 40%; + left: 45%; + } + } .leftbox { position: fixed; width: 14%; @@ -401,6 +417,7 @@ min-height: 97%; box-sizing: border-box; padding: 10px 10px 0; + .cover { width: 100%; min-height: 780px; 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 348d3e3..d21a440 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 @@ -230,7 +230,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { }) this.buData = JSON.parse(JSON.stringify(this.buData)) - console.log(this.buData) + //console.log(this.buData) this.buData.forEach((pvalue, pindex, parr) => { if (parr[pindex].length > 0) { parr[pindex].forEach((nval, nindex, narr) => { @@ -392,7 +392,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { //delete this.planTemplateData[this.planTemplateData.length-3] } //JSON.parse(JSON.stringify(this.planTemplateData)) - console.log(this.planTemplateData) + //console.log(this.planTemplateData) }); } } @@ -420,7 +420,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { drop(event: CdkDragDrop) { moveItemInArray(this.planTemplateData, event.previousIndex, event.currentIndex); - console.log('拖拽标题', this.planTemplateData) + //console.log('拖拽标题', this.planTemplateData) } //获取建筑信息 @@ -1117,7 +1117,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { }) } - console.log(this.planTemplateData) + //console.log(this.planTemplateData) } //单位相关数据 unitId: any = this.route.snapshot.queryParams.companyId @@ -1340,6 +1340,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { pattern: string = 'edit' preview() { this.pattern = 'look' + this.clickTitleItem('单位概况') } quitPreview() { this.pattern = 'edit' @@ -1489,7 +1490,58 @@ export class CreatePlanOnlineFiveComponent implements OnInit { } //上传 upload() { - document.getElementById('up').click() + let isTrue = confirm('上传新文件后可能会覆盖原有数据,您确定要继续上传吗') + if(isTrue){ + document.getElementById('up').click() + } + } + //在线文档上传接口 + fileData + iftrue=false + fileSc(e){ + this.iftrue=true + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + let formData = new FormData() + formData.append("file", e.target.files[0]) + let fileData={ + type:1, + file:formData + } + this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=1`,formData).subscribe((data:any)=>{ + console.log(data) + if(data==null){ + this.snackBar.open('解析失败,请确定好格式再重新上传!', '确定', config); + }else{ + this.fileData=JSON.parse(JSON.stringify(data)) + 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) + }); + } + this.planTemplateData.forEach((pvalue,pindex,parr) => { + if(parr[1].building==undefined){ + if(array[index].groupName==parr[pindex].groupName){ + parr[pindex].attribute=array[index].attribute + } + }else{ + if(array[index].groupName==parr[pindex].groupName&&pindex!=1){ + parr[pindex].attribute=array[index].attribute + }else if(array[index].groupName==parr[pindex].groupName&&pindex==1){ + parr[pindex].building[0].body=array[index].attribute + } + } + }); + + }); + //console.log(this.fileData) + this.snackBar.open('解析成功!', '确定', config); + } + this.iftrue=false + e.target.value='' + }) } }