<form nz-form nc-adaptive-form [formGroup]="_organizationForm" nz-row [nzGutter]="24">

  <div nz-col [nzSpan]="24">
    <nz-form-item>
      <nz-form-label>父级</nz-form-label>
      <nz-form-control [nzErrorTip]="controlErrorTemplate">
        <nz-tree-select
          formControlName="parentId"
          nzPlaceHolder="请选择父级"
          [nzDropdownStyle]="{ maxHeight: '360px', overflow: 'auto' }"
          [nzNodes]="_organizationTreeNodeOptionList"
          nzShowSearch
          nzDefaultExpandAll></nz-tree-select>
      </nz-form-control>
    </nz-form-item>
  </div>

  <div nz-col [nzSpan]="24">
    <nz-form-item>
      <nz-form-label nzRequired>名称</nz-form-label>
      <nz-form-control [nzErrorTip]="controlErrorTemplate">
        <input nz-input formControlName="name" placeholder="请输入名称">
      </nz-form-control>
    </nz-form-item>
  </div>

  <div nz-col [nzSpan]="24">
    <nz-form-item>
      <nz-form-label nzRequired>类型</nz-form-label>
      <nz-form-control [nzErrorTip]="controlErrorTemplate">
        <nz-select formControlName="type" nzPlaceHolder="请选择类型" [nzLoading]="_organizationTypeLoading" nzAllowClear nzShowSearch>
          <nz-option *ngFor="let organizationType of _organizationTypeList" [nzLabel]="organizationType.label" [nzValue]="organizationType.value"></nz-option>
        </nz-select>
      </nz-form-control>
    </nz-form-item>
  </div>

  <div nz-col [nzSpan]="24">
    <nz-form-item>
      <nz-form-label>顺序号</nz-form-label>
      <nz-form-control [nzErrorTip]="controlErrorTemplate">
        <nz-input-number formControlName="sequence" nzPlaceHolder="请输入顺序号"></nz-input-number>
      </nz-form-control>
    </nz-form-item>
  </div>

</form>

<ng-template #controlErrorTemplate let-control>
  <div *ngFor="let error of control.errors | keyvalue">{{ error.value }}</div>
</ng-template>
