邵佳豪
4 years ago
10 changed files with 678 additions and 41 deletions
@ -0,0 +1,153 @@
|
||||
<div class="header"> |
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm"> |
||||
<div class="queryBox"> |
||||
|
||||
<div class="queryField"> |
||||
<label style="margin-right: 10px;">单位名称:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input matInput placeholder="请输入单位名称" name="companyName" [(ngModel)]="companyName" autocomplete="off"> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
<div class="queryField ordiv"> |
||||
<label style="margin-right: 10px;">消防救援站:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input readonly matInput placeholder="请选择消防救援站" autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()"> |
||||
</mat-form-field> |
||||
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox> |
||||
<div class="organizationbox" *ngIf="isorganizationbox"> |
||||
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div> |
||||
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl"> |
||||
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist"> |
||||
<button type="button" mat-icon-button disabled ></button> |
||||
<li>{{node.name}}</li> |
||||
</mat-tree-node> |
||||
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist"> |
||||
<button |
||||
type="button" |
||||
mat-icon-button |
||||
matTreeNodeToggle |
||||
[attr.aria-label]="'toggle ' + node.name"> |
||||
<mat-icon class="mat-icon-rtl-mirror"> |
||||
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}} |
||||
</mat-icon> |
||||
</button> |
||||
<li>{{node.name}}</li> |
||||
</mat-tree-node> |
||||
</mat-tree> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="queryField"> |
||||
<label style="margin-right: 10px;">单位类型:</label> |
||||
<mat-form-field> |
||||
<mat-select placeholder='请选择单位类型' [(ngModel)]="unittype" name="unittype"> |
||||
<mat-option *ngFor="let unit of allunittype" [value]="unit.id" > |
||||
{{unit.name}} |
||||
</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="queryField"> |
||||
<label style="margin-right: 10px;">预案类型:</label> |
||||
<mat-form-field> |
||||
<mat-select [(ngModel)]="reservePlanType" name="reservePlanType" placeholder='请选择预案类型'> |
||||
<mat-option value="8">卡片预案</mat-option> |
||||
<mat-option value="1">二维预案</mat-option> |
||||
<mat-option value="2">三维预案</mat-option> |
||||
<mat-option value="4">其他预案</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
<div class="queryField"> |
||||
<label style="margin-right: 10px;">编制级别:</label> |
||||
<mat-form-field> |
||||
<mat-select [(ngModel)]="preparelevel" name="preparelevel" placeholder='请选择编制级别'> |
||||
<mat-option value="1">总队</mat-option> |
||||
<mat-option value="2">支队</mat-option> |
||||
<mat-option value="4">大队</mat-option> |
||||
<mat-option value="8">中队</mat-option> |
||||
<!-- <mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}</mat-option> --> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox> |
||||
</div> |
||||
<!-- <div class="queryField"> |
||||
<label style="margin-right: 10px;">添加时间:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input type="date" matInput name="addtime" autocomplete="off" [(ngModel)]="addtime"> |
||||
</mat-form-field> |
||||
🠊 |
||||
<mat-form-field class="example-full-width"> |
||||
<input type="date" matInput name="endtime" autocomplete="off" [(ngModel)]="endtime"> |
||||
</mat-form-field> |
||||
</div> --> |
||||
|
||||
</div> |
||||
<div class="butclass" style="width: 100%;text-align: center;"> |
||||
<button mat-raised-button color="primary" type="submit">查询</button> |
||||
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
<mat-divider></mat-divider> |
||||
<div class="body"> |
||||
<div class="tablebox"> |
||||
|
||||
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8"> |
||||
<ng-container matColumnDef="unitname"> |
||||
<th mat-header-cell *matHeaderCellDef>单位名称</th> |
||||
<td mat-cell *matCellDef="let element">{{element.companyName}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="planname"> |
||||
<th mat-header-cell *matHeaderCellDef>预案名称</th> |
||||
<td mat-cell *matCellDef="let element">{{element.name}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="addpeople"> |
||||
<th mat-header-cell *matHeaderCellDef>添加人</th> |
||||
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="level"> |
||||
<th mat-header-cell *matHeaderCellDef>预案级别</th> |
||||
<td mat-cell *matCellDef="let element">{{element.planCategory==1?'Ⅰ级预案':element.planCategory==2?'Ⅱ级预案': |
||||
element.planCategory==3?'Ⅲ级预案':element.planCategory==4?'Ⅳ级预案':element.planCategory==5?'Ⅴ级预案':element.planCategory==8?'类型预案':'应急预案'}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="addtime"> |
||||
<th mat-header-cell *matHeaderCellDef>添加时间</th> |
||||
<td mat-cell *matCellDef="let element">{{element.creationTime | date:'yyyy-MM-dd'}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="plantype"> |
||||
<th mat-header-cell *matHeaderCellDef>预案类型</th> |
||||
<td mat-cell *matCellDef="let element">二维预案</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="auditStatus"> |
||||
<th mat-header-cell *matHeaderCellDef>审核状态</th> |
||||
<td mat-cell *matCellDef="let element">{{element.auditStatus | auditsatus}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="openRange"> |
||||
<th mat-header-cell *matHeaderCellDef>是否公开</th> |
||||
<td mat-cell *matCellDef="let element">{{element.openRange}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="projectlevel"> |
||||
<th mat-header-cell *matHeaderCellDef>编制级别</th> |
||||
<td mat-cell *matCellDef="let element">{{element.planLevel | planlevel}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="operation"> |
||||
<th mat-header-cell *matHeaderCellDef>操作</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
<span style="color: blue;cursor: pointer;" (click)="openPlan(element)">查看预案</span> |
||||
</td> |
||||
</ng-container> |
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> |
||||
</table> |
||||
<mat-paginator |
||||
[length]="length" |
||||
[pageSize]="pageSize" |
||||
[pageSizeOptions]="pageSizeOptions" |
||||
(page)="chagePage($event)"> |
||||
</mat-paginator> |
||||
|
||||
</div> |
||||
</div> |
@ -0,0 +1,215 @@
|
||||
.header { |
||||
width: 100%; |
||||
padding: 12px 10px; |
||||
box-sizing: border-box; |
||||
.queryBox { |
||||
box-sizing: border-box; |
||||
padding: 5px 25px 0 25px; |
||||
// margin-left: 50px; |
||||
display: flex; |
||||
flex-direction: row; |
||||
flex-wrap: wrap; |
||||
align-items:center; |
||||
// justify-content:center; |
||||
.queryField { |
||||
margin: 0 40px; |
||||
input { |
||||
width: 180px; |
||||
height: 22px; |
||||
line-height: 22px; |
||||
border-radius: 3px;} |
||||
} |
||||
|
||||
} //queryBox |
||||
.butclass{ |
||||
button{ |
||||
width: 80px;height: 36px; |
||||
font-size: 16px; |
||||
} |
||||
} |
||||
.ordiv{ |
||||
position: relative; |
||||
.organizationbox{ |
||||
width:450px; |
||||
height: 200px; |
||||
background: white; |
||||
position: absolute; |
||||
top: 48px; |
||||
left: 77px; |
||||
z-index: 999; |
||||
border: 1px solid grey; |
||||
overflow-y: auto; |
||||
li{ |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
white-space: nowrap; |
||||
} |
||||
mat-tree-node{ |
||||
cursor: pointer; |
||||
white-space:pre; |
||||
} |
||||
mat-tree-node:hover{ |
||||
background: rgba(225, 225, 225, 0.8); |
||||
} |
||||
.closediv{ |
||||
z-index: 100; |
||||
position: absolute; |
||||
right: 0; |
||||
top: 0; |
||||
width: 30px; |
||||
height: 30px; |
||||
cursor: pointer; |
||||
line-height: 30px; |
||||
text-align: center; |
||||
} |
||||
.closediv:hover{ |
||||
background:rgba(225, 225, 225, 0.8); |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
||||
.body{ |
||||
.buttonbox{ |
||||
padding-left: 50px; |
||||
button{ |
||||
margin:0 10px |
||||
} |
||||
} |
||||
.tablebox{ |
||||
table{ |
||||
width: 100%; |
||||
// margin-left: 2%; |
||||
margin-top: 15px; |
||||
} |
||||
mat-paginator{ |
||||
width:100%; |
||||
// margin-left: 2%; |
||||
// margin-top: 30px; |
||||
} |
||||
} |
||||
} |
||||
.mat-header-cell{ |
||||
text-align: center; |
||||
} |
||||
.mat-cell{ |
||||
text-align: center; |
||||
|
||||
} |
||||
|
||||
//完整度 |
||||
.integrityDiv{ |
||||
width: 180px; |
||||
height: 30px; |
||||
background-color: #e2e7ee; |
||||
// background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32); |
||||
margin: 0 auto; |
||||
position: relative; |
||||
.integrityNum{ |
||||
position: absolute; |
||||
left: 50%; |
||||
top: 50%; |
||||
transform: translate(-50%, -50%); |
||||
color: black; |
||||
font-weight: 800; |
||||
font-size: 15px; |
||||
cursor: default; |
||||
} |
||||
.integrityColorDiv{ |
||||
height: 100%; |
||||
} |
||||
.integrityDetails{ |
||||
position: absolute; |
||||
display: none; |
||||
width: 350px; |
||||
height:280px; |
||||
border: 1px solid rgba(0, 0, 0, 0.22); |
||||
background-color: white; |
||||
.integrityDetailsTop{ |
||||
width: 100%; |
||||
height: 23px; |
||||
line-height:23px; |
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.22); |
||||
margin-bottom: 1px; |
||||
font-size: 14px; |
||||
span{ |
||||
display: inline-block; |
||||
text-align: center; |
||||
font-weight: 800; |
||||
} |
||||
.span1{ |
||||
width: 25%; |
||||
} |
||||
.span2{ |
||||
width: 60%; |
||||
} |
||||
.span3{ |
||||
width: 15%; |
||||
} |
||||
} |
||||
.integrityDetailsBody{ |
||||
ul{ |
||||
li{ |
||||
width: 100%; |
||||
height: 23px; |
||||
line-height: 23px; |
||||
margin: 3px 0; |
||||
div{ |
||||
float: left; |
||||
font-size: 13px; |
||||
} |
||||
.name{ |
||||
width: 25%; |
||||
height: 100%; |
||||
} |
||||
.colorDiv{ |
||||
width: 60%; |
||||
height: 100%; |
||||
position: relative; |
||||
.colorDivBac{ |
||||
width: 90%; |
||||
height: 100%; |
||||
position: absolute; |
||||
left: 50%; |
||||
top: 50%; |
||||
transform: translate(-50%,-50%); |
||||
background-color: #dfe5ec; |
||||
border-radius: 5px; |
||||
.colorDivCon{ |
||||
border-radius: 5px; |
||||
height: 100%; |
||||
background-color: #2398f1; |
||||
} |
||||
} |
||||
span{ |
||||
position: absolute; |
||||
left: 50%; |
||||
top: 50%; |
||||
transform: translate(-50%,-50%); |
||||
// color: white; |
||||
font-weight: 600; |
||||
} |
||||
} |
||||
.number{ |
||||
width: 15%; |
||||
height: 100%; |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
||||
.bottomposition{ |
||||
top: 2px; |
||||
left: 188px; |
||||
} |
||||
.topposition{ |
||||
top: -252px; |
||||
left: 188px; |
||||
} |
||||
} |
||||
.integrityDiv:hover{ |
||||
.integrityDetails{ |
||||
display: block; |
||||
} |
||||
} |
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { ReinforcePlanComponent } from './reinforce-plan.component'; |
||||
|
||||
describe('ReinforcePlanComponent', () => { |
||||
let component: ReinforcePlanComponent; |
||||
let fixture: ComponentFixture<ReinforcePlanComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ ReinforcePlanComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(ReinforcePlanComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,218 @@
|
||||
import { Component, OnInit, ViewChild, Inject } from '@angular/core'; |
||||
import { HttpClient } from '@angular/common/http' |
||||
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; |
||||
import { MatPaginator } from '@angular/material/paginator'; |
||||
import { FlatTreeControl } from '@angular/cdk/tree'; |
||||
import { FormControl } from '@angular/forms'; |
||||
import { Router,ActivatedRoute } from '@angular/router' |
||||
import { PageEvent } from '@angular/material/paginator'; |
||||
import { 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'; |
||||
declare var CryptoJS |
||||
@Component({ |
||||
selector: 'app-reinforce-plan', |
||||
templateUrl: './reinforce-plan.component.html', |
||||
styleUrls: ['./reinforce-plan.component.scss'] |
||||
}) |
||||
export class ReinforcePlanComponent implements OnInit { |
||||
|
||||
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } |
||||
|
||||
private _transformer = (node, level: number) => { //初始化tree
|
||||
return { |
||||
expandable: !!node.children && node.children.length > 0, |
||||
name: node.name, |
||||
level: level, |
||||
id: node.id, |
||||
parentId: node.parentId, |
||||
children: node.children |
||||
}; |
||||
} |
||||
treeControl = new FlatTreeControl<any>(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); |
||||
myControl = new FormControl(); |
||||
hasChild = (_: number, node: any) => node.expandable; |
||||
//分页
|
||||
@ViewChild(MatPaginator, {static: true})
|
||||
pageEvent: PageEvent; |
||||
paginator: MatPaginator; |
||||
length:any; //共多少条数据
|
||||
pageSize:any; //每页条数
|
||||
pageSizeOptions: number[] = [10] //设置每页条数
|
||||
PageNumber:any; //第几页
|
||||
|
||||
displayedColumns: string[] = ['unitname','planname', 'addpeople','level','addtime','plantype','auditStatus','openRange','projectlevel','operation']; |
||||
allorganizations:any //所有组织机构
|
||||
allunittype:any //所有单位类型
|
||||
tabledataSource:any //表格数据
|
||||
|
||||
preparelevels:any |
||||
ngOnInit(): void { |
||||
this.getunitdata(); |
||||
this.getOrganizations(); |
||||
this.getUnittype(); |
||||
this.getAllPlanInfo(); |
||||
let level = sessionStorage.getItem("level"); |
||||
if(level == "0"){//如果是总队
|
||||
this.preparelevels = [ |
||||
{name:"总队",value:"1"}, |
||||
{name:"支队",value:"2"}, |
||||
{name:"大队",value:"4"}, |
||||
{name:"中队",value:"8"} |
||||
] |
||||
} |
||||
if(level == "1"){//如果是支队
|
||||
this.preparelevels = [ |
||||
{name:"支队",value:"2"}, |
||||
{name:"大队",value:"4"}, |
||||
{name:"中队",value:"8"} |
||||
] |
||||
} |
||||
if(level == "2"){//如果是大队
|
||||
this.preparelevels = [ |
||||
{name:"大队",value:"4"}, |
||||
{name:"中队",value:"8"} |
||||
] |
||||
} |
||||
if(level == "3"){//如果是中队
|
||||
this.preparelevels = [ |
||||
{name:"中队",value:"8"} |
||||
] |
||||
} |
||||
} |
||||
|
||||
allPlanInfo:any //存储所有预案信息
|
||||
//获得所有预案信息
|
||||
getAllPlanInfo(){ |
||||
let paramsdata:any = { |
||||
CompanyName: this.companyName || '', |
||||
OrganizationId: this.jsId || '', |
||||
HasChildrenOrganization:this.jscheck || '', |
||||
BuildingTypeId: this.unittype || '', |
||||
PlanType: this.reservePlanType || '', |
||||
AuditStatus:'', //审核状态
|
||||
PlanLevel: this.preparelevel || '', |
||||
HasChildrenPlanLevel: this.plcheck || '', |
||||
CreationTimeRangeStart:this.addtime||'', |
||||
CreationTimeRangeEnd:this.endtime||'', |
||||
PageNumber: this.PageNumber || '1', |
||||
PageSize: this.pageSizeOptions[0], |
||||
Sort: '' |
||||
} |
||||
this.http.get("/api/ApprovedPlans/GetReinforcementPlanComponents",{params:paramsdata}).subscribe((data:any)=>{ |
||||
console.log('增援预案列表',data) |
||||
this.length = data.totalCount |
||||
this.allPlanInfo = data |
||||
this.tabledataSource = data.items
|
||||
}) |
||||
} |
||||
|
||||
//得到当前单位信息
|
||||
getunitdata(){ |
||||
this.http.get("/api/Account/Profiles").subscribe( |
||||
(data:any)=>{ |
||||
this.organizationName = data.organizationName |
||||
} |
||||
) |
||||
} |
||||
addtime//开始时间
|
||||
endtime//结束时间
|
||||
integrityScoreMin//完整度最小值
|
||||
integrityScoreMax//完整度最大值
|
||||
organizationName:any //当前单位组织机构名称
|
||||
treedata:any //组织机构树型数据
|
||||
newArr:any = [] |
||||
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段
|
||||
//获得所有组织机构
|
||||
getOrganizations(){ |
||||
this.http.get('/api/Organizations').subscribe( |
||||
(data:any)=>{ |
||||
this.allorganizations = data |
||||
this.dataSource.data = this.tree.toTree(data); |
||||
} |
||||
) |
||||
} |
||||
|
||||
//获得所有单位类型
|
||||
getUnittype(){ |
||||
this.http.get('/api/BuildingTypes/Simple').subscribe( |
||||
data=>{ |
||||
this.allunittype = data |
||||
} |
||||
) |
||||
} |
||||
//分页事件
|
||||
chagePage(e){ |
||||
this.PageNumber = e.pageIndex+1 |
||||
this.getAllPlanInfo(); |
||||
} |
||||
|
||||
//辖区中队div是否显示
|
||||
isorganizationbox:boolean = false |
||||
//点击辖区中队树,将选择的辖区中队添加到变量
|
||||
add(node) { |
||||
this.isorganizationbox = false |
||||
this.js = node.name |
||||
this.jsId = node.id |
||||
} |
||||
//关闭辖区中队隐藏框
|
||||
closeorganizationbox() { |
||||
this.isorganizationbox = false |
||||
} |
||||
//打开辖区中队隐藏框
|
||||
openorganizationbox() { |
||||
this.isorganizationbox = true |
||||
} |
||||
//关闭出现的组织机构div
|
||||
closediv(){ |
||||
this.isorganizationbox = false |
||||
} |
||||
//查询
|
||||
onSubmit (e) { |
||||
this.PageNumber = 1 |
||||
this.pageEvent.pageIndex = 0 |
||||
this.getAllPlanInfo(); |
||||
} |
||||
companyName:any //单位名称
|
||||
js:any //所选组织机构
|
||||
jsId:any //所选组织机构的id
|
||||
jscheck:boolean //所选组织机构勾选框
|
||||
unittype:any //单位类型
|
||||
reservePlanType:any //预案类型
|
||||
preparelevel:any //编制级别
|
||||
plcheck:boolean //编制级别勾选框
|
||||
//重置
|
||||
reset(){ |
||||
this.companyName = '' |
||||
this.js = '' |
||||
this.jsId = '' |
||||
this.jscheck = false |
||||
this.unittype = '' |
||||
this.reservePlanType = '' |
||||
this.preparelevel = '' |
||||
this.addtime='' |
||||
this.endtime='' |
||||
this.plcheck = false |
||||
//重新获取初始化列表
|
||||
this.pageEvent.pageIndex = 0 |
||||
this.PageNumber = 1 |
||||
this.getAllPlanInfo(); |
||||
|
||||
} |
||||
|
||||
//查看预案
|
||||
openPlan(e){ |
||||
console.log(e) |
||||
let id = e.id
|
||||
sessionStorage.setItem("planId",id) |
||||
sessionStorage.setItem("companyId",e.companyId) |
||||
//sessionStorage.setItem("buildingTypeId",this.unittypeId)
|
||||
sessionStorage.setItem("editable","0") |
||||
sessionStorage.setItem("planName",e.name) |
||||
let companyId = sessionStorage.getItem("companyId") |
||||
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}&orName=${e.company.organizationName}&orId=${e.company.organizationId}`); |
||||
} |
||||
} |
Loading…
Reference in new issue