Browse Source

[新增]五级预案在线编制导入按钮增加

tangshan
陈敬瑜 3 years ago
parent
commit
ffcb0e1d23
  1. 139
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  2. 5
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss
  3. 11
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

139
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html

@ -11,6 +11,10 @@
</div> </div>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<button mat-stroked-button *ngIf="zaixianDr" (click)='upload()'>
<mat-icon>play_for_work</mat-icon> 导入
</button>
<input type="file" style="display: none;" id="up" accept=".doc,.docx">
<button mat-stroked-button (click)="preview()"> <button mat-stroked-button (click)="preview()">
<mat-icon>visibility</mat-icon> 预览 <mat-icon>visibility</mat-icon> 预览
</button> </button>
@ -1135,6 +1139,141 @@
</div> </div>
</div> </div>
</div>
<!--自定义新增-->
<div class="centerBox"
*ngIf="element.surveyName!='单位基本信息'&&element.surveyName!='建筑信息'&&element.surveyName!='四周毗邻'&&element.surveyName!='消防设施'&&element.surveyName!='进攻通道'&&element.surveyName!='重点部位'&&element.surveyName!='功能分区'">
<!-- <div class="titleItem" style="width: 100%;
background-color: #2196F3;
text-align: center;
color: white;">
<span>{{element.surveyName}}</span>
</div> -->
<div class="boxBody" *ngFor="let element of element.attinf;let i=index" style="height: 100%;
width: 100%;
display: flex;
flex-direction: column;">
<!-- <div class="boxBodyHead" style="width: 100%;
height: 40pt;
background-color: #FFFBE8;
text-align: center;">
<span style="font-size: 16px;
text-align: center;
height: 40pt;
line-height: 40pt;
color: #b99a00;">{{element.headName}}</span>
<img src="../../../assets/images/deleteblue.png" *ngIf="element.level==1&&pattern == 'edit'"
(click)='delTd(key,i)'>
<img src="../../../assets/images/add.png" *ngIf="element.level==1&&pattern == 'edit'"
(click)='addTd(key,i)'>
</div> -->
<div class="body">
<!--表格类型-->
<table *ngIf="element.level==1" style="width: 100%;border-collapse: collapse;">
<thead *ngIf="pattern == 'edit'">
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn" style="border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center;">
<input type="text" placeholder="请输入内容"
[(ngModel)]="element.tableth[tablethi]" >
</th>
</thead>
<thead *ngIf="pattern == 'look'">
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn" style="border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center;" >
{{element.tableth[tablethi]}}
<!-- <textarea [value]="element.tableth[tablethi]" disabled style="width: 100%;height: 100%;"></textarea> -->
</th>
</thead>
<tbody *ngIf="pattern == 'edit'">
<tr *ngFor="let itemtr of element.tabletr">
<td
*ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入"
[(ngModel)]="itemtr.tabletd[tabletdi]">
</td>
</tr>
</tbody>
<tbody *ngIf="pattern == 'look'">
<tr *ngFor="let itemtr of element.tabletr">
<td *ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn" style="border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center;">
{{itemtr.tabletd[tabletdi]}}
</td>
</tr>
</tbody>
</table>
<!--文本区域-->
<textarea style="width: 99%;height: 100px;" *ngIf="element.level==3&&pattern == 'edit'"
[(ngModel)]="element.tableth"></textarea>
<div style="height: 100px;width: 98%; border: 1px solid #000000;" *ngIf="element.level==3&&pattern == 'look'">{{element.tableth||''}}</div>
<!--输入框-->
<div class="inputtext" *ngIf="element.level==2">
<div class="inputj" style="height: 100%;width: 100%;"
*ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn">
<div style="height: 100%;width: 100%;"
*ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入内容"
style="background-color: #E8E9E9;width: 40%;"
[(ngModel)]="itemthj.head" *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容" style="width: 60%;"
[(ngModel)]="itemthj.body" *ngIf="pattern == 'edit'">
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center; white-space:pre-wrap; width: 185px;">
{{itemthj.head}}
</th>
<td style="border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center;white-space:pre-wrap;width: 185px;">
{{itemthj.body}}
</td>
</tr>
</table>
</div>
</div>
</div>
<!--树形图-->
<!-- <div style="height: 300px;width: 100%;" *ngIf="element.level==4">
<tree-diagram [data]="element.tableth"></tree-diagram>
</div> -->
<div class="keyImg" *ngIf="element.level==4">
<div class="keyImgImg">
<div style="margin-top: 10px;
text-align: center;
position: relative;" class="imgbox" *ngFor="let imgUrl of element.tableth.json;let imgkey = index">
<mat-icon *ngIf="pattern == 'edit'" class="deleteImg"
(click)="deleteImgItem(element.tableth.json,imgkey)">delete
</mat-icon>
<img style="max-width: 100%;
width: auto;
height: auto;" [src]="imgUrl" alt="">
</div>
<div class="uploadBtn" *ngIf="pattern == 'edit'&&element.tableth.json.length<=0">
<button mat-stroked-button>
<mat-icon>add</mat-icon>上传图片
</button>
<input (change)="filechange($event,element)" type="file" name="" id="">
</div>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

5
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss

@ -58,6 +58,11 @@
position: absolute; position: absolute;
right: 24px; right: 24px;
top: 7px; top: 7px;
input {
width: 100%;
height: 22px;
line-height: 22px;
border-radius: 3px;}
button { button {
margin-left: 10px; margin-left: 10px;
mat-icon { mat-icon {

11
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

@ -56,6 +56,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
planLevel: string//预案级别 planLevel: string//预案级别
blockyl = true blockyl = true
zaixianDr=false
ngOnInit(): void { ngOnInit(): void {
this.planLevel = this.route.snapshot.queryParams.planCategory this.planLevel = this.route.snapshot.queryParams.planCategory
if (this.route.snapshot.queryParams.pattern == 'false') { if (this.route.snapshot.queryParams.pattern == 'false') {
@ -157,6 +158,9 @@ 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'){
this.zaixianDr=true
}
//console.log('单位列表信息', this.unitData) //console.log('单位列表信息', this.unitData)
this.getTemplateData() this.getTemplateData()
} }
@ -343,6 +347,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
//console.log(this.buildZong) //console.log(this.buildZong)
let index = this.getArrayIndex(this.planTemplateData,'单位概况') let index = this.getArrayIndex(this.planTemplateData,'单位概况')
this.planTemplateData[index].building.forEach(element => { 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[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[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[2].value = element.body[0].attinf[2].olddata = this.unitData.contacts
@ -360,6 +365,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}); });
}); });
} }
}
}); });
@ -1480,6 +1487,10 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
showTu(key){ showTu(key){
this.planTemplateData[key].new=true this.planTemplateData[key].new=true
} }
//上传
upload() {
document.getElementById('up').click()
}
} }

Loading…
Cancel
Save