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] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E9=A2=84=E6=A1=88=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E4=BF=AE=E6=94=B9=E4=B8=A4=E4=B8=AA=E5=BB=BA=E7=AD=91?= =?UTF-8?q?=E5=8F=AA=E5=AF=BC=E5=85=A5=E4=B8=80=E4=B8=AA=E5=BB=BA=E7=AD=91?= =?UTF-8?q?=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) + } + }) */ + } }