You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
128 lines
3.9 KiB
128 lines
3.9 KiB
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' |
|
|
|
@Component({ |
|
selector: 'app-meet-plan', |
|
templateUrl: './meet-plan.component.html', |
|
styleUrls: ['./meet-plan.component.scss'] |
|
}) |
|
export class MeetPlanComponent implements OnInit { |
|
|
|
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } |
|
|
|
ngOnInit(): void { |
|
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"} |
|
] |
|
} |
|
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) |
|
} |
|
|
|
url |
|
preparelevels:any |
|
plcheck:boolean //编制级别勾选框 |
|
displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation']; |
|
tabledataSource |
|
unitname//预案名称 |
|
level//预案级别 |
|
addname//添加人 |
|
addtime//添加时间 |
|
unittype//预案类型 |
|
unitstate//审核状态 |
|
projectlevel//编制级别 |
|
//分页 |
|
@ViewChild(MatPaginator, {static: true}) |
|
pageEvent: PageEvent; |
|
paginator: MatPaginator; |
|
length:any; //共多少条数据 |
|
pageSize:any; //每页条数 |
|
pageSizeOptions: number[] = [10] //设置每页条数 |
|
PageNumber:any; //第几页 |
|
|
|
//获得所有预案信息 |
|
getAllPlanInfo(){ |
|
let paramsdata:any = { |
|
HasChildrenPlanLevel: this.plcheck || '', |
|
PageNumber: this.PageNumber || '1', |
|
PageSize: this.pageSizeOptions[0], |
|
} |
|
this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
this.length = data.totalCount |
|
//this.allPlanInfo = data |
|
|
|
//this.tabledataSource = new MatTableDataSource(data.items) |
|
console.log(this.tabledataSource) |
|
}) |
|
} |
|
|
|
//重置 |
|
reset(){ |
|
this.unitname='' |
|
this.level='' |
|
this.addname='' |
|
this.addtime='' |
|
this.unittype='' |
|
this.unitstate='' |
|
this.projectlevel='' |
|
} |
|
//新增预案弹窗 |
|
addunit(){ |
|
const dialogRef = this.dialog.open(newunitMeet, { |
|
width: '340px', |
|
height:'430px' |
|
//data: paperDataInfo |
|
}); |
|
} |
|
} |
|
|
|
@Component({ |
|
selector: 'new-unit', |
|
templateUrl: './newunit.html', |
|
styleUrls: ['./newunit.scss'] |
|
}) |
|
export class newunitMeet{ |
|
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<newunitMeet>,@Inject(MAT_DIALOG_DATA) public data: any) {} |
|
unitname//预案名称 |
|
level//预案级别 |
|
addname//添加人 |
|
addtime//添加时间 |
|
unittype//预案类型 |
|
unitstate//审核状态 |
|
projectlevel//编制级别 |
|
close(){ |
|
this.dialogRef.close(); |
|
} |
|
}
|
|
|