Browse Source

[完善]证照预警搜索完善

beijing
邵佳豪 3 years ago
parent
commit
1443e52e3b
  1. 17
      src/app/pages/warning-statistics-list/warning-statistics-list.component.html
  2. 4
      src/app/pages/warning-statistics-list/warning-statistics-list.component.scss
  3. 48
      src/app/pages/warning-statistics-list/warning-statistics-list.component.ts

17
src/app/pages/warning-statistics-list/warning-statistics-list.component.html

@ -56,17 +56,26 @@
<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
<nz-form-item class="searchParams searchParamsLong">
<nz-form-control>
<nz-select [nzAllowClear]="false" nzAllowClear formControlName="eventSystemName"
nzPlaceHolder="请选择状态">
<nz-select (ngModelChange)="typeChange($event)" nzAllowClear nzAllowClear
formControlName="eventSystemName" nzPlaceHolder="请选择状态">
<nz-option *ngFor="let item of eventSystemNameOption" [nzValue]="item.id"
[nzLabel]="item.name"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams searchParamsLongLong eventInput" *ngIf="isListOfData">
<nz-form-control>
<nz-select [nzMaxTagCount]="1" nzMode="multitagsple" nzAllowClear formControlName="licenseType"
nzPlaceHolder="请选择证照类型">
<nz-option *ngFor="let item of listOfData" [nzValue]="item.id" [nzLabel]="item.licenseName">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams searchParamsLong" *ngIf="isOrShow">
<nz-form-control>
<nz-tree-select [nzAllowClear]="false" [nzDropdownClassName]="'maxHeightTreeSelect'"
nzShowSearch [(ngModel)]="defaultOrId" formControlName="organization" [nzNodes]="nodes"
<nz-tree-select nzAllowClear [nzDropdownClassName]="'maxHeightTreeSelect'" nzShowSearch
[(ngModel)]="defaultOrId" formControlName="organization" [nzNodes]="nodes"
nzPlaceHolder="请选择所属机构" [nzExpandedIcon]="multiExpandedIconTpl">
</nz-tree-select>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">

4
src/app/pages/warning-statistics-list/warning-statistics-list.component.scss

@ -32,7 +32,9 @@
.searchParamsLong {
width: 250px;
}
.searchParamsLongLong {
width: 300px;
}
.searchParams2 {
width: 220px;
}

48
src/app/pages/warning-statistics-list/warning-statistics-list.component.ts

@ -39,6 +39,7 @@ export class WarningStatisticsListComponent implements OnInit {
tableScrollHeight
resizeListener
ngOnInit(): void {
this.getLicense()
this.tableScrollHeight = '100px'
// 页面监听
this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => {
@ -75,6 +76,7 @@ export class WarningStatisticsListComponent implements OnInit {
this.validateForm = this.fb.group({
eventSystemName: null,
organization: [null],
licenseType: [null],
datePicker: [[this.startdate, this.enddate]]
});
@ -94,6 +96,46 @@ export class WarningStatisticsListComponent implements OnInit {
ngOnDestroy(): void {
this.resizeListener.unsubscribe()
}
listOfData//证照列表
//获取证照列表
getLicense() {
let params = {
SkipCount: '0',
MaxResultCount: '999'
}
this.http.get('/api/services/app/ValidityLicenseType/GetAll', {
params: params
}).subscribe((data: any) => {
console.log('证照列表', data.result.items)
this.listOfData = data.result.items
})
}
isListOfData = false
typeChange(e) {
if (e) {
let obj
this.eventSystemNameOption.forEach(item => {
if (item.id == e) {
obj = item
}
})
if (obj.name == '证照预警') {
this.isListOfData = true
} else {
this.isListOfData = false
this.validateForm.patchValue({
licenseType: []
});
}
} else {
this.isListOfData = false
this.validateForm.patchValue({
licenseType: []
});
}
}
//刷新饼图图表数据
num
echartsData: any
@ -578,17 +620,20 @@ export class WarningStatisticsListComponent implements OnInit {
ViolationIds.push(element.id)
});
}
console.log('xxx',this.validateForm.value.licenseType)
let params = {
ViolationIds: ViolationIds,
organizationUnitId: organizationUnitId,
ViolateTime: (this.validateForm.value.datePicker[0] && this.validateForm.value.datePicker[1]) ? [moment(this.validateForm.value.datePicker[0]).format('yyyy-MM-DD') + ' 00:00:00', moment(this.validateForm.value.datePicker[1]).format('yyyy-MM-DD') + ' 23:59:59'] : null,
IsContainsChildren: 'true',
SkipCount: this.SkipCount,
ValidityLicenseTypeIds: this.validateForm.value.licenseType,
MaxResultCount: '50'
}
this.http.get('/api/services/app/ViolateRecord/GetAll', {
params: params
}).subscribe((data: any) => {
console.log('证照预警列表', data.result.items)
this.tableSpin = false
data.result.items.forEach(element => {
element.violatedItemSnapshotObj = JSON.parse(element.violatedItemSnapshot)
@ -597,7 +642,7 @@ export class WarningStatisticsListComponent implements OnInit {
this.list = [...this.list]
this.totalCount = data.result.totalCount
this.isLoading = false
console.log('证照预警列表', data.result.items)
setTimeout(() => {
let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px'
@ -666,6 +711,7 @@ export class WarningStatisticsListComponent implements OnInit {
this.validateForm.patchValue({
datePicker: [this.startdate, this.enddate],
eventSystemName: null,
licenseType: [],
organization: JSON.parse(sessionStorage.getItem('userdata')).organization.id
});
this.totalCount = null

Loading…
Cancel
Save