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.
97 lines
3.3 KiB
97 lines
3.3 KiB
/* |
|
* @Descripttion: |
|
* @version: |
|
* @Author: sueRimn |
|
* @Date: 2021-03-05 15:57:08 |
|
* @LastEditors: sueRimn |
|
* @LastEditTime: 2021-03-25 10:34:49 |
|
*/ |
|
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 { MatTableDataSource } from '@angular/material/table'; |
|
declare var CryptoJS |
|
|
|
@Component({ |
|
selector: 'app-compang-info', |
|
templateUrl: './compang-info.component.html', |
|
styleUrls: ['./compang-info.component.scss'] |
|
}) |
|
export class CompangInfoComponent implements OnInit{ |
|
|
|
constructor(private http: HttpClient,public snackBar: MatSnackBar,public route: ActivatedRoute,private router: Router) {} |
|
|
|
ngOnInit(): void { |
|
this.route.queryParams.subscribe(params => { |
|
this.titlename = params['name']; |
|
this.type = params['type']; |
|
this.jsId=params['jsid'] |
|
this.BuildingTypeId=params['buildid'] |
|
}); |
|
this.getAlltabledate() |
|
} |
|
displayedColumns: string[] = ['unitname','modifiedTime','organizationName','buildingTypes','operation']; |
|
tabledataSource |
|
titlename //上个页面传过来的名称 |
|
type //上个页面传过来:1重点单位 2预案 |
|
jsId //组织机构id |
|
BuildingTypeId//建筑类型id |
|
//分页 |
|
@ViewChild(MatPaginator, {static: true}) |
|
pageEvent: PageEvent; |
|
paginator: MatPaginator; |
|
length:any; //共多少条数据 |
|
pageSize:any; //每页条数 |
|
pageSizeOptions: number[] = [10] //设置每页条数 |
|
PageNumber:any; //第几页 |
|
//分页事件 |
|
changePage(e){ |
|
this.PageNumber = e.pageIndex+1 |
|
this.getAlltabledate() |
|
} |
|
//返回 |
|
goBack () { |
|
sessionStorage.setItem('refresh', 'true'); |
|
history.go(-1); |
|
//this.echartsData.statefulInspectionToggle = true |
|
} |
|
|
|
//获取表格数据 |
|
getAlltabledate(){ |
|
if(this.type==1){ |
|
//重点单位 |
|
let paramsdata:any = { |
|
OrganizationId: this.jsId || '', |
|
BuildingTypeId:this.BuildingTypeId|| '', |
|
PageNumber: this.PageNumber || '1', |
|
PageSize: this.pageSizeOptions[0], |
|
IntegrityScoreMin:0, |
|
IntegrityScoreMax:1 |
|
} |
|
this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any)=>{ |
|
this.length = data.totalCount |
|
//console.log(789,data.items) |
|
this.tabledataSource = new MatTableDataSource(data.items); |
|
}) |
|
} |
|
} |
|
//跳转查看基本信息页面 |
|
unitdetails(element){ |
|
if(this.type==1){ |
|
sessionStorage.setItem("editable","0") |
|
sessionStorage.setItem("companyName",element.name) |
|
sessionStorage.setItem("companyId",element.id) |
|
sessionStorage.setItem(element.id,JSON.stringify(element.companyIntegrityScore)) |
|
window.open(`/keyUnit/viewunitinfo?id=${element.id}&usci=${element.usci}`,'_blank'); |
|
} |
|
|
|
} |
|
}
|
|
|