From c0d44e9d608542ca4b63fcf0a111b8df0b82dc85 Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Sat, 6 Mar 2021 14:21:33 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E7=BB=BC=E5=90=88=E5=88=86?= =?UTF-8?q?=E6=9E=90=E4=B8=AD=E9=98=9F=E8=B7=B3=E8=BD=AC=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E9=87=8D=E7=82=B9=E5=8D=95=E4=BD=8D=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../add-unit-three-bar-details.component.ts | 5 +- .../add-unit-two-type-details.component.ts | 2 +- .../building-type-three-details.component.ts | 3 + .../compang-info/compang-info.component.html | 54 +++++++++++++- .../compang-info/compang-info.component.scss | 73 +++++++++++++++++++ .../compang-info/compang-info.component.ts | 62 +++++++++++++++- .../statistic-analysis-routing.module.ts | 6 +- 7 files changed, 195 insertions(+), 10 deletions(-) diff --git a/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts b/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts index 01ded3e..788ca67 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts +++ b/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts @@ -163,10 +163,7 @@ export class AddUnitThreeBarDetailsComponent implements OnInit { this.option.series[0].data = this.zhongNumData this.detailPlanEchart.setOption(this.option) }else{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('已到达最底层','确定',config); + this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}}); } }) } diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts b/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts index 131fb05..31d3d8e 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts +++ b/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts @@ -125,7 +125,7 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit { }; this.detailPlanEchart.setOption(option); this.detailPlanEchart.on('click', (params) => { - //this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse'],{queryParams:{'level':params.name}}); + this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}}); /* const dialogRef = this.dialog.open(CompangInfoComponent, { width:"400px", }); */ diff --git a/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts b/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts index 5ca8635..6a9e16c 100644 --- a/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts +++ b/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts @@ -109,6 +109,9 @@ export class BuildingTypeThreeDetailsComponent implements OnInit { }] }; this.detailPlanEchart.setOption(option); + this.detailPlanEchart.on('click', (params) => { + this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}}); + }); } diff --git a/src/app/statistic-analysis/compang-info/compang-info.component.html b/src/app/statistic-analysis/compang-info/compang-info.component.html index 570e913..557c6fd 100644 --- a/src/app/statistic-analysis/compang-info/compang-info.component.html +++ b/src/app/statistic-analysis/compang-info/compang-info.component.html @@ -1 +1,53 @@ -

compang-info works!

+ +
+
+
+ +
+
+
+ {{titlename}} +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
名称{{element.name}}修改时间{{element.modifiedTime|date:'yyyy-MM-dd'}}消防救援站{{element.organizationName}}类型{{element.buildingTypes.length != 0 ? element.buildingTypes[0].name : ''}}操作 + 详情 +
+ + + + +
+
diff --git a/src/app/statistic-analysis/compang-info/compang-info.component.scss b/src/app/statistic-analysis/compang-info/compang-info.component.scss index e69de29..dceb5cf 100644 --- a/src/app/statistic-analysis/compang-info/compang-info.component.scss +++ b/src/app/statistic-analysis/compang-info/compang-info.component.scss @@ -0,0 +1,73 @@ +.body{ + display: flex; + flex-direction: column; + .topbox{ + width: 100%; + height: 80px; + min-height: 80px; + border-bottom: 1px gray solid; + .btnbox{ + display: flex; + flex-direction:row-reverse; + float: right; + justify-content: center; + align-items: center; + height: 100%; + button{ + width: 88px; + height: 36px; + } + margin-right:4%; + + } + } + .title{ + width: 100%; + text-align: center; + margin-top: 2%; + span{ + text-align: center; + font-size: 28px; + } + } + .buttonbox{ + padding-left: 50px; + button{ + margin:0 10px + } + } + .tablebox{ + width: 100%; + text-align: center; + table{ + width: 50%; + text-align: center; + margin-left: 25%; + margin-top:20px; + th,td{ + text-align: center; + font-size: 15px; + color: #000000; + } + } + mat-paginator{ + width: 100%; + margin-left: 0%; + } + .mat-column-unitname{ + width: 15%; + } + .mat-column-integrity{ + width: 13%; + } + .mat-column-operation{ + width: 5%; + } + .mat-column-jurisdictionsquadron{ + width: 10%; + } + span:hover{ + text-decoration:underline + } + } +} \ No newline at end of file diff --git a/src/app/statistic-analysis/compang-info/compang-info.component.ts b/src/app/statistic-analysis/compang-info/compang-info.component.ts index 99bee14..73a020b 100644 --- a/src/app/statistic-analysis/compang-info/compang-info.component.ts +++ b/src/app/statistic-analysis/compang-info/compang-info.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-03-05 15:57:08 * @LastEditors: sueRimn - * @LastEditTime: 2021-03-06 08:43:10 + * @LastEditTime: 2021-03-06 11:35:04 */ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http' @@ -17,6 +17,7 @@ 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({ @@ -26,9 +27,66 @@ declare var CryptoJS }) export class CompangInfoComponent implements OnInit{ - constructor(private http: HttpClient,public snackBar: MatSnackBar) {} + 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.getAlltabledate() + } + displayedColumns: string[] = ['unitname','modifiedTime','organizationName','buildingTypes','operation']; + tabledataSource + titlename //上个页面传过来的名称 + type //上个页面传过来:1重点单位 2预案 + jsId=1 //组织机构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 () { + history.go(-1) + //this.echartsData.statefulInspectionToggle = true } + //获取表格数据 + getAlltabledate(){ + if(this.type==1){ + //重点单位 + let paramsdata:any = { + OrganizationId: this.jsId || '', + 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'); + } + + } } diff --git a/src/app/statistic-analysis/statistic-analysis-routing.module.ts b/src/app/statistic-analysis/statistic-analysis-routing.module.ts index 51f4226..ed3ef96 100644 --- a/src/app/statistic-analysis/statistic-analysis-routing.module.ts +++ b/src/app/statistic-analysis/statistic-analysis-routing.module.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-09-02 16:57:00 * @LastEditors: sueRimn - * @LastEditTime: 2020-11-05 11:07:16 + * @LastEditTime: 2021-03-06 09:50:16 */ import { Component, NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; @@ -33,6 +33,7 @@ import { AddUnitThreeLineDetailsComponent } from './addUnit/add-unit-three-line- import { AddUnitThreeBarDetailsComponent } from './addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component'; import { HomeComponent } from './home/home.component'; import { yueDateComponent }from './scheduled-updates/scheduled-updates.component' +import { CompangInfoComponent }from './compang-info/compang-info.component' import { from } from 'rxjs'; @@ -65,7 +66,8 @@ const routes: Routes = [ { path: 'scheduledUpdates', component: ScheduledUpdatesComponent}, { path: 'scheduledUpdates/yueDate', component: yueDateComponent}, { path: 'scheduledUpdates/PublicEcharts', component: publicEchartsComponent}, - { path: 'home', component: HomeComponent} + { path: 'home', component: HomeComponent}, + { path: 'CompangInfo',component:CompangInfoComponent} ]; @NgModule({