/*
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2021-12-06 15:17:52
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-03-02 14:29:12
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\choose-famifiar\\set-captain\\set-captain.component.ts
 * Copyright (C) 2022 huzhenhong. All rights reserved.
 */
import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { SFComponent, SFSchema, SFSchemaEnumType, SFUISchema } from '@delon/form';
import { _HttpClient } from '@delon/theme';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { map } from 'rxjs/operators';

@Component({
  selector: 'app-choose-famifiar-set-captain',
  templateUrl: './set-captain.component.html'
})
export class PublishchooseFamifiarSetCaptainComponent implements OnInit {
  @ViewChild('sf', { static: false }) sf!: SFComponent;
  schema!: SFSchema;
  ui!: SFUISchema;

  i: any;

  constructor(public http: _HttpClient, private cdr: ChangeDetectorRef, private route: ActivatedRoute, private modal: NzModalRef,) {}

  ngOnInit(): void {
    this.initSF();
  }
  initSF() {
    this.schema = {
      properties: {
        captainPhone: {
          type: 'string',
          title: '车队长手机号'
        }
      },
    };
    this.ui = {
      '*': {
        spanLabelFixed: 120,
        grid: { span: 24 }
      }
    };
  }

  close() {this.modal.close()}
  save() {this.modal.close(this.sf.value.captainPhone)}
}
