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.
37 lines
1.0 KiB
37 lines
1.0 KiB
3 years ago
|
import { HttpClient } from '@angular/common/http';
|
||
|
import { Component, Input, OnInit } from '@angular/core';
|
||
|
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-gas-base-info',
|
||
|
templateUrl: './gas-base-info.component.html',
|
||
|
styleUrls: ['./gas-base-info.component.scss']
|
||
|
})
|
||
|
export class GasBaseInfoComponent implements OnInit {
|
||
|
|
||
|
constructor(private modal: NzModalRef,private http: HttpClient) { }
|
||
|
|
||
|
@Input() data?: any;
|
||
|
isDetails: boolean = false; //是否是详情
|
||
|
|
||
|
ngOnInit(): void {
|
||
|
if (this.data.id === undefined) { //详情
|
||
|
console.log(this.data,'gasInfo')
|
||
|
this.isDetails = true
|
||
|
}
|
||
|
this.getBaseInfo()
|
||
|
}
|
||
|
|
||
|
baseInfo: any = {
|
||
|
stationType: null,
|
||
|
}
|
||
|
getBaseInfo() {
|
||
|
let params = { organizationUnitId: this.data.organizationId }
|
||
|
this.http.get('/api/services/app/GasStation/Get',{params}).subscribe((data: any)=>{
|
||
|
data.result.govUnitDetail? data.result.govUnitDetail = JSON.parse(data.result.govUnitDetail) : null;
|
||
|
this.baseInfo = data.result
|
||
|
})
|
||
|
}
|
||
|
|
||
|
}
|