|
|
@ -1,5 +1,6 @@ |
|
|
|
import { HttpClient } from "@angular/common/http"; |
|
|
|
import { HttpClient } from "@angular/common/http"; |
|
|
|
import { Component, OnInit } from "@angular/core"; |
|
|
|
import { Component, OnInit } from "@angular/core"; |
|
|
|
|
|
|
|
import { FormBuilder, FormGroup } from "@angular/forms"; |
|
|
|
import { NzMessageService } from "ng-zorro-antd/message"; |
|
|
|
import { NzMessageService } from "ng-zorro-antd/message"; |
|
|
|
import { NzFormatEmitEvent } from "ng-zorro-antd/tree"; |
|
|
|
import { NzFormatEmitEvent } from "ng-zorro-antd/tree"; |
|
|
|
import { TreeService } from "src/app/service/tree.service"; |
|
|
|
import { TreeService } from "src/app/service/tree.service"; |
|
|
@ -13,17 +14,33 @@ export class AlgorithmConfigComponent implements OnInit { |
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
private http: HttpClient, |
|
|
|
private http: HttpClient, |
|
|
|
private toTree: TreeService, |
|
|
|
private toTree: TreeService, |
|
|
|
private message: NzMessageService |
|
|
|
private message: NzMessageService, |
|
|
|
|
|
|
|
private fb: FormBuilder |
|
|
|
) {} |
|
|
|
) {} |
|
|
|
|
|
|
|
validateForm!: FormGroup; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submitForm(): void { |
|
|
|
|
|
|
|
console.log("submit", this.validateForm.value); |
|
|
|
|
|
|
|
this.StationName = this.validateForm.value.name; |
|
|
|
|
|
|
|
this.SkipCount = 0; |
|
|
|
|
|
|
|
this.getStationViolationConfigList(); |
|
|
|
|
|
|
|
} |
|
|
|
OrganizationUnitId: string; |
|
|
|
OrganizationUnitId: string; |
|
|
|
|
|
|
|
level; |
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
|
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
|
|
|
|
name: [null], |
|
|
|
|
|
|
|
}); |
|
|
|
this.OrganizationUnitId = |
|
|
|
this.OrganizationUnitId = |
|
|
|
sessionStorage.getItem("isGasStation") == "true" |
|
|
|
sessionStorage.getItem("isGasStation") == "true" |
|
|
|
? JSON.parse(sessionStorage.getItem("userdataOfgasstation")) |
|
|
|
? JSON.parse(sessionStorage.getItem("userdataOfgasstation")) |
|
|
|
.organization.id |
|
|
|
.organization.id |
|
|
|
: JSON.parse(sessionStorage.getItem("userdata")).organization.id; |
|
|
|
: JSON.parse(sessionStorage.getItem("userdata")).organization.id; |
|
|
|
|
|
|
|
this.level = |
|
|
|
|
|
|
|
sessionStorage.getItem("isGasStation") == "true" |
|
|
|
|
|
|
|
? JSON.parse(sessionStorage.getItem("userdataOfgasstation")) |
|
|
|
|
|
|
|
.organization.level |
|
|
|
|
|
|
|
: JSON.parse(sessionStorage.getItem("userdata")).organization.level; |
|
|
|
this.getAllOrganization(); |
|
|
|
this.getAllOrganization(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -100,12 +117,15 @@ export class AlgorithmConfigComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
SkipCount = 0; |
|
|
|
SkipCount = 0; |
|
|
|
MaxResultCount = 100; |
|
|
|
MaxResultCount = 10; |
|
|
|
isLoading = false; |
|
|
|
isLoading = false; |
|
|
|
listOfData: any[] = []; |
|
|
|
listOfData: any[] = []; |
|
|
|
thList = []; |
|
|
|
thList = []; |
|
|
|
|
|
|
|
totals; |
|
|
|
|
|
|
|
StationName = null; |
|
|
|
getStationViolationConfigList() { |
|
|
|
getStationViolationConfigList() { |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
|
|
|
|
StationName: this.StationName, |
|
|
|
OrganizationUnitId: this.selectedOrId, |
|
|
|
OrganizationUnitId: this.selectedOrId, |
|
|
|
IsContainsChildren: true, |
|
|
|
IsContainsChildren: true, |
|
|
|
SkipCount: this.SkipCount, |
|
|
|
SkipCount: this.SkipCount, |
|
|
@ -119,8 +139,8 @@ export class AlgorithmConfigComponent implements OnInit { |
|
|
|
.subscribe({ |
|
|
|
.subscribe({ |
|
|
|
next: (data: any) => { |
|
|
|
next: (data: any) => { |
|
|
|
this.isLoading = false; |
|
|
|
this.isLoading = false; |
|
|
|
this.listOfData = data.result; |
|
|
|
this.listOfData = data.result.result; |
|
|
|
|
|
|
|
this.totals = data.result.totalCount; |
|
|
|
if (this.listOfData && this.listOfData.length !== 0) { |
|
|
|
if (this.listOfData && this.listOfData.length !== 0) { |
|
|
|
let arr1 = ["油站名称", "区域名称", "公司名称"]; |
|
|
|
let arr1 = ["油站名称", "区域名称", "公司名称"]; |
|
|
|
let arr2 = []; |
|
|
|
let arr2 = []; |
|
|
@ -136,6 +156,12 @@ export class AlgorithmConfigComponent implements OnInit { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pageChange($event) { |
|
|
|
|
|
|
|
console.log($event); |
|
|
|
|
|
|
|
this.SkipCount = ($event - 1) * this.MaxResultCount; |
|
|
|
|
|
|
|
this.getStationViolationConfigList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
change(item, type) { |
|
|
|
change(item, type) { |
|
|
|
this.isLoading = true; |
|
|
|
this.isLoading = true; |
|
|
|
let body = { |
|
|
|
let body = { |
|
|
@ -149,7 +175,18 @@ export class AlgorithmConfigComponent implements OnInit { |
|
|
|
.subscribe((data) => { |
|
|
|
.subscribe((data) => { |
|
|
|
this.isLoading = false; |
|
|
|
this.isLoading = false; |
|
|
|
this.message.create("success", "修改成功"); |
|
|
|
this.message.create("success", "修改成功"); |
|
|
|
item.disabled = type |
|
|
|
item.disabled = type; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hoverKey; |
|
|
|
|
|
|
|
hoverK; |
|
|
|
|
|
|
|
mouseEnter(key, k) { |
|
|
|
|
|
|
|
this.hoverKey = key; |
|
|
|
|
|
|
|
this.hoverK = k; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mouseLeave() { |
|
|
|
|
|
|
|
this.hoverKey = -1; |
|
|
|
|
|
|
|
this.hoverK = -1; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|