Browse Source

[新增]报表查询和预案级别修改

guangxi
邵佳豪 2 years ago
parent
commit
fbe5cdc154
  1. 462
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  2. 3345
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  3. 18
      src/app/plan-management/entry-plan-look/edit-plan-category/edit-plan-category.component.html
  4. 0
      src/app/plan-management/entry-plan-look/edit-plan-category/edit-plan-category.component.scss
  5. 25
      src/app/plan-management/entry-plan-look/edit-plan-category/edit-plan-category.component.spec.ts
  6. 37
      src/app/plan-management/entry-plan-look/edit-plan-category/edit-plan-category.component.ts
  7. 5
      src/app/plan-management/entry-plan-look/entry-plan-look.component.html
  8. 57
      src/app/plan-management/entry-plan-look/entry-plan-look.component.scss
  9. 18
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  10. 5
      src/app/plan-management/plan-management.module.ts
  11. 18
      src/app/statistic-analysis/combined-query/combined-query.component.html
  12. 703
      src/app/statistic-analysis/combined-query/combined-query.component.ts

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

@ -1,13 +1,17 @@
<div class="bigbox"> <div class="bigbox">
<div class="titlebox" *ngIf="pattern == 'edit'"> <div class="titlebox" *ngIf="pattern == 'edit'">
<div class="titleitembox" cdkDropList cdkDropListOrientation="horizontal" (cdkDropListDropped)="drop($event)"> <div class="titleitembox" cdkDropList cdkDropListOrientation="horizontal" (cdkDropListDropped)="drop($event)">
<div cdkDrag class="item" *ngFor="let item of planTemplateData;let key = index" (click)="clickTitleItem(item)" <div cdkDrag class="item" *ngFor="let item of planTemplateData;let key = index"
[ngClass]="{'selectedItem': selectedItem == item.groupName||item.groupName=='新建'}" [title]="item.groupName" (click)="clickTitleItem(item)"
[cdkDragDisabled]="item.groupName == '封面'" [style.display]="item.completed==true?'block':'none'"> [ngClass]="{'selectedItem': selectedItem == item.groupName||item.groupName=='新建'}"
[title]="item.groupName" [cdkDragDisabled]="item.groupName == '封面'"
[style.display]="item.completed==true?'block':'none'">
<img src="../../../assets/images/add.png" *ngIf="item.groupName=='新建'"> <img src="../../../assets/images/add.png" *ngIf="item.groupName=='新建'">
{{item.groupName!='新建'?key + 1:''}}.{{item.groupName}} {{item.groupName!='新建'?key + 1:''}}.{{item.groupName}}
<img style="height: 38%;" src="../../../assets/images/update.png" *ngIf="item.new!=undefined" (click)='upName(key,item.groupName)' > <img style="height: 38%;" src="../../../assets/images/update.png" *ngIf="item.new!=undefined"
<img style="height: 38%;margin-left: 2px;" src="../../../assets/images/deleteblue.png" *ngIf="item.new!=undefined" (click)='delName(key)' > (click)='upName(key,item.groupName)'>
<img style="height: 38%;margin-left: 2px;" src="../../../assets/images/deleteblue.png"
*ngIf="item.new!=undefined" (click)='delName(key)'>
</div> </div>
</div> </div>
<div class="btnbox"> <div class="btnbox">
@ -32,7 +36,8 @@
</div> </div>
<div class="leftbox" <div class="leftbox"
*ngIf="pattern == 'edit' && (selectedItem == '重点图示' || selectedItem == '交通水源' || selectedItem == '预案附件' || selectedItem == '单位概况')||(selectedItem!='灾情设定'&&selectedItem!='力量调集'&&selectedItem!='组织指挥'&&selectedItem!='作战行动'&&selectedItem!='社会联动'&&selectedItem!='勤务保障'&&selectedItem!='特别警示'&&selectedItem!='辅助决策'&&selectedItem!='处置要点'&&tuTrue)"> *ngIf="pattern == 'edit' && (selectedItem == '重点图示' || selectedItem == '交通水源' || selectedItem == '预案附件' || selectedItem == '单位概况')||(selectedItem!='灾情设定'&&selectedItem!='力量调集'&&selectedItem!='组织指挥'&&selectedItem!='作战行动'&&selectedItem!='社会联动'&&selectedItem!='勤务保障'&&selectedItem!='特别警示'&&selectedItem!='辅助决策'&&selectedItem!='处置要点'&&tuTrue)">
<div *ngIf="selectedItem == '重点图示'||(selectedItem!='灾情设定'&&selectedItem!='力量调集'&&selectedItem!='组织指挥'&&selectedItem!='作战行动'&&selectedItem!='社会联动'&&selectedItem!='勤务保障'&&selectedItem!='特别警示'&&selectedItem!='辅助决策'&&selectedItem!='处置要点'&&tuTrue)" class="leftKeyImg"> <div *ngIf="selectedItem == '重点图示'||(selectedItem!='灾情设定'&&selectedItem!='力量调集'&&selectedItem!='组织指挥'&&selectedItem!='作战行动'&&selectedItem!='社会联动'&&selectedItem!='勤务保障'&&selectedItem!='特别警示'&&selectedItem!='辅助决策'&&selectedItem!='处置要点'&&tuTrue)"
class="leftKeyImg">
<div class="keyImgTitle"> <div class="keyImgTitle">
重点图示 重点图示
</div> </div>
@ -193,7 +198,8 @@
</div> </div>
</div> </div>
<div class="leftnew" *ngIf="pattern == 'edit' && ( selectedItem == '组织指挥' || selectedItem == '社会联动' || selectedItem == '勤务保障'|| selectedItem == '辅助决策')"> <div class="leftnew"
*ngIf="pattern == 'edit' && ( selectedItem == '组织指挥' || selectedItem == '社会联动' || selectedItem == '勤务保障'|| selectedItem == '辅助决策')">
<div class="newHead"> <div class="newHead">
<span>模板列表</span> <span>模板列表</span>
</div> </div>
@ -207,20 +213,20 @@
</div> </div>
<div class="searchText"> <div class="searchText">
<div class="queryField ordiv" *ngIf="searchType=='1'"> <div class="queryField ordiv" *ngIf="searchType=='1'">
<input readonly placeholder="请输入组织" autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()"> <input readonly placeholder="请输入组织" autocomplete="off" [(ngModel)]="js" name="js"
(focus)="openorganizationbox()">
<!-- <mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox> --> <!-- <mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox> -->
<div class="organizationbox" *ngIf="isorganizationbox"> <div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div> <div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl"> <mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist"> <mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)'
class="organizationlist">
<button type="button" mat-icon-button disabled></button> <button type="button" mat-icon-button disabled></button>
<li>{{node.name}}</li> <li>{{node.name}}</li>
</mat-tree-node> </mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist"> <mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding
<button (click)='add(node)' class="organizationlist">
type="button" <button type="button" mat-icon-button matTreeNodeToggle
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name"> [attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror"> <mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}} {{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
@ -254,9 +260,7 @@
</div> </div>
<div class="fenye"> <div class="fenye">
<mat-paginator pageEvent [length]="length" <mat-paginator pageEvent [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="changePage($event)"> (page)="changePage($event)">
</mat-paginator> </mat-paginator>
@ -433,13 +437,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="centerBox" <div class="centerBox"
*ngIf="item.groupName!='单位概况'&&item.groupName!='交通水源'&&item.groupName!='重点图示'&&item.groupName!='预案附件'&&item.groupName!='封面'"> *ngIf="item.groupName!='单位概况'&&item.groupName!='交通水源'&&item.groupName!='重点图示'&&item.groupName!='预案附件'&&item.groupName!='封面'">
<div class="titleItem"> <div class="titleItem">
<span *ngIf="item.new==undefined">{{item.groupName}}</span> <span *ngIf="item.new==undefined">{{item.groupName}}</span>
<input type="text" placeholder="请输入内容" [(ngModel)]="item.headName" *ngIf="item.new!=undefined&&pattern == 'edit'"> <input type="text" placeholder="请输入内容" [(ngModel)]="item.headName"
*ngIf="item.new!=undefined&&pattern == 'edit'">
<span *ngIf="item.new!=undefined&&pattern != 'edit'">{{item.headName}}</span> <span *ngIf="item.new!=undefined&&pattern != 'edit'">{{item.headName}}</span>
<img src="../../../assets/images/add.png" (click)='addAttribute(item.groupName)' *ngIf="pattern == 'edit'&&item.new!=undefined"> <img src="../../../assets/images/add.png" (click)='addAttribute(item.groupName)'
*ngIf="pattern == 'edit'&&item.new!=undefined">
</div> </div>
<div class="boxBody" *ngFor="let element of item.attribute;let i=index" style="height: 100%; <div class="boxBody" *ngFor="let element of item.attribute;let i=index" style="height: 100%;
@ -455,17 +464,25 @@
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
color: #b99a00;">{{element.headName}}</span> color: #b99a00;">{{element.headName}}</span>
<img src="../../../assets/images/delyello.png" *ngIf="pattern == 'edit'" (click)='delTd(key,i)'> <img src="../../../assets/images/delyello.png" *ngIf="pattern == 'edit'"
<img src="../../../assets/images/downyello.png" *ngIf="item.new!=undefined&&i<item.attribute.length-1&&pattern == 'edit'" (click)='downPai(key,i)'> (click)='delTd(key,i)'>
<img src="../../../assets/images/uoyello.png" *ngIf="item.new!=undefined&&i>0 &&pattern == 'edit'" (click)='upPai(key,i)'> <img src="../../../assets/images/downyello.png"
<img src="../../../assets/images/updateyello.png" *ngIf="(element.level==1||element.level==2)&&pattern == 'edit'" (click)='updataHl(key,i)'> *ngIf="item.new!=undefined&&i<item.attribute.length-1&&pattern == 'edit'"
<img src="../../../assets/images/addyello.png" *ngIf="element.level==1&&pattern == 'edit'" (click)='addTd(key,i)'> (click)='downPai(key,i)'>
<img src="../../../assets/images/uoyello.png"
*ngIf="item.new!=undefined&&i>0 &&pattern == 'edit'" (click)='upPai(key,i)'>
<img src="../../../assets/images/updateyello.png"
*ngIf="(element.level==1||element.level==2)&&pattern == 'edit'"
(click)='updataHl(key,i)'>
<img src="../../../assets/images/addyello.png"
*ngIf="element.level==1&&pattern == 'edit'" (click)='addTd(key,i)'>
</div> </div>
<div class="body"> <div class="body">
<!--表格类型--> <!--表格类型-->
<table *ngIf="element.level==1" style="width: 100%;border-collapse: collapse;"> <table *ngIf="element.level==1" style="width: 100%;border-collapse: collapse;">
<thead *ngIf="pattern == 'edit'"> <thead *ngIf="pattern == 'edit'">
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn" style="border: 1px solid #999; <th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn"
style="border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; font-size: 16px;
text-align: center;"> text-align: center;">
@ -474,7 +491,8 @@
</th> </th>
</thead> </thead>
<thead *ngIf="pattern == 'look'"> <thead *ngIf="pattern == 'look'">
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn" style="border: 1px solid #999; <th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn"
style="border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; font-size: 16px;
text-align: center;"> text-align: center;">
@ -496,7 +514,8 @@
</tbody> </tbody>
<tbody *ngIf="pattern == 'look'"> <tbody *ngIf="pattern == 'look'">
<tr *ngFor="let itemtr of element.tabletr"> <tr *ngFor="let itemtr of element.tabletr">
<td *ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn" style="border: 1px solid #999; <td *ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn"
style="border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; font-size: 16px;
text-align: center;"> text-align: center;">
@ -508,7 +527,8 @@
<!--文本区域--> <!--文本区域-->
<textarea style="width: 99%;height: 100px;" *ngIf="element.level==3&&pattern == 'edit'" <textarea style="width: 99%;height: 100px;" *ngIf="element.level==3&&pattern == 'edit'"
[(ngModel)]="element.tableth"></textarea> [(ngModel)]="element.tableth"></textarea>
<div style="height: 100px;width: 98%; border: 1px solid #000000;" *ngIf="element.level==3&&pattern == 'look'">{{element.tableth||''}}</div> <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="inputtext" *ngIf="element.level==2">
<div class="inputj" style="height: 100%;width: 100%;" <div class="inputj" style="height: 100%;width: 100%;"
@ -516,8 +536,8 @@
<div style="height: 100%;width: 100%;" <div style="height: 100%;width: 100%;"
*ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn"> *ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入内容" <input type="text" placeholder="请输入内容"
style="background-color: #E8E9E9;width: 40%;" style="background-color: #E8E9E9;width: 40%;" [(ngModel)]="itemthj.head"
[(ngModel)]="itemthj.head" *ngIf="pattern == 'edit'"> *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容" style="width: 60%;" <input type="text" placeholder="请输入内容" style="width: 60%;"
[(ngModel)]="itemthj.body" *ngIf="pattern == 'edit'"> [(ngModel)]="itemthj.body" *ngIf="pattern == 'edit'">
@ -530,7 +550,8 @@
<td style="border: 1px solid #999; <td style="border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; font-size: 16px;
text-align: center; white-space:pre-wrap; width: 185px;" *ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn"> text-align: center; white-space:pre-wrap; width: 185px;"
*ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn">
<span>{{itemthj.head}}</span> <span>{{itemthj.head}}</span>
<span>{{itemthj.body}}</span> <span>{{itemthj.body}}</span>
</td> </td>
@ -553,7 +574,8 @@
<div class="keyImgImg"> <div class="keyImgImg">
<div style="margin-top: 10px; <div style="margin-top: 10px;
text-align: center; text-align: center;
position: relative;" class="imgbox" *ngFor="let imgUrl of element.tableth.json;let imgkey = index"> position: relative;" class="imgbox"
*ngFor="let imgUrl of element.tableth.json;let imgkey = index">
<mat-icon *ngIf="pattern == 'edit'" class="deleteImg" <mat-icon *ngIf="pattern == 'edit'" class="deleteImg"
(click)="deleteImgItem(element.tableth.json,imgkey)">delete (click)="deleteImgItem(element.tableth.json,imgkey)">delete
</mat-icon> </mat-icon>
@ -561,83 +583,8 @@
width: auto; width: auto;
height: auto;" [src]="imgUrl" alt=""> height: auto;" [src]="imgUrl" alt="">
</div> </div>
<div class="uploadBtn" *ngIf="pattern == 'edit'&&element.tableth.json.length<=0"> <div class="uploadBtn"
<button mat-stroked-button> *ngIf="pattern == 'edit'&&element.tableth.json.length<=0">
<mat-icon>add</mat-icon>上传图片
</button>
<input (change)="filechange($event,element)" type="file" name="" id="">
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <div class="centerBox" *ngIf="item.new!=undefined">
<div class="titleItem" >
<input type="text" placeholder="请输入内容" [(ngModel)]="item.headName">
<img src="../../../assets/images/add.png" (click)='addAttribute(item.groupName,key)' *ngIf="pattern == 'edit'">
</div>
<div class="attack" *ngFor="let element of item.attribute;let attributei=index">
<div class="attackLeft" [style.width]="pattern == 'edit'?'70%':'100%'">
<div class="attackleftHead">
<input type="text" placeholder="请输入内容" [(ngModel)]="element.headName">
<img src="../../../assets/images/delyello.png" *ngIf="element.level==1&&pattern == 'edit'"
(click)='delTd(key,attributei)'>
<img src="../../../assets/images/addyello.png" *ngIf="element.level==1&&pattern == 'edit'"
(click)='addTd(key,attributei)' style="margin-left: 6px;">
</div>
<div class="attackleftTable">
<table *ngIf="element.level==1">
<thead>
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn"><input type="text"
placeholder="请输入内容" [(ngModel)]="element.tableth[tablethi]"></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>
</table>
<textarea *ngIf="element.level==3" [(ngModel)]="element.tableth"></textarea>
<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">
<input type="text" placeholder="请输入内容" style="width: 60%;" [(ngModel)]="itemthj.body">
</div>
</div>
</div>
<div style="height: 100%;width: 100%;" *ngIf="element.level==4">
<div class="keyImg">
<div style="border: 1px solid #e8e9e9;width: 100%;" class="keyImgItem">
<div class="keyImgTitle" style="height: 30px;
position: relative;">
</div>
<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)="delImg(key,attributei,imgkey)">delete
</mat-icon>
<img style="max-width: 100%;
width: auto;
height: auto;" [src]="imgUrl" alt="">
</div>
<div class="uploadBtn" *ngIf="pattern == 'edit'">
<button mat-stroked-button> <button mat-stroked-button>
<mat-icon>add</mat-icon>上传图片 <mat-icon>add</mat-icon>上传图片
</button> </button>
@ -649,19 +596,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="attackRight" *ngIf="pattern == 'edit'">
<div class="rightButton">
<button mat-raised-button color="primary" (click)='attackAdd(item.groupName,attributei,element.level)'
*ngIf="element.level==1"><img src="../../../assets/images/addbai.png"> 新增</button>
<button mat-raised-button color="#ECF6FF" style="margin-left: 10px;"
(click)='delDisaster(item.groupName,attributei)'><img src="../../../assets/images/deletehui.png">
删除</button>
</div>
</div>
</div>
</div> -->
<div class="keyImg" <div class="keyImg"
*ngIf="item.groupName == '重点图示' || item.groupName == '交通水源' || item.groupName == '预案附件'"> *ngIf="item.groupName == '重点图示' || item.groupName == '交通水源' || item.groupName == '预案附件'">
@ -678,16 +612,16 @@
border: 0; border: 0;
box-sizing: border-box; box-sizing: border-box;
padding: 0 5px;"> {{ i.name }} </div> padding: 0 5px;"> {{ i.name }} </div>
<img src="../../../assets/images/deletered.png" class="deleteItem" *ngIf="key != 0 && pattern == 'edit'" <img src="../../../assets/images/deletered.png" class="deleteItem"
(click)="deleteItem(item,key)" /> *ngIf="key != 0 && pattern == 'edit'" (click)="deleteItem(item,key)" />
</div> </div>
<div class="keyImgImg"> <div class="keyImgImg">
<div style="margin-top: 10px; <div style="margin-top: 10px;
text-align: center; text-align: center;
position: relative;" class="imgbox" *ngFor="let imgUrl of i.imgArr;let imgkey = index"> position: relative;" class="imgbox" *ngFor="let imgUrl of i.imgArr;let imgkey = index">
<img src="../../../assets/images/deletered.png" *ngIf="pattern == 'edit'" class="deleteImg" <img src="../../../assets/images/deletered.png" *ngIf="pattern == 'edit'"
(click)="deleteImgItem(i.imgArr,imgkey)"/> class="deleteImg" (click)="deleteImgItem(i.imgArr,imgkey)" />
<img style="max-width: 100%; <img style="max-width: 100%;
width: auto; width: auto;
@ -709,7 +643,8 @@
</div> </div>
</div> </div>
<div class="unit" *ngIf="item.groupName == '单位概况'"> <div class="unit" *ngIf="item.groupName == '单位概况'">
<div *ngFor="let itemunit of item.building;let uniti=index"> <!-- style="border-bottom: 3px solid #999;" --> <div *ngFor="let itemunit of item.building;let uniti=index">
<!-- style="border-bottom: 3px solid #999;" -->
<div *ngIf="itemunit.completed"> <div *ngIf="itemunit.completed">
<div class="unithead" style=" height: 40px; <div class="unithead" style=" height: 40px;
width: 100%; width: 100%;
@ -720,8 +655,10 @@
opacity: 1; opacity: 1;
height: 40px; height: 40px;
line-height: 40px;">{{itemunit.name}}</span> line-height: 40px;">{{itemunit.name}}</span>
<img src="../../../assets/images/update.png" *ngIf="planMode==4&&pattern == 'edit'" (click)='unitZdyaaa()'> <img src="../../../assets/images/update.png" *ngIf="planMode==4&&pattern == 'edit'"
<span style="float: right;margin-right: 30px;cursor: pointer;" *ngIf="planMode==4&&pattern == 'edit'" (click)='zdyDw()'>自定义</span> (click)='unitZdyaaa()'>
<span style="float: right;margin-right: 30px;cursor: pointer;"
*ngIf="planMode==4&&pattern == 'edit'" (click)='zdyDw()'>自定义</span>
</div> </div>
<div class="unitbody" *ngFor="let element of itemunit.body;let elei=index" style=" height: 100%; <div class="unitbody" *ngFor="let element of itemunit.body;let elei=index" style=" height: 100%;
width: 100%; width: 100%;
@ -738,10 +675,14 @@
line-height: 40px; line-height: 40px;
color: #ffffff;">{{element.surveyName}}</span> color: #ffffff;">{{element.surveyName}}</span>
<!-- <img src="../../../assets/images/deletered.png" > --> <!-- <img src="../../../assets/images/deletered.png" > -->
<img src="../../../assets/images/delyello.png" *ngIf="haveNew!=undefined&&pattern == 'edit'"> <img src="../../../assets/images/delyello.png"
<img src="../../../assets/images/updatabai.png" (click)='addBuildingmb(element)' *ngIf="planMode==4&&pattern == 'edit'&&(element.surveyName=='建筑信息'||element.surveyName=='消防设施')"> *ngIf="haveNew!=undefined&&pattern == 'edit'">
<img src="../../../assets/images/updatabai.png"
(click)='addBuildingmb(element)'
*ngIf="planMode==4&&pattern == 'edit'&&(element.surveyName=='建筑信息'||element.surveyName=='消防设施')">
<img src="../../../assets/images/addbai.png" <img src="../../../assets/images/addbai.png"
(click)='unitadd(element.surveyName,uniti,elei)' *ngIf="pattern == 'edit'"> (click)='unitadd(element.surveyName,uniti,elei)'
*ngIf="pattern == 'edit'">
</div> </div>
<div class="body"> <div class="body">
@ -757,7 +698,8 @@
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
color: #b99a00;">{{attack.head}}</span> color: #b99a00;">{{attack.head}}</span>
<img src="../../../assets/images/deleteblue.png" *ngIf="pattern == 'edit'" <img src="../../../assets/images/deleteblue.png"
*ngIf="pattern == 'edit'"
(click)='unitDel(element.surveyName,uniti,attacki)'> (click)='unitDel(element.surveyName,uniti,attacki)'>
<img src="../../../assets/images/add.png" <img src="../../../assets/images/add.png"
*ngIf="pattern == 'edit'" *ngIf="pattern == 'edit'"
@ -777,7 +719,8 @@
height: 40px; height: 40px;
font-size: 16px; font-size: 16px;
text-align: center;" text-align: center;"
*ngFor="let itemth of attack.tableth;let tablethi=index;TrackBy:trackByFn">{{attack.tableth[tablethi]}}</th> *ngFor="let itemth of attack.tableth;let tablethi=index;TrackBy:trackByFn">
{{attack.tableth[tablethi]}}</th>
</thead> </thead>
<tbody *ngIf="pattern == 'edit'"> <tbody *ngIf="pattern == 'edit'">
<tr *ngFor="let itemtr of attack.tabletr"> <tr *ngFor="let itemtr of attack.tabletr">
@ -803,35 +746,48 @@
</table> </table>
</div> </div>
</div> </div>
</div> </div>
<!-- 单位和建筑信息 --> <!-- 单位和建筑信息 -->
<div class="building" *ngIf="element.surveyName=='单位基本信息'||element.surveyName=='建筑信息'"> <div class="building"
*ngIf="element.surveyName=='单位基本信息'||element.surveyName=='建筑信息'">
<div *ngFor="let info of element.attinf;let infoi=index"> <div *ngFor="let info of element.attinf;let infoi=index">
<div *ngIf="info.completed&&pattern != 'look'" class="onetext"> <div *ngIf="info.completed&&pattern != 'look'" class="onetext">
<input type="text" placeholder="请输入内容" style="width: 30%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="info.propertyName" *ngIf="pattern == 'edit'" [readonly]='info.zdy==undefined'> <input type="text" placeholder="请输入内容"
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #FFFFFF;" [(ngModel)]="info.propertyValue" *ngIf="pattern == 'edit'"> style="width: 30%;background-color: #F9F9F9;text-align: center;"
<!-- <input type="text" style="width: 30%;background-color: #FFFFFF;color: #999;" [(ngModel)]="info.olddata" *ngIf="pattern == 'edit'&&oldData" readonly> --> [(ngModel)]="info.propertyName" *ngIf="pattern == 'edit'"
<!-- <span style="width: 30%;background-color: #FFFFFF;color: #999;" *ngIf="pattern == 'edit'&&oldData">{{info.olddata||'无原数据'}}</span> --> [readonly]='info.zdy==undefined'>
<input type="text" style="width: 27%;background-color: #FFFFFF;color: #999;" *ngIf="pattern == 'edit'&&oldData" [value]="info.olddata||'无原数据'" readonly> <input type="text" placeholder="请输入内容"
<img style="float: right;" src="../../../assets/images/deletered.png" *ngIf="pattern == 'edit'&&info.zdy" (click)='unitDel(element.surveyName,uniti,infoi)'> style="width: 40%;background-color: #FFFFFF;"
[(ngModel)]="info.propertyValue" *ngIf="pattern == 'edit'">
<input type="text"
style="width: 27%;background-color: #FFFFFF;color: #999;"
*ngIf="pattern == 'edit'&&oldData"
[value]="info.olddata||'无原数据'" readonly>
<img style="float: right;"
src="../../../assets/images/deletered.png"
*ngIf="pattern == 'edit'&&info.zdy"
(click)='unitDel(element.surveyName,uniti,infoi)'>
</div> </div>
</div> </div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;"> <table *ngIf="pattern == 'look'"
style="width: 100%;border-collapse: collapse;">
<tr *ngFor="let info of element.attinf;let infoi=index"> <tr *ngFor="let info of element.attinf;let infoi=index">
<th style="border: 1px solid #999; <th style="border: 1px solid #999;
height: 40px; height: 40px;
width: 30%; width: 30%;
font-size: 16px; font-size: 16px;
text-align: center;" *ngIf="info.completed"><span>{{info.propertyName}}</span></th> text-align: center;" *ngIf="info.completed">
<span>{{info.propertyName}}</span>
</th>
<td style="border: 1px solid #999; <td style="border: 1px solid #999;
height: 40px; height: 40px;
width: 70%; width: 70%;
font-size: 16px; font-size: 16px;
text-align: center;"*ngIf="info.completed"><span>{{info.propertyValue}}</span> </td> text-align: center;" *ngIf="info.completed">
<span>{{info.propertyValue}}</span>
</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -843,36 +799,59 @@
width: 100%; width: 100%;
background-color: #FFFBE8; background-color: #FFFBE8;
text-align: center;"> text-align: center;">
<input type="text" placeholder="请输入内容" [(ngModel)]="attack.name" [readonly]='attack.zdy==undefined' *ngIf="pattern == 'edit'"> <input type="text" placeholder="请输入内容"
<span style=" margin-left: 20px;font-size: 16px;color: #b99a00;opacity: 1;height: 40px;line-height: 40px;" *ngIf="pattern != 'edit'">{{attack.name}}</span> [(ngModel)]="attack.name"
<img src="../../../assets/images/delyello.png" *ngIf="pattern == 'edit'" [readonly]='attack.zdy==undefined'
*ngIf="pattern == 'edit'">
<span
style=" margin-left: 20px;font-size: 16px;color: #b99a00;opacity: 1;height: 40px;line-height: 40px;"
*ngIf="pattern != 'edit'">{{attack.name}}</span>
<img src="../../../assets/images/delyello.png"
*ngIf="pattern == 'edit'"
(click)='unitDel(element.surveyName,uniti,attacki)'> (click)='unitDel(element.surveyName,uniti,attacki)'>
<img src="../../../assets/images/addyello.png" <img src="../../../assets/images/addyello.png"
*ngIf="pattern == 'edit'" *ngIf="pattern == 'edit'"
(click)='unitadd(element.surveyName,uniti,attacki,0)'><!-- &&attack.zdy!=undefined --> (click)='unitadd(element.surveyName,uniti,attacki,0)'><!-- &&attack.zdy!=undefined -->
<img src="../../../assets/images/updateyello.png" (click)='fileAdd(attack.facilityItems,attacki,attack.name)' *ngIf="pattern == 'edit'&&attack.zdy==undefined"> <img src="../../../assets/images/updateyello.png"
(click)='fileAdd(attack.facilityItems,attacki,attack.name)'
*ngIf="pattern == 'edit'&&attack.zdy==undefined">
</div> </div>
<div class="fileBody"> <div class="fileBody">
<div *ngFor="let info of attack.facilityItems;let filenum=index"> <div
<div *ngIf="info.completed&&pattern != 'look'" class="onetext"> *ngFor="let info of attack.facilityItems;let filenum=index">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="info.name" *ngIf="pattern == 'edit'" [readonly]='info.zdy==undefined'> <div *ngIf="info.completed&&pattern != 'look'"
<input type="text" placeholder="请输入内容" style="width: 57%;background-color: #FFFFFF;" [(ngModel)]="info.value" *ngIf="pattern == 'edit'"> class="onetext">
<img src="../../../assets/images/deletered.png" *ngIf="pattern == 'edit'&&info.zdy" (click)='unitDel(element.surveyName,uniti,attacki,filenum)'> <input type="text" placeholder="请输入内容"
style="width: 40%;background-color: #F9F9F9;text-align: center;"
[(ngModel)]="info.name"
*ngIf="pattern == 'edit'"
[readonly]='info.zdy==undefined'>
<input type="text" placeholder="请输入内容"
style="width: 57%;background-color: #FFFFFF;"
[(ngModel)]="info.value"
*ngIf="pattern == 'edit'">
<img src="../../../assets/images/deletered.png"
*ngIf="pattern == 'edit'&&info.zdy"
(click)='unitDel(element.surveyName,uniti,attacki,filenum)'>
</div> </div>
</div> </div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;"> <table *ngIf="pattern == 'look'"
<tr *ngFor="let info of attack.facilityItems;let filenum=index"> style="width: 100%;border-collapse: collapse;">
<tr
*ngFor="let info of attack.facilityItems;let filenum=index">
<th style="border: 1px solid #999; <th style="border: 1px solid #999;
height: 40px; height: 40px;
width: 40%; width: 40%;
font-size: 16px; font-size: 16px;
text-align: center;" *ngIf="info.completed">{{info.name}}</th> text-align: center;" *ngIf="info.completed">
{{info.name}}</th>
<td style="border: 1px solid #999; <td style="border: 1px solid #999;
height: 40px; height: 40px;
width: 60%; width: 60%;
font-size: 16px; font-size: 16px;
text-align: center;" *ngIf="info.completed">{{info.value}}</td> text-align: center;" *ngIf="info.completed">
{{info.value}}</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -884,15 +863,25 @@
<!-- 四周毗邻 --> <!-- 四周毗邻 -->
<div *ngIf="element.surveyName=='四周毗邻'"> <div *ngIf="element.surveyName=='四周毗邻'">
<div class="fouradj" *ngIf="pattern != 'look'"> <div class="fouradj" *ngIf="pattern != 'look'">
<div class="fourTexttwo" *ngFor="let info of element.attinf;let infoi=index"> <div class="fourTexttwo"
<input type="text" placeholder="请输入内容" style="width: 30%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="info.name" *ngIf="pattern == 'edit'" [readonly]='info.zdy==undefined'> *ngFor="let info of element.attinf;let infoi=index">
<input type="text" placeholder="请输入内容" style="width: 65%;background-color: #FFFFFF;" [(ngModel)]="info.value" *ngIf="pattern == 'edit'"> <input type="text" placeholder="请输入内容"
<img style="position: relative;bottom: 30px;left: 347px;" src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'&&info.zdy"> style="width: 30%;background-color: #F9F9F9;text-align: center;"
[(ngModel)]="info.name" *ngIf="pattern == 'edit'"
[readonly]='info.zdy==undefined'>
<input type="text" placeholder="请输入内容"
style="width: 65%;background-color: #FFFFFF;"
[(ngModel)]="info.value" *ngIf="pattern == 'edit'">
<img style="position: relative;bottom: 30px;left: 347px;"
src="../../../assets/images/deletered.png"
(click)='unitDel(element.surveyName,uniti,infoi)'
*ngIf="pattern == 'edit'&&info.zdy">
</div> </div>
</div> </div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;"> <table *ngIf="pattern == 'look'"
style="width: 100%;border-collapse: collapse;">
<tr *ngFor="let info of element.attinf;let infoi=index"> <tr *ngFor="let info of element.attinf;let infoi=index">
<th style="border: 1px solid #999; <th style="border: 1px solid #999;
height: 40px; height: 40px;
@ -910,15 +899,23 @@
<!-- 功能分区 --> <!-- 功能分区 -->
<div *ngIf="element.surveyName=='功能分区'"> <div *ngIf="element.surveyName=='功能分区'">
<div class="fouradj" *ngIf="pattern != 'look'"> <div class="fouradj" *ngIf="pattern != 'look'">
<div class="onetext" *ngFor="let info of element.attinf;let infoi=index"> <div class="onetext"
<input type="text" placeholder="请输入内容" style="width: 30%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="info.name" *ngIf="pattern == 'edit'"> *ngFor="let info of element.attinf;let infoi=index">
<input type="text" placeholder="请输入内容" style="width: 67%;background-color: #FFFFFF;" [(ngModel)]="info.value" *ngIf="pattern == 'edit'"> <input type="text" placeholder="请输入内容"
<img src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'"> style="width: 30%;background-color: #F9F9F9;text-align: center;"
[(ngModel)]="info.name" *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容"
style="width: 67%;background-color: #FFFFFF;"
[(ngModel)]="info.value" *ngIf="pattern == 'edit'">
<img src="../../../assets/images/deletered.png"
(click)='unitDel(element.surveyName,uniti,infoi)'
*ngIf="pattern == 'edit'">
</div> </div>
</div> </div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;"> <table *ngIf="pattern == 'look'"
style="width: 100%;border-collapse: collapse;">
<tr *ngFor="let info of element.attinf;let infoi=index"> <tr *ngFor="let info of element.attinf;let infoi=index">
<th style="border: 1px solid #999; <th style="border: 1px solid #999;
height: 40px; height: 40px;
@ -940,47 +937,82 @@
height: 40px; height: 40px;
background-color: #FFFBE8; background-color: #FFFBE8;
text-align: center;"> text-align: center;">
<input type="text" placeholder="请输入内容" [(ngModel)]="parts.heafName" *ngIf="pattern == 'edit'"> <input type="text" placeholder="请输入内容"
[(ngModel)]="parts.heafName" *ngIf="pattern == 'edit'">
<!-- <textarea [(ngModel)]="parts.heafName" *ngIf="pattern == 'look'" style="width: 100%;height: 100%;color: #b99a00;" disabled></textarea> --> <!-- <textarea [(ngModel)]="parts.heafName" *ngIf="pattern == 'look'" style="width: 100%;height: 100%;color: #b99a00;" disabled></textarea> -->
<span style="font-size: 16px; <span style="font-size: 16px;
text-align: center; text-align: center;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
color: #b99a00;" *ngIf="pattern == 'look'">{{parts.heafName}}</span> color: #b99a00;"
<img src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'"> *ngIf="pattern == 'look'">{{parts.heafName}}</span>
<img src="../../../assets/images/deletered.png"
(click)='unitDel(element.surveyName,uniti,infoi)'
*ngIf="pattern == 'edit'">
</div> </div>
<div class="partsBody" *ngIf="pattern!='look'"> <div class="partsBody" *ngIf="pattern!='look'">
<div class="duohang"> <div class="duohang">
<div class="duohangHalf"> <div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="parts.body[0].name" *ngIf="pattern == 'edit'"> <input type="text" placeholder="请输入内容"
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[0].value" *ngIf="pattern == 'edit'"> style="width: 40%;background-color: #F9F9F9;text-align: center;"
[(ngModel)]="parts.body[0].name"
*ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="parts.body[0].value"
*ngIf="pattern == 'edit'">
</div> </div>
<div class="duohangHalf"> <div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;"[(ngModel)]="parts.body[1].name" *ngIf="pattern == 'edit'"> <input type="text" placeholder="请输入内容"
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[1].value" *ngIf="pattern == 'edit'"> style="width: 40%;background-color: #F9F9F9;text-align: center;"
[(ngModel)]="parts.body[1].name"
*ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="parts.body[1].value"
*ngIf="pattern == 'edit'">
</div> </div>
</div> </div>
<div class="duohang"> <div class="duohang">
<div class="duohangHalf"> <div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="parts.body[2].name" *ngIf="pattern == 'edit'"> <input type="text" placeholder="请输入内容"
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[2].value" *ngIf="pattern == 'edit'"> style="width: 40%;background-color: #F9F9F9;text-align: center;"
[(ngModel)]="parts.body[2].name"
*ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="parts.body[2].value"
*ngIf="pattern == 'edit'">
</div> </div>
<div class="duohangHalf"> <div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="parts.body[3].name" *ngIf="pattern == 'edit'"> <input type="text" placeholder="请输入内容"
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[3].value" *ngIf="pattern == 'edit'"> style="width: 40%;background-color: #F9F9F9;text-align: center;"
[(ngModel)]="parts.body[3].name"
*ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="parts.body[3].value"
*ngIf="pattern == 'edit'">
</div> </div>
</div> </div>
<div class="danhang"> <div class="danhang">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="parts.body[4].name" *ngIf="pattern == 'edit'"> <input type="text" placeholder="请输入内容"
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[4].value" *ngIf="pattern == 'edit'"> style="width: 40%;background-color: #F9F9F9;text-align: center;"
[(ngModel)]="parts.body[4].name"
*ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="parts.body[4].value"
*ngIf="pattern == 'edit'">
</div> </div>
</div> </div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;"> <table *ngIf="pattern == 'look'"
style="width: 100%;border-collapse: collapse;">
<tr *ngFor="let partsbody of parts.body"> <tr *ngFor="let partsbody of parts.body">
<th style="border: 1px solid #999; <th style="border: 1px solid #999;
height: 40px; height: 40px;
@ -1007,7 +1039,8 @@
<div class="centerBox" <div class="centerBox"
*ngIf="element.surveyName!='单位基本信息'&&element.surveyName!='建筑信息'&&element.surveyName!='四周毗邻'&&element.surveyName!='消防设施'&&element.surveyName!='进攻通道'&&element.surveyName!='重点部位'&&element.surveyName!='功能分区'"> *ngIf="element.surveyName!='单位基本信息'&&element.surveyName!='建筑信息'&&element.surveyName!='四周毗邻'&&element.surveyName!='消防设施'&&element.surveyName!='进攻通道'&&element.surveyName!='重点部位'&&element.surveyName!='功能分区'">
<div class="boxBody" *ngFor="let element of element.attinf;let i=index" style="height: 100%; <div class="boxBody" *ngFor="let element of element.attinf;let i=index"
style="height: 100%;
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column;"> flex-direction: column;">
@ -1020,18 +1053,22 @@
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
color: #b99a00;">{{element.headName}}</span> color: #b99a00;">{{element.headName}}</span>
<img src="../../../assets/images/delyello.png" *ngIf="pattern == 'edit'" <img src="../../../assets/images/delyello.png"
(click)='delTd(key,i)'> *ngIf="pattern == 'edit'" (click)='delTd(key,i)'>
<img src="../../../assets/images/updateyello.png" *ngIf="(element.level==1||element.level==2)&&pattern == 'edit'" <img src="../../../assets/images/updateyello.png"
*ngIf="(element.level==1||element.level==2)&&pattern == 'edit'"
(click)='updataHl(key,uniti,elei,i)'> (click)='updataHl(key,uniti,elei,i)'>
<img src="../../../assets/images/addyello.png" *ngIf="element.level==1&&pattern == 'edit'" <img src="../../../assets/images/addyello.png"
*ngIf="element.level==1&&pattern == 'edit'"
(click)='unitNewadd(key,uniti,elei,i)'> (click)='unitNewadd(key,uniti,elei,i)'>
</div> </div>
<div class="body"> <div class="body">
<!--表格类型--> <!--表格类型-->
<table *ngIf="element.level==1" style="width: 100%;border-collapse: collapse;"> <table *ngIf="element.level==1"
style="width: 100%;border-collapse: collapse;">
<thead *ngIf="pattern == 'edit'"> <thead *ngIf="pattern == 'edit'">
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn" style="border: 1px solid #999; <th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn"
style="border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; font-size: 16px;
text-align: center;"> text-align: center;">
@ -1040,7 +1077,8 @@
</th> </th>
</thead> </thead>
<thead *ngIf="pattern == 'look'"> <thead *ngIf="pattern == 'look'">
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn" style="border: 1px solid #999; <th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn"
style="border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; font-size: 16px;
text-align: center;"> text-align: center;">
@ -1049,19 +1087,22 @@
</th> </th>
</thead> </thead>
<tbody *ngIf="pattern == 'edit'"> <tbody *ngIf="pattern == 'edit'">
<tr *ngFor="let itemtr of element.tabletr;let tri=index"> <tr
*ngFor="let itemtr of element.tabletr;let tri=index">
<td <td
*ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn"> *ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入" <input type="text" placeholder="请输入"
[(ngModel)]="itemtr.tabletd[tabletdi]"> [(ngModel)]="itemtr.tabletd[tabletdi]">
</td> </td>
<img src="../../../assets/images/deletered.png" (click)='delTd(key,uniti,elei,i,tri)'> <img src="../../../assets/images/deletered.png"
(click)='delTd(key,uniti,elei,i,tri)'>
</tr> </tr>
</tbody> </tbody>
<tbody *ngIf="pattern == 'look'"> <tbody *ngIf="pattern == 'look'">
<tr *ngFor="let itemtr of element.tabletr"> <tr *ngFor="let itemtr of element.tabletr">
<td *ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn" style="border: 1px solid #999; <td *ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn"
style="border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; font-size: 16px;
text-align: center;"> text-align: center;">
@ -1071,9 +1112,12 @@
</tbody> </tbody>
</table> </table>
<!--文本区域--> <!--文本区域-->
<textarea style="width: 99%;height: 100px;" *ngIf="element.level==3&&pattern == 'edit'" <textarea style="width: 99%;height: 100px;"
*ngIf="element.level==3&&pattern == 'edit'"
[(ngModel)]="element.tableth"></textarea> [(ngModel)]="element.tableth"></textarea>
<div style="height: 100px;width: 98%; border: 1px solid #000000;" *ngIf="element.level==3&&pattern == 'look'">{{element.tableth||''}}</div> <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="inputtext" *ngIf="element.level==2">
<div class="inputj" style="height: 100%;width: 100%;" <div class="inputj" style="height: 100%;width: 100%;"
@ -1082,16 +1126,20 @@
*ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn"> *ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入内容" <input type="text" placeholder="请输入内容"
style="background-color: #E8E9E9;width: 25%;text-align: center;" style="background-color: #E8E9E9;width: 25%;text-align: center;"
[(ngModel)]="itemthj.head" *ngIf="pattern == 'edit'"> [(ngModel)]="itemthj.head"
<input type="text" placeholder="请输入内容" style="width: 75%;" *ngIf="pattern == 'edit'">
[(ngModel)]="itemthj.body" *ngIf="pattern == 'edit'"> <input type="text" placeholder="请输入内容"
style="width: 75%;" [(ngModel)]="itemthj.body"
*ngIf="pattern == 'edit'">
</div> </div>
</div> </div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;"> <table *ngIf="pattern == 'look'"
<tr *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn"> style="width: 100%;border-collapse: collapse;">
<tr
*ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn">
<td style="border: 1px solid #999; <td style="border: 1px solid #999;
height: 40px;width: 30%; height: 40px;width: 30%;
font-size: 16px; font-size: 16px;
@ -1118,19 +1166,23 @@
<div class="keyImgImg"> <div class="keyImgImg">
<div style="margin-top: 10px; <div style="margin-top: 10px;
text-align: center; text-align: center;
position: relative;" class="imgbox" *ngFor="let imgUrl of element.tableth.json;let imgkey = index"> position: relative;" class="imgbox"
<mat-icon *ngIf="pattern == 'edit'" class="deleteImg" *ngFor="let imgUrl of element.tableth.json;let imgkey = index">
<mat-icon *ngIf="pattern == 'edit'"
class="deleteImg"
(click)="deleteImgItem(element.tableth.json,imgkey)">delete (click)="deleteImgItem(element.tableth.json,imgkey)">delete
</mat-icon> </mat-icon>
<img style="max-width: 100%; <img style="max-width: 100%;
width: auto; width: auto;
height: auto;" [src]="imgUrl" alt=""> height: auto;" [src]="imgUrl" alt="">
</div> </div>
<div class="uploadBtn" *ngIf="pattern == 'edit'&&element.tableth.json.length<=0"> <div class="uploadBtn"
*ngIf="pattern == 'edit'&&element.tableth.json.length<=0">
<button mat-stroked-button> <button mat-stroked-button>
<mat-icon>add</mat-icon>上传图片 <mat-icon>add</mat-icon>上传图片
</button> </button>
<input (change)="filechange($event,element)" type="file" name="" id=""> <input (change)="filechange($event,element)"
type="file" name="" id="">
</div> </div>
</div> </div>
</div> </div>

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

File diff suppressed because it is too large Load Diff

18
src/app/plan-management/entry-plan-look/edit-plan-category/edit-plan-category.component.html

@ -0,0 +1,18 @@
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<div class="topbox" style="text-align: center;">
<span mat-dialog-title>修改预案级别</span>
</div>
<div class="mainbox">
<mat-form-field>
<mat-select placeholder='请选择预案级别' [(ngModel)]="planCategory" name="integritySort">
<mat-option [value]='3'>Ⅲ级预案</mat-option>
<mat-option [value]='4'>Ⅳ级预案</mat-option>
<mat-option [value]='5'>Ⅴ级预案</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="btn" style="margin-top:10px;">
<button mat-raised-button color="primary" style="margin-right: 12px;">确定</button>
<button type="button" mat-button (click)="onNoClick()" mat-raised-button>取消</button>
</div>
</form>

0
src/app/plan-management/entry-plan-look/edit-plan-category/edit-plan-category.component.scss

25
src/app/plan-management/entry-plan-look/edit-plan-category/edit-plan-category.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EditPlanCategoryComponent } from './edit-plan-category.component';
describe('EditPlanCategoryComponent', () => {
let component: EditPlanCategoryComponent;
let fixture: ComponentFixture<EditPlanCategoryComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EditPlanCategoryComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EditPlanCategoryComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

37
src/app/plan-management/entry-plan-look/edit-plan-category/edit-plan-category.component.ts

@ -0,0 +1,37 @@
import { HttpClient } from "@angular/common/http";
import { Component, OnInit, Inject } from "@angular/core";
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
import { MatSnackBar } from "@angular/material/snack-bar";
@Component({
selector: "app-edit-plan-category",
templateUrl: "./edit-plan-category.component.html",
styleUrls: ["./edit-plan-category.component.scss"],
})
export class EditPlanCategoryComponent implements OnInit {
constructor(
private http: HttpClient,
public dialogRef: MatDialogRef<EditPlanCategoryComponent>,
@Inject(MAT_DIALOG_DATA) public data,
public snackBar: MatSnackBar
) {}
planCategory;
ngOnInit(): void {
this.planCategory = this.data.planCategory;
}
onNoClick(): void {
this.dialogRef.close();
}
onSubmit(value) {
let body = {
planCategory: this.planCategory,
};
this.http
.put(`/api/PlanComponents/${this.data.id}`, body)
.subscribe((data) => {
this.dialogRef.close("success");
});
}
}

5
src/app/plan-management/entry-plan-look/entry-plan-look.component.html

@ -67,7 +67,10 @@
<ng-container matColumnDef="planCategory"> <ng-container matColumnDef="planCategory">
<th mat-header-cell *matHeaderCellDef>预案级别</th> <th mat-header-cell *matHeaderCellDef>预案级别</th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
{{element.planCategory=='3'?'Ⅲ级预案':element.planCategory=='4'?'Ⅳ级预案':'Ⅴ级预案'}}</td> {{element.planCategory=='3'?'Ⅲ级预案':element.planCategory=='4'?'Ⅳ级预案':'Ⅴ级预案'}}
<mat-icon *ngIf="element.auditStatus==8 || element.maintenanceVerifyState=='未提交审核'"
class="editPlanCategory" (click)="editPlanCategory(element)">create</mat-icon>
</td>
</ng-container> </ng-container>
<ng-container matColumnDef="plantype"> <ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef style="width: 150px;">预案类型</th> <th mat-header-cell *matHeaderCellDef style="width: 150px;">预案类型</th>

57
src/app/plan-management/entry-plan-look/entry-plan-look.component.scss

@ -5,6 +5,7 @@
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
// justify-content:center; // justify-content:center;
div { div {
width: 300px; width: 300px;
@ -12,10 +13,13 @@
// margin: 0 30px; // margin: 0 30px;
margin-left: 80px; margin-left: 80px;
} }
// margin-bottom: 30px; // margin-bottom: 30px;
} }
.body { .body {
overflow: auto; overflow: auto;
.btn { .btn {
button { button {
width: 80px; width: 80px;
@ -23,8 +27,10 @@
margin-left: 2%; margin-left: 2%;
} }
} }
.tablebox { .tablebox {
overflow: auto; overflow: auto;
.add { .add {
cursor: auto; cursor: auto;
text-decoration: none; text-decoration: none;
@ -50,11 +56,21 @@
line-height: 20px; line-height: 20px;
margin-left: 40px; margin-left: 40px;
} }
.editPlanCategory {
width: 13px;
height: 13px;
font-size: 18px;
vertical-align: sub;
cursor: pointer;
}
table { table {
width: 100%; width: 100%;
margin-left: 0%; margin-left: 0%;
margin-top: 15px; margin-top: 15px;
} }
mat-paginator { mat-paginator {
width: 100%; width: 100%;
margin-left: 0%; margin-left: 0%;
@ -62,30 +78,37 @@
} }
} }
} }
.upbox { .upbox {
height: 100px; height: 100px;
margin-bottom: 15px; margin-bottom: 15px;
mat-radio-group { mat-radio-group {
div { div {
margin: 10px 0; margin: 10px 0;
} }
} }
} }
.createbtnbox { .createbtnbox {
button { button {
margin: 0 6px; margin: 0 6px;
} }
} }
.mat-header-cell { .mat-header-cell {
text-align: center; text-align: center;
} }
.mat-cell { .mat-cell {
text-align: center; text-align: center;
span { span {
color: #0000BF; color: #0000BF;
margin: 0 3px; margin: 0 3px;
cursor: pointer; cursor: pointer;
} }
.grey { .grey {
color: grey; color: grey;
pointer-events: none; pointer-events: none;
@ -99,9 +122,11 @@
position: relative; position: relative;
display: inline-block; display: inline-block;
width: 100%; width: 100%;
button { button {
float: right; float: right;
} }
.progress { .progress {
display: inline-block; display: inline-block;
position: absolute; position: absolute;
@ -124,37 +149,55 @@
.fileDiv { .fileDiv {
cursor: pointer; cursor: pointer;
} }
.fileDiv:hover { .fileDiv:hover {
background-color: #fafafa; background-color: #fafafa;
} }
.auditDiv { .auditDiv {
p { p {
margin: 8px 0; margin: 8px 0;
margin-left: 16px; margin-left: 16px;
} }
} }
.btn { .btn {
text-align: center; text-align: center;
button { button {
margin: 0 3px; margin: 0 3px;
} }
} }
#viewer { #viewer {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.mat-dialog-container { .mat-dialog-container {
padding: 0; padding: 0;
} }
//预览图片旋转角度 //预览图片旋转角度
.rotateA {transform: rotate(90deg) scale(0.75);} .rotateA {
.rotateB {transform: rotate(180deg)} transform: rotate(90deg) scale(0.75);
.rotateC {transform: rotate(270deg) scale(0.75);} }
.rotateB {
transform: rotate(180deg)
}
.rotateC {
transform: rotate(270deg) scale(0.75);
}
@media screen and (max-width:1200px) { @media screen and (max-width:1200px) {
.bigimgbox { .bigimgbox {
width: 880px; width: 880px;
height: 580px; height: 580px;
//预览图片 //预览图片
.previewImgBox { .previewImgBox {
width: 800px; width: 800px;
@ -163,10 +206,12 @@
} }
} }
} }
@media screen and (min-width:1200px) and (max-width:1400px) { @media screen and (min-width:1200px) and (max-width:1400px) {
.bigimgbox { .bigimgbox {
width: 880px; width: 880px;
height: 610px; height: 610px;
//预览图片 //预览图片
.previewImgBox { .previewImgBox {
width: 800px; width: 800px;
@ -176,16 +221,19 @@
} }
} }
@media screen and (min-width:1400px) { @media screen and (min-width:1400px) {
.bigimgbox { .bigimgbox {
width: 1110px; width: 1110px;
height: 860px; height: 860px;
//预览图片 //预览图片
.previewImgBox { .previewImgBox {
width: 900px; width: 900px;
height: 100%; height: 100%;
text-align: center; text-align: center;
} }
.previewImgBottom { .previewImgBottom {
text-align: center; text-align: center;
height: 30px; height: 30px;
@ -194,6 +242,7 @@
} }
} }
.shadow { .shadow {
height: 100%; height: 100%;
width: 100%; width: 100%;
@ -201,6 +250,7 @@
z-index: 998; z-index: 998;
background-color: #FFFFFF; background-color: #FFFFFF;
opacity: 0.3; opacity: 0.3;
mat-spinner { mat-spinner {
position: relative; position: relative;
top: 40%; top: 40%;
@ -214,6 +264,7 @@
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.file { .file {
text-align: center; text-align: center;
} }

18
src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

@ -27,6 +27,7 @@ import { STEPPER_GLOBAL_OPTIONS } from "@angular/cdk/stepper";
import Swiper from "swiper"; import Swiper from "swiper";
import { resolve } from "dns"; import { resolve } from "dns";
import { DomSanitizer } from "@angular/platform-browser"; import { DomSanitizer } from "@angular/platform-browser";
import { EditPlanCategoryComponent } from "./edit-plan-category/edit-plan-category.component";
declare var CryptoJS; declare var CryptoJS;
@Component({ @Component({
selector: "app-entry-plan-look", selector: "app-entry-plan-look",
@ -614,6 +615,23 @@ export class EntryPlanLookComponent implements OnInit {
} }
}); });
} }
//修改预案级别
editPlanCategory(data) {
console.log(data);
const dialogRef = this.dialog.open(EditPlanCategoryComponent, {
data: data,
});
dialogRef.afterClosed().subscribe((data) => {
if (data) {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("修改成功!", "确定", config);
this.getAllPlanComponents();
}
});
}
//获得所有预案组件 //获得所有预案组件
audit: boolean; audit: boolean;
getAllPlanComponents() { getAllPlanComponents() {

5
src/app/plan-management/plan-management.module.ts

@ -76,13 +76,14 @@ import { updataHl } from './create-plan-online-five/create-plan-online-five.comp
import {ChangeUrl} from './entry-plan-look/entry-plan-look.component' import {ChangeUrl} from './entry-plan-look/entry-plan-look.component'
import {adddwsurveys} from './create-plan-online-five/create-plan-online-five.component' import {adddwsurveys} from './create-plan-online-five/create-plan-online-five.component'
import { editUpload } from './entry-plan-look/entry-plan-look.component' import { editUpload } from './entry-plan-look/entry-plan-look.component'
import { wenbenUpload } from './entry-plan-look/entry-plan-look.component' import { wenbenUpload } from './entry-plan-look/entry-plan-look.component';
import { EditPlanCategoryComponent } from './entry-plan-look/edit-plan-category/edit-plan-category.component'
@NgModule({ @NgModule({
declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName, declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName,
WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult, WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult,
typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent, typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent,
OpenPlanToolDialog,yinYong,newTitle,disaster,updataHl,ChangeUrl,adddwsurveys,editUpload,wenbenUpload], OpenPlanToolDialog,yinYong,newTitle,disaster,updataHl,ChangeUrl,adddwsurveys,editUpload,wenbenUpload, EditPlanCategoryComponent],
imports: [ imports: [
CommonModule, CommonModule,
PlanManagementRoutingModule, PlanManagementRoutingModule,

18
src/app/statistic-analysis/combined-query/combined-query.component.html

@ -121,6 +121,24 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="queryField" *ngIf="preparelevels==0">
<label style="margin-right: 10px;">重点单位:</label>
<mat-form-field>
<mat-select placeholder='是否为重点单位' [(ngModel)]="unitIsFollowed" name="integritySort">
<mat-option [value]='true'>重点单位</mat-option>
<mat-option [value]='false'>一般单位</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField" *ngIf="preparelevels==1">
<label style="margin-right: 10px;">重点单位:</label>
<mat-form-field>
<mat-select placeholder='是否为重点单位' [(ngModel)]="planIsFollowed" name="integritySort">
<mat-option [value]='true'>重点单位</mat-option>
<mat-option [value]='false'>一般单位</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField" *ngIf="preparelevels==0||preparelevels==1"> <div class="queryField" *ngIf="preparelevels==0||preparelevels==1">
<button mat-raised-button color="primary">查询</button> <button mat-raised-button color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> <button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>

703
src/app/statistic-analysis/combined-query/combined-query.component.ts

@ -1,93 +1,104 @@
import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { Component, OnInit, ViewChild, Inject } from "@angular/core";
import { HttpClient } from '@angular/common/http' import { HttpClient } from "@angular/common/http";
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; import {
import { MatPaginator } from '@angular/material/paginator'; MatTreeFlatDataSource,
import { FlatTreeControl } from '@angular/cdk/tree'; MatTreeFlattener,
import { FormControl } from '@angular/forms'; } from "@angular/material/tree";
import { Router, ActivatedRoute } from '@angular/router' import { MatPaginator } from "@angular/material/paginator";
import { PageEvent } from '@angular/material/paginator'; import { FlatTreeControl } from "@angular/cdk/tree";
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { FormControl } from "@angular/forms";
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { Router, ActivatedRoute } from "@angular/router";
import { TreeService } from '../../http-interceptors/tree.service' import { PageEvent } from "@angular/material/paginator";
import { Viewer } from 'photo-sphere-viewer'; import {
import { timeStamp } from 'console'; MatDialogRef,
MatDialog,
MAT_DIALOG_DATA,
} from "@angular/material/dialog";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
import { TreeService } from "../../http-interceptors/tree.service";
import { Viewer } from "photo-sphere-viewer";
import { timeStamp } from "console";
@Component({ @Component({
selector: 'app-combined-query', selector: "app-combined-query",
templateUrl: './combined-query.component.html', templateUrl: "./combined-query.component.html",
styleUrls: ['./combined-query.component.scss'] styleUrls: ["./combined-query.component.scss"],
}) })
export class CombinedQueryComponent implements OnInit { export class CombinedQueryComponent implements OnInit {
constructor(
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } private http: HttpClient,
private router: Router,
private route: ActivatedRoute,
private tree: TreeService,
public dialog: MatDialog,
private _transformer = (node, level: number) => { //初始化tree public snackBar: MatSnackBar
) {}
private _transformer = (node, level: number) => {
//初始化tree
return { return {
expandable: !!node.children && node.children.length > 0, expandable: !!node.children && node.children.length > 0,
name: node.name, name: node.name,
level: level, level: level,
id: node.id, id: node.id,
parentId: node.parentId, parentId: node.parentId,
children: node.children children: node.children,
}; };
} };
treeControl = new FlatTreeControl<any>(node => node.level, node => node.expandable); treeControl = new FlatTreeControl<any>(
treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children); (node) => node.level,
(node) => node.expandable
);
treeFlattener = new MatTreeFlattener(
this._transformer,
(node) => node.level,
(node) => node.expandable,
(node) => node.children
);
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl(); myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable; hasChild = (_: number, node: any) => node.expandable;
displayedColumns: string[] = ["组织名称", "总数"]; //, 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation'
yuanColumns: string[] = ["组织名称", "总数"];
tabledataSource = []; //单位表格数据
yuanTable = []; //预案表格数据
excelData: any;
findTj = 0; //查询条件
displayedColumns: string[] = ['组织名称', '总数'];//, 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation' allPlanInfo: any; //存储所有预案信息
yuanColumns: string[] = ['组织名称', '总数']; lable = ["单位查询", "预案查询"];
tabledataSource = [] //单位表格数据
yuanTable = []//预案表格数据
excelData: any
findTj = 0//查询条件
allPlanInfo: any //存储所有预案信息
lable = ['单位查询', '预案查询']
selected = new FormControl(0); //选项卡实例 selected = new FormControl(0); //选项卡实例
//判断选了哪一个 //判断选了哪一个
selectedIndexChange(e) { selectedIndexChange(e) {
this.orRecord = [] this.orRecord = [];
this.selected.setValue(e) this.selected.setValue(e);
this.preparelevels = Number(e) this.preparelevels = Number(e);
if (this.preparelevels == 0) { if (this.preparelevels == 0) {
this.js = this.organizationName this.js = this.organizationName;
this.jsId = this.organizationId this.jsId = this.organizationId;
this.jscheck = true this.jscheck = true;
this.unittype = [] this.unittype = [];
this.allunittype.forEach(element => { this.allunittype.forEach((element) => {
this.unittype.push(element.id) this.unittype.push(element.id);
}); });
this.preparelevel = [1] this.preparelevel = [1];
this.dwaddtime = '2020-01-01'//单位查询开始时间 this.dwaddtime = "2020-01-01"; //单位查询开始时间
this.dwendtime = this.getNowFormatDate()//单位结束时间 this.dwendtime = this.getNowFormatDate(); //单位结束时间
} else if (this.preparelevels == 1) { } else if (this.preparelevels == 1) {
this.yuanjs = this.organizationName this.yuanjs = this.organizationName;
this.yuanjsId = this.organizationId this.yuanjsId = this.organizationId;
this.yuanaddtime = '2020-01-01'//预案查询开始时间 this.yuanaddtime = "2020-01-01"; //预案查询开始时间
this.yuanendtime = this.getNowFormatDate()//预案查询结束时间 this.yuanendtime = this.getNowFormatDate(); //预案查询结束时间
this.yuanjscheck = true this.yuanjscheck = true;
this.reservePlanType = ['1', '2', '4', '16'] this.reservePlanType = ["1", "2", "4", "16"];
this.planCategory = ['1', '2', '3', '4', '5'] this.planCategory = ["1", "2", "3", "4", "5"];
} }
this.getAllPlanInfo() this.getAllPlanInfo();
} }
getNowFormatDate() { getNowFormatDate() {
var date = new Date(); var date = new Date();
var seperator1 = "-"; var seperator1 = "-";
@ -105,478 +116,498 @@ export class CombinedQueryComponent implements OnInit {
} }
async ngOnInit(): Promise<void> { async ngOnInit(): Promise<void> {
await this.getunitdata(); await this.getunitdata();
await this.getOrganizations(); await this.getOrganizations();
await this.getUnittype(); await this.getUnittype();
this.jscheck = true this.jscheck = true;
this.yuanjscheck = true this.yuanjscheck = true;
this.dwaddtime = '2020-01-01'//单位查询开始时间 this.dwaddtime = "2020-01-01"; //单位查询开始时间
this.dwendtime = this.getNowFormatDate()//单位结束时间 this.dwendtime = this.getNowFormatDate(); //单位结束时间
this.yuanaddtime = '2020-01-01'//预案查询开始时间 this.yuanaddtime = "2020-01-01"; //预案查询开始时间
this.yuanendtime = this.getNowFormatDate()//预案查询结束时间 this.yuanendtime = this.getNowFormatDate(); //预案查询结束时间
this.reservePlanType = ['1', '2', '4', '16'] this.reservePlanType = ["1", "2", "4", "16"];
this.planCategory = ['1', '2', '3', '4', '5'] this.planCategory = ["1", "2", "3", "4", "5"];
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
//得到当前单位信息 //得到当前单位信息
organizationName: any //当前单位组织机构名称 organizationName: any; //当前单位组织机构名称
organizationId: any //当前单位组织机构id organizationId: any; //当前单位组织机构id
async getunitdata() { async getunitdata() {
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {
this.http.get("/api/Account/Profiles").subscribe( this.http.get("/api/Account/Profiles").subscribe((data: any) => {
(data: any) => { console.log("当前登陆用户信息", data);
console.log('当前登陆用户信息', data) resolve(data);
resolve(data) this.organizationName = data.organizationName;
this.organizationName = data.organizationName this.organizationId = data.organizationId;
this.organizationId = data.organizationId });
} });
)
})
} }
//获得所有组织机构 //获得所有组织机构
allorganizations: any //所有组织机构 allorganizations: any; //所有组织机构
treedata: any //组织机构树型数据 treedata: any; //组织机构树型数据
newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段 newallorganizations: any; //用于存储在原始数据基础上的每个机构增加children字段
async getOrganizations() { async getOrganizations() {
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {
this.http.get('/api/Organizations').subscribe( this.http.get("/api/Organizations").subscribe((data: any) => {
(data: any) => { this.allorganizations = data;
this.allorganizations = data
this.treedata = this.tree.toTree(data); this.treedata = this.tree.toTree(data);
this.getpresentOrganization(); this.getpresentOrganization();
resolve(data) resolve(data);
} });
) });
})
} }
//得到当前单位所在组织机构的tree型数据 //得到当前单位所在组织机构的tree型数据
getpresentOrganization() { getpresentOrganization() {
this.newallorganizations = this.allorganizations this.newallorganizations = this.allorganizations;
this.newallorganizations.forEach(item => { this.newallorganizations.forEach((item) => {
item.children = [] item.children = [];
this.newallorganizations.forEach(element => { this.newallorganizations.forEach((element) => {
if (element.parentId == item.id) { if (element.parentId == item.id) {
item.children.push(element) item.children.push(element);
} }
}); });
}); });
if (this.organizationName) { if (this.organizationName) {
this.newallorganizations.forEach(item => { this.newallorganizations.forEach((item) => {
if (item.name == this.organizationName) { if (item.name == this.organizationName) {
this.dataSource.data = [item] this.dataSource.data = [item];
} }
}); });
} else { } else {
this.dataSource.data = this.tree.toTree(this.treedata); this.dataSource.data = this.tree.toTree(this.treedata);
} }
this.js = this.organizationName this.js = this.organizationName;
this.jsId = this.organizationId this.jsId = this.organizationId;
this.yuanjs = this.organizationName this.yuanjs = this.organizationName;
this.yuanjsId = this.organizationId this.yuanjsId = this.organizationId;
} }
//获得所有单位类型 //获得所有单位类型
allunittype: any //所有单位类型 allunittype: any; //所有单位类型
async getUnittype() { async getUnittype() {
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {
this.http.get('/api/BuildingTypes/Simple').subscribe( this.http.get("/api/BuildingTypes/Simple").subscribe((data: any) => {
(data: any) => { this.allunittype = data;
this.allunittype = data console.log("单位类型", data);
console.log('单位类型', data) this.allunittype.forEach((element) => {
this.allunittype.forEach(element => { this.unittype.push(element.id);
this.unittype.push(element.id) });
resolve(data);
});
}); });
resolve(data)
}
)
})
} }
//获得所有预案或单位信息 //获得所有预案或单位信息
tableDataNull = false tableDataNull = false;
preparelevels: Number = 0 preparelevels: Number = 0;
companyName: any //单位名称 companyName: any; //单位名称
js: any //单位所选组织机构 js: any; //单位所选组织机构
jsId: any //单位所选组织机构的id jsId: any; //单位所选组织机构的id
jscheck: boolean //单位所选组织机构勾选框 jscheck: boolean; //单位所选组织机构勾选框
yuanjs: any //预案所选组织机构 yuanjs: any; //预案所选组织机构
yuanjsId: any //预案所选组织机构的id yuanjsId: any; //预案所选组织机构的id
yuanjscheck: boolean //预案所选组织机构勾选框 yuanjscheck: boolean; //预案所选组织机构勾选框
dwaddtime//单位查询开始时间 dwaddtime; //单位查询开始时间
dwendtime//单位结束时间 dwendtime; //单位结束时间
yuanaddtime//预案查询开始时间 yuanaddtime; //预案查询开始时间
yuanendtime//预案查询结束时间 yuanendtime; //预案查询结束时间
unittype = [] //单位类型 unittype = []; //单位类型
reservePlanType = [] //预案类型 reservePlanType = []; //预案类型
preparelevel = [1] //单位状态 preparelevel = [1]; //单位状态
plcheck: boolean //编制级别勾选框 plcheck: boolean; //编制级别勾选框
planCategory = [] //预案级别 planCategory = []; //预案级别
integritySort //单位排序字段 integritySort; //单位排序字段
yuanintegritySort //预案排序字段 yuanintegritySort; //预案排序字段
isMasklayer = false
unitIsFollowed = ""; //单位 重点
planIsFollowed = ""; //预案 重点单位
isMasklayer = false;
async getAllPlanInfo() { async getAllPlanInfo() {
console.log(this.preparelevel)
let paramsdata: any = { let paramsdata: any = {
QueryMode: this.preparelevels, QueryMode: this.preparelevels,
OrganizationId: this.jsId || '', OrganizationId: this.jsId || "",
HasChildren: this.jscheck || '', HasChildren: this.jscheck || "",
TimeIntervalStart: this.dwaddtime || '', TimeIntervalStart: this.dwaddtime || "",
TimeIntervalEnd: this.dwendtime || '', TimeIntervalEnd: this.dwendtime || "",
BuildingTypeIds: this.unittype || [], BuildingTypeIds: this.unittype || [],
CompanyStatuses: this.preparelevel || [], CompanyStatuses: this.preparelevel || [],
SortBy: this.integritySort ? 'totalCount' : '', SortBy: this.integritySort ? "totalCount" : "",
SortType: this.integritySort || '' SortType: this.integritySort || "",
} IsFollowed: String(this.unitIsFollowed) || "",
};
let yuandata = { let yuandata = {
QueryMode: this.preparelevels, QueryMode: this.preparelevels,
OrganizationId: this.yuanjsId || '', OrganizationId: this.yuanjsId || "",
HasChildren: this.yuanjscheck || '', HasChildren: this.yuanjscheck || "",
TimeIntervalStart: this.yuanaddtime || '', TimeIntervalStart: this.yuanaddtime || "",
TimeIntervalEnd: this.yuanendtime || '', TimeIntervalEnd: this.yuanendtime || "",
PlanCategories: this.planCategory || [], PlanCategories: this.planCategory || [],
PlanTypes: this.reservePlanType || [], PlanTypes: this.reservePlanType || [],
SortBy: this.yuanintegritySort ? 'totalCount' : '', SortBy: this.yuanintegritySort ? "totalCount" : "",
SortType: this.yuanintegritySort || '' SortType: this.yuanintegritySort || "",
} IsFollowed: String(this.planIsFollowed) || "",
// console.log(666, paramsdata) };
this.isMasklayer = true this.isMasklayer = true;
let result = await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
this.http.get("/api/StatisticsAnalysis/ReportTable", { params: this.preparelevels == 0 ? paramsdata : yuandata }).subscribe((data: any) => { this.http
console.log('接口数据', data) .get("/api/StatisticsAnalysis/ReportTable", {
this.excelData = data params: this.preparelevels == 0 ? paramsdata : yuandata,
})
.subscribe((data: any) => {
console.log("接口数据", data);
this.excelData = data;
if (data.length == 0) { if (data.length == 0) {
this.tableDataNull = true this.tableDataNull = true;
} else { } else {
this.tableDataNull = false this.tableDataNull = false;
if (this.preparelevels == 0) { if (this.preparelevels == 0) {
//单位查询 //单位查询
if (this.preparelevel.length == 0) { if (this.preparelevel.length == 0) {
//必须选择单位状态 //必须选择单位状态
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('请选择单位状态', '确定', config); this.snackBar.open("请选择单位状态", "确定", config);
} else { } else {
this.tabledataSource = [] this.tabledataSource = [];
this.displayedColumns = ['组织名称', '总数'] this.displayedColumns = ["组织名称", "总数"];
data.forEach((element, i, value) => { data.forEach((element, i, value) => {
this.tabledataSource.push({ name: [element.orgName, element.companyStatistics.totalCount] }) this.tabledataSource.push({
name: [
element.orgName,
element.companyStatistics.totalCount,
],
});
if (value[0].companyStatistics.buildingTypesCounts != null) { if (value[0].companyStatistics.buildingTypesCounts != null) {
value[i].companyStatistics.buildingTypesCounts.forEach((build, bi, bvalue) => { value[i].companyStatistics.buildingTypesCounts.forEach(
(build, bi, bvalue) => {
if (i == 0) { if (i == 0) {
this.displayedColumns.push(value[0].companyStatistics.buildingTypesCounts[bi].buildingTypeName) this.displayedColumns.push(
this.tabledataSource[0].name.push(value[0].companyStatistics.buildingTypesCounts[bi].count) value[0].companyStatistics.buildingTypesCounts[bi]
.buildingTypeName
);
this.tabledataSource[0].name.push(
value[0].companyStatistics.buildingTypesCounts[bi]
.count
);
} else { } else {
this.tabledataSource[i].name.push(bvalue[bi].count) this.tabledataSource[i].name.push(bvalue[bi].count);
} }
});
} }
}); );
} }
});
} }
else if (this.preparelevels == 1) { } else if (this.preparelevels == 1) {
//预案查询 //预案查询
this.yuanColumns = ['组织名称', '总数'] this.yuanColumns = ["组织名称", "总数"];
this.yuanTable = [{ name: [0, 0] }] this.yuanTable = [{ name: [0, 0] }];
if (this.planCategory.length != 0) { if (this.planCategory.length != 0) {
this.planCategory.forEach(element => { this.planCategory.forEach((element) => {
if (element == 1) { if (element == 1) {
this.yuanColumns.push('Ⅰ级') this.yuanColumns.push("Ⅰ级");
this.yuanTable[0].name.push(0) this.yuanTable[0].name.push(0);
} else if (element == 2) { } else if (element == 2) {
this.yuanColumns.push('Ⅱ级') this.yuanColumns.push("Ⅱ级");
this.yuanTable[0].name.push(0) this.yuanTable[0].name.push(0);
} else if (element == 3) { } else if (element == 3) {
this.yuanColumns.push('Ⅲ级') this.yuanColumns.push("Ⅲ级");
this.yuanTable[0].name.push(0) this.yuanTable[0].name.push(0);
} else if (element == 4) { } else if (element == 4) {
this.yuanColumns.push('Ⅳ级') this.yuanColumns.push("Ⅳ级");
this.yuanTable[0].name.push(0) this.yuanTable[0].name.push(0);
} else if (element == 5) { } else if (element == 5) {
this.yuanColumns.push('Ⅴ级') this.yuanColumns.push("Ⅴ级");
this.yuanTable[0].name.push(0) this.yuanTable[0].name.push(0);
} }
}) });
} }
if (this.reservePlanType.length != 0) { if (this.reservePlanType.length != 0) {
this.reservePlanType.forEach(element => { this.reservePlanType.forEach((element) => {
if (element == 1) { if (element == 1) {
this.yuanColumns.push('二维') this.yuanColumns.push("二维");
this.yuanTable[0].name.push(0) this.yuanTable[0].name.push(0);
} else if (element == 2) { } else if (element == 2) {
this.yuanColumns.push('三维') this.yuanColumns.push("三维");
this.yuanTable[0].name.push(0) this.yuanTable[0].name.push(0);
} else if (element == 4) { } else if (element == 4) {
this.yuanColumns.push('其他') this.yuanColumns.push("其他");
this.yuanTable[0].name.push(0) this.yuanTable[0].name.push(0);
} else if (element == 16) { } else if (element == 16) {
this.yuanColumns.push('文本') this.yuanColumns.push("文本");
this.yuanTable[0].name.push(0) this.yuanTable[0].name.push(0);
} }
}); });
} }
data.forEach((element, i, value) => { data.forEach((element, i, value) => {
if (i == 0) { if (i == 0) {
this.yuanTable[0].name[0] = value[0].orgName this.yuanTable[0].name[0] = value[0].orgName;
this.yuanTable[0].name[1] = value[0].planStatistics.totalCount this.yuanTable[0].name[1] =
value[0].planStatistics.totalCount;
} else { } else {
this.yuanTable.push({ name: [value[i].orgName, value[i].planStatistics.totalCount] }) this.yuanTable.push({
name: [
value[i].orgName,
value[i].planStatistics.totalCount,
],
});
} }
}); });
this.yuanTable.forEach((element, i, value) => { this.yuanTable.forEach((element, i, value) => {
if (i > 0) { if (i > 0) {
for (let a = value[i].name.length; a < value[0].name.length; a++) { for (
value[i].name.push(0) let a = value[i].name.length;
a < value[0].name.length;
a++
) {
value[i].name.push(0);
} }
} }
}) });
this.yuanTable.forEach((yuan, yuani, yuanval) => { this.yuanTable.forEach((yuan, yuani, yuanval) => {
this.yuanColumns.forEach((th, thi, thvalu) => { this.yuanColumns.forEach((th, thi, thvalu) => {
data.forEach((element, i, value) => { data.forEach((element, i, value) => {
//预案级别数据 //预案级别数据
if (value[i].planStatistics.planCategoryStatistics != null) { if (
value[i].planStatistics.planCategoryStatistics.planCategories.forEach((jibie, ji, jval) => { value[i].planStatistics.planCategoryStatistics != null
if (thvalu[thi].indexOf(jval[ji].planCategoryName) != -1 && yuani == i) { ) {
yuanval[yuani].name[thi] = jval[ji].count value[
} i
}); ].planStatistics.planCategoryStatistics.planCategories.forEach(
(jibie, ji, jval) => {
if (
thvalu[thi].indexOf(jval[ji].planCategoryName) !=
-1 &&
yuani == i
) {
yuanval[yuani].name[thi] = jval[ji].count;
}
}
);
} }
if (value[i].planStatistics.planTypeStatistics != null) { if (value[i].planStatistics.planTypeStatistics != null) {
//预案类型数据 //预案类型数据
value[i].planStatistics.planTypeStatistics.planTypes.forEach((planlx, lxi, lxval) => { value[
if (thvalu[thi].indexOf(lxval[lxi].planTypeName) != -1 && yuani == i) { i
yuanval[yuani].name[thi] = lxval[lxi].count ].planStatistics.planTypeStatistics.planTypes.forEach(
(planlx, lxi, lxval) => {
if (
thvalu[thi].indexOf(lxval[lxi].planTypeName) !=
-1 &&
yuani == i
) {
yuanval[yuani].name[thi] = lxval[lxi].count;
} }
});
} }
);
});
})
})
} }
});
});
});
} }
this.isMasklayer = false
resolve(this.excelData)
} }
) this.isMasklayer = false;
}) resolve(this.excelData);
});
});
} }
integrityScoreMin; //完整度最小值
integrityScoreMax; //完整度最大值
newArr: any = [];
integrityScoreMin//完整度最小值
integrityScoreMax//完整度最大值
newArr: any = []
//辖区中队div是否显示 //辖区中队div是否显示
isorganizationbox: boolean = false isorganizationbox: boolean = false;
//点击辖区中队树,将选择的辖区中队添加到变量 //点击辖区中队树,将选择的辖区中队添加到变量
add(node) { add(node) {
this.isorganizationbox = false this.isorganizationbox = false;
if (this.preparelevels == 0) { if (this.preparelevels == 0) {
this.js = node.name this.js = node.name;
this.jsId = node.id this.jsId = node.id;
} else if (this.preparelevels == 1) { } else if (this.preparelevels == 1) {
this.yuanjs = node.name this.yuanjs = node.name;
this.yuanjsId = node.id this.yuanjsId = node.id;
} }
} }
//关闭辖区中队隐藏框 //关闭辖区中队隐藏框
closeorganizationbox() { closeorganizationbox() {
this.isorganizationbox = false this.isorganizationbox = false;
} }
//打开辖区中队隐藏框 //打开辖区中队隐藏框
openorganizationbox() { openorganizationbox() {
this.isorganizationbox = true this.isorganizationbox = true;
} }
//关闭出现的组织机构div //关闭出现的组织机构div
closediv() { closediv() {
this.isorganizationbox = false this.isorganizationbox = false;
} }
//查询 //查询
onSubmit(e) { onSubmit(e) {
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
if (this.dwendtime < this.dwaddtime || this.yuanaddtime > this.yuanendtime) { if (
this.snackBar.open('开始时间不能早于结束时间', '确定', config); this.dwendtime < this.dwaddtime ||
this.yuanaddtime > this.yuanendtime
) {
this.snackBar.open("开始时间不能早于结束时间", "确定", config);
} }
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
//重置 //重置
reset() { reset() {
this.orRecord = [] this.orRecord = [];
this.integritySort = '' this.integritySort = "";
this.yuanintegritySort = '' this.yuanintegritySort = "";
if (this.preparelevels == 0) { if (this.preparelevels == 0) {
this.js = this.organizationName this.js = this.organizationName;
this.jsId = this.organizationId this.jsId = this.organizationId;
this.jscheck = true this.jscheck = true;
this.unittype = [] this.unittype = [];
this.allunittype.forEach(element => { this.allunittype.forEach((element) => {
this.unittype.push(element.id) this.unittype.push(element.id);
}); });
this.preparelevel = [1] this.preparelevel = [1];
this.dwaddtime = '2020-01-01'//单位查询开始时间 this.dwaddtime = "2020-01-01"; //单位查询开始时间
this.dwendtime = this.getNowFormatDate()//单位结束时间 this.dwendtime = this.getNowFormatDate(); //单位结束时间
this.unitIsFollowed = ""; //单位 重点
} else if (this.preparelevels == 1) { } else if (this.preparelevels == 1) {
this.yuanjs = this.organizationName this.yuanjs = this.organizationName;
this.yuanjsId = this.organizationId this.yuanjsId = this.organizationId;
this.yuanaddtime = '2020-01-01'//预案查询开始时间 this.yuanaddtime = "2020-01-01"; //预案查询开始时间
this.yuanendtime = this.getNowFormatDate()//预案查询结束时间 this.yuanendtime = this.getNowFormatDate(); //预案查询结束时间
this.yuanjscheck = true this.yuanjscheck = true;
this.reservePlanType = ['1', '2', '4', '16'] this.reservePlanType = ["1", "2", "4", "16"];
this.planCategory = ['1', '2', '3', '4', '5'] this.planCategory = ["1", "2", "3", "4", "5"];
this.planIsFollowed = ""; //预案 重点单位
} }
//重新获取初始化列表 //重新获取初始化列表
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
orRecord = [] orRecord = [];
//进入下一层 //进入下一层
clicktd(key, element) { clicktd(key, element) {
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
if (key == 0 && element != '合计') { if (key == 0 && element != "合计") {
let clickOr let clickOr;
this.allorganizations.forEach(item => { this.allorganizations.forEach((item) => {
if (element === item.name) { if (element === item.name) {
clickOr = item clickOr = item;
} }
}); });
// console.log(clickOr) // console.log(clickOr)
if (this.preparelevels == 0) { if (this.preparelevels == 0) {
if (element == this.js) { if (element == this.js) {
this.snackBar.open('已在当前查询的消防救援站下,无法下钻', '确定', config); this.snackBar.open(
return "已在当前查询的消防救援站下,无法下钻",
"确定",
config
);
return;
} }
} else if (this.preparelevels == 1) { } else if (this.preparelevels == 1) {
if (element == this.yuanjs) { if (element == this.yuanjs) {
this.snackBar.open('已在当前查询的消防救援站下,无法下钻', '确定', config); this.snackBar.open(
return "已在当前查询的消防救援站下,无法下钻",
"确定",
config
);
return;
} }
} }
if (clickOr.children.length == 0 && this.excelData.length == 1) { if (clickOr.children.length == 0 && this.excelData.length == 1) {
this.snackBar.open('无下级消防救援站,无法下钻', '确定', config); this.snackBar.open("无下级消防救援站,无法下钻", "确定", config);
return return;
} }
//记录点击过的消防救援站 //记录点击过的消防救援站
this.orRecord.push({ name: this.js, id: this.jsId }) this.orRecord.push({ name: this.js, id: this.jsId });
if (this.preparelevels == 0) { if (this.preparelevels == 0) {
this.js = element this.js = element;
this.jsId = clickOr.id this.jsId = clickOr.id;
} else if (this.preparelevels == 1) { } else if (this.preparelevels == 1) {
this.yuanjs = element this.yuanjs = element;
this.yuanjsId = clickOr.id this.yuanjsId = clickOr.id;
} }
console.log(this.orRecord) console.log(this.orRecord);
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
} }
goBack() { goBack() {
if (this.preparelevels == 0) { if (this.preparelevels == 0) {
this.js = this.orRecord[this.orRecord.length - 1].name this.js = this.orRecord[this.orRecord.length - 1].name;
this.jsId = this.orRecord[this.orRecord.length - 1].id this.jsId = this.orRecord[this.orRecord.length - 1].id;
} else if (this.preparelevels == 1) { } else if (this.preparelevels == 1) {
this.yuanjs = this.orRecord[this.orRecord.length - 1].name this.yuanjs = this.orRecord[this.orRecord.length - 1].name;
this.yuanjsId = this.orRecord[this.orRecord.length - 1].id this.yuanjsId = this.orRecord[this.orRecord.length - 1].id;
} }
this.orRecord.pop(); this.orRecord.pop();
console.log(this.orRecord) console.log(this.orRecord);
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
exal() { exal() {
var uri = 'data:application/vnd.ms-excel;base64,', var uri = "data:application/vnd.ms-excel;base64,",
template =
template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>', '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>',
base64 = function (s) { base64 = function (s) {
return window.btoa(unescape(encodeURIComponent(s)));
return window.btoa(unescape(encodeURIComponent(s)))
}, },
format = function (s, c) { format = function (s, c) {
return s.replace(/{(\w+)}/g, function (m, p) { return s.replace(/{(\w+)}/g, function (m, p) {
return c[p]; return c[p];
});
}) };
}
return function (table, name) { return function (table, name) {
if (!table.nodeType) table = document.getElementById(table); if (!table.nodeType) table = document.getElementById(table);
var ctx = { var ctx = {
worksheet: name || "Worksheet",
worksheet: name || 'Worksheet', table: table.innerHTML,
table: table.innerHTML
}; };
window.location.href = uri + base64(format(template, ctx)); window.location.href = uri + base64(format(template, ctx));
};
}
} }
export() { export() {
const httpOptions = { const httpOptions = {
responseType: 'blob' as 'json' responseType: "blob" as "json",
}; };
this.http.post(`/api/StatisticsAnalysis/Excel?queryMode=${this.preparelevels}`, this.excelData, httpOptions).subscribe((data: any) => { this.http
.post(
`/api/StatisticsAnalysis/Excel?queryMode=${this.preparelevels}`,
this.excelData,
httpOptions
)
.subscribe((data: any) => {
// // 文件名中有中文 则对文件名进行转码 // // 文件名中有中文 则对文件名进行转码
const link = document.createElement('a'); const link = document.createElement("a");
const blob = new Blob([data], { type: 'application/vnd.ms-excel' }); const blob = new Blob([data], { type: "application/vnd.ms-excel" });
link.setAttribute('href', window.URL.createObjectURL(blob)); link.setAttribute("href", window.URL.createObjectURL(blob));
link.setAttribute('download', '报表统计' + '.xls'); link.setAttribute("download", "报表统计" + ".xls");
link.style.visibility = 'hidden'; link.style.visibility = "hidden";
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
}) });
} }
} }

Loading…
Cancel
Save