|
|
@ -159,7 +159,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
data.items.forEach(element => { |
|
|
|
data.items.forEach(element => { |
|
|
|
if (element.id == this.route.snapshot.queryParams.companyId) { |
|
|
|
if (element.id == this.route.snapshot.queryParams.companyId) { |
|
|
|
this.unitData = element |
|
|
|
this.unitData = element |
|
|
|
if(this.unitData.buildingTypes[0].name=='高层建筑'&&this.planLevel=='5'){ |
|
|
|
if((this.unitData.buildingTypes[0].name=='高层建筑'||this.unitData.buildingTypes[0].name=='居民楼')&&this.planLevel=='5'){ |
|
|
|
this.zaixianDr=true |
|
|
|
this.zaixianDr=true |
|
|
|
} |
|
|
|
} |
|
|
|
//console.log('单位列表信息', this.unitData)
|
|
|
|
//console.log('单位列表信息', this.unitData)
|
|
|
@ -1212,7 +1212,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
addNumber = -1 |
|
|
|
addNumber = -1 |
|
|
|
addTd(key, i) { |
|
|
|
addTd(key, i) { |
|
|
|
this.addNumber++ |
|
|
|
this.addNumber++ |
|
|
|
if (this.planTemplateData[key].attribute[i].tableth == undefined) { |
|
|
|
if (this.planTemplateData[key].attribute[i].tableth == undefined||this.planTemplateData[key].attribute[i].tableth.length==0) { |
|
|
|
//this.planTemplateData[key].attribute[i].tabletr = []
|
|
|
|
//this.planTemplateData[key].attribute[i].tabletr = []
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.verticalPosition = 'top'; |
|
|
@ -1368,6 +1368,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
this.addNumber++ |
|
|
|
this.addNumber++ |
|
|
|
this.planTemplateData[index].building[attacki].body.forEach((value,bodyi,arr)=>{ |
|
|
|
this.planTemplateData[index].building[attacki].body.forEach((value,bodyi,arr)=>{ |
|
|
|
if(surveyName==arr[bodyi].surveyName){ |
|
|
|
if(surveyName==arr[bodyi].surveyName){ |
|
|
|
|
|
|
|
console.log(bodyi) |
|
|
|
if(arr[bodyi].zdy==undefined){ |
|
|
|
if(arr[bodyi].zdy==undefined){ |
|
|
|
if (surveyName == '进攻通道') { |
|
|
|
if (surveyName == '进攻通道') { |
|
|
|
if (this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr == undefined) { |
|
|
|
if (this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr == undefined) { |
|
|
@ -1415,7 +1416,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
//单位概况自定义表格新增一行
|
|
|
|
//单位概况自定义表格新增一行
|
|
|
|
unitNewadd(...num:number[]){ |
|
|
|
unitNewadd(...num:number[]){ |
|
|
|
console.log(num) |
|
|
|
console.log(num) |
|
|
|
if (this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tableth == undefined) { |
|
|
|
if (this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tableth == undefined||this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tableth.length==0) { |
|
|
|
//this.planTemplateData[key].attribute[i].tabletr = []
|
|
|
|
//this.planTemplateData[key].attribute[i].tabletr = []
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.verticalPosition = 'top'; |
|
|
@ -1591,7 +1592,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
searchType = '0' |
|
|
|
searchType = '0' |
|
|
|
//打开自定义新增具体内容
|
|
|
|
//打开自定义新增具体内容
|
|
|
|
tuTrue=false |
|
|
|
tuTrue=false |
|
|
|
addAttribute(groupName,attacki?:any, i?:any,fileNum?:any,surveyName?:string){ |
|
|
|
addAttribute(groupName,attacki?:any, bi?:any,fileNum?:any,surveyName?:string){ |
|
|
|
let index = this.getArrayIndex(this.planTemplateData,'单位概况') |
|
|
|
let index = this.getArrayIndex(this.planTemplateData,'单位概况') |
|
|
|
const dialogRef = this.dialog.open(disaster, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
const dialogRef = this.dialog.open(disaster, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
width: '340px', |
|
|
|
width: '340px', |
|
|
@ -1600,7 +1601,6 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
data:this.planTemplateData |
|
|
|
data:this.planTemplateData |
|
|
|
}); |
|
|
|
}); |
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
console.log(result) |
|
|
|
|
|
|
|
if(result!=undefined){ |
|
|
|
if(result!=undefined){ |
|
|
|
if(surveyName==undefined){ |
|
|
|
if(surveyName==undefined){ |
|
|
|
this.planTemplateData.forEach((value,index,array)=>{ |
|
|
|
this.planTemplateData.forEach((value,index,array)=>{ |
|
|
@ -1612,10 +1612,10 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
array[index].attribute.push(result) |
|
|
|
array[index].attribute.push(result) |
|
|
|
} |
|
|
|
} |
|
|
|
if(result.level==2){ |
|
|
|
if(result.level==2){ |
|
|
|
for(var i=0;i<result.hNumber;i++){ |
|
|
|
for(let i=0;i<result.hNumber;i++){ |
|
|
|
array[index].attribute[array[index].attribute.length-1].tableth.push([{head:'',body:''}]) |
|
|
|
array[index].attribute[array[index].attribute.length-1].tableth.push([{head:'',body:''}]) |
|
|
|
for(var j=0;j<result.lieNumber-1;j++){ |
|
|
|
for(var j=0;j<result.lieNumber-1;j++){ |
|
|
|
array[index].attribute[array[index].attribute.length-1].tableth[i].push({head:'',body:''}) |
|
|
|
array[index].attribute[array[index].attribute.length-1].tableth[i].push({head:'',body:''}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1623,7 +1623,15 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
this.planTemplateData[index].building[attacki].body[i].attinf.push(result) |
|
|
|
this.planTemplateData[index].building[attacki].body[bi].attinf.push(result) |
|
|
|
|
|
|
|
if(result.level==2){ |
|
|
|
|
|
|
|
for(var i=0;i<result.hNumber;i++){ |
|
|
|
|
|
|
|
this.planTemplateData[index].building[attacki].body[bi].attinf[this.planTemplateData[index].building[attacki].body[bi].attinf.length-1].tableth.push([{head:'',body:''}]) |
|
|
|
|
|
|
|
for(var j=0;j<result.lieNumber-1;j++){ |
|
|
|
|
|
|
|
this.planTemplateData[index].building[attacki].body[bi].attinf[this.planTemplateData[index].building[attacki].body[bi].attinf.length-1].tableth[i].push({head:'',body:''}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(result.level=='4'){ |
|
|
|
if(result.level=='4'){ |
|
|
|
this.tuTrue=true |
|
|
|
this.tuTrue=true |
|
|
@ -1693,11 +1701,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
config.duration = 3000 |
|
|
|
config.duration = 3000 |
|
|
|
let formData = new FormData() |
|
|
|
let formData = new FormData() |
|
|
|
formData.append("file", e.target.files[0]) |
|
|
|
formData.append("file", e.target.files[0]) |
|
|
|
|
|
|
|
let type=this.unitData.buildingTypes[0].name=='高层建筑'?1:2 |
|
|
|
let fileData={ |
|
|
|
let fileData={ |
|
|
|
type:1, |
|
|
|
type:this.unitData.buildingTypes[0].name=='高层建筑'?1:2, |
|
|
|
file:formData |
|
|
|
file:formData |
|
|
|
} |
|
|
|
} |
|
|
|
this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=1`,formData).subscribe((data:any)=>{ |
|
|
|
this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{ |
|
|
|
console.log(data) |
|
|
|
console.log(data) |
|
|
|
if(data==null){ |
|
|
|
if(data==null){ |
|
|
|
this.snackBar.open('解析失败,请确定好格式再重新上传!', '确定', config); |
|
|
|
this.snackBar.open('解析失败,请确定好格式再重新上传!', '确定', config); |
|
|
|