沈斌
2017-12-19 c5b814dcf5ae60e89169dadf6cb039261bb23a23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { NzModalSubject, NzMessageService } from 'ng-zorro-antd';
import { Component, OnInit } from '@angular/core';
import { ModalHelper } from '@delon/theme';
import { HttpClient } from '@angular/common/http';
 
@Component({
  selector: 'app-edit',
  templateUrl: './edit.component.html',
  styles: []
})
export class UserInstallerEditComponent implements OnInit {
 
  user: any;
 
  constructor(
    private modalHelper: ModalHelper,
    private subject: NzModalSubject,
    public msgSrv: NzMessageService,
    public http: HttpClient) { }
 
  ngOnInit() {
    if (this.user.id > 0) {
      this.http.get('http://localhost:8001/user/operate_user/' + this.user.id).subscribe((res: any) => {
          this.user = res.data[0];
      });
    }
  }
 
  save() {
    this.http.get('./assets/pois.json').subscribe(() => {
      this.msgSrv.success('保存成功,只是模拟,实际未变更');
      this.subject.next('true');
      this.close();
    });
  }
 
  close() {
    this.subject.destroy();
  }
 
}