<form nz-form nc-adaptive-form [formGroup]="_<%= getCamelCase(name) %>Form" nz-row [nzGutter]="24"><% formFieldList.forEach(function(field) { %>

  <div nz-col [nzSpan]="<%= field.controlSpan %>">
    <nz-form-item>
      <nz-form-label<% if (field.required) { %> nzRequired<% } %>><%= field.description %></nz-form-label>
      <nz-form-control [nzErrorTip]="controlErrorTemplate"><% if (field.controlType === 'select') { %>
        <nz-select formControlName="<%= getCamelCase(field.name) %>" nzPlaceHolder="请选择<%= field.description %>"<% if (field.dictCode) { %> [nzLoading]="_<%= getCamelCase(field.dictCode) %>Loading"<% } %> nzAllowClear nzShowSearch><% if (field.dictCode) { %>
          <nz-option *ngFor="let <%= getCamelCase(field.dictCode) %> of _<%= getCamelCase(field.dictCode) %>List" [nzLabel]="<%= getCamelCase(field.dictCode) %>.label" [nzValue]="<%= getCamelCase(field.dictCode) %>.value"></nz-option><% } %>
        </nz-select><% } else if (field.controlType === 'selectMultiple') { %>
        <nz-select formControlName="<%= getCamelCase(field.name) %>" nzPlaceHolder="请选择<%= field.description %>" nzMode="multiple"<% if (field.dictCode) { %> [nzLoading]="_<%= getCamelCase(field.dictCode) %>Loading"<% } %> nzAllowClear nzShowSearch><% if (field.dictCode) { %>
          <nz-option *ngFor="let <%= getCamelCase(field.dictCode) %> of _<%= getCamelCase(field.dictCode) %>List" [nzLabel]="<%= getCamelCase(field.dictCode) %>.label" [nzValue]="<%= getCamelCase(field.dictCode) %>.value"></nz-option><% } %>
        </nz-select><% } else if (field.controlType === 'datetimePicker') { %>
        <nz-date-picker formControlName="<%= getCamelCase(field.name) %>" nzPlaceHolder="请选择<%= field.description %>" nzShowTime></nz-date-picker><% } else if (field.controlType === 'datePicker') { %>
        <nz-date-picker formControlName="<%= getCamelCase(field.name) %>" nzPlaceHolder="请选择<%= field.description %>"></nz-date-picker><% } else if (field.controlType === 'switch') { %>
        <nz-switch formControlName="<%= getCamelCase(field.name) %>"></nz-switch><% } else if (field.controlType === 'inputNumber') { %>
        <nz-input-number formControlName="<%= getCamelCase(field.name) %>" nzPlaceHolder="请输入<%= field.description %>" [nzFormatter]="formatterNumber" [nzParser]="parserNumber"></nz-input-number><% } else if (field.controlType === 'textarea') { %>
        <textarea nz-input formControlName="<%= getCamelCase(field.name) %>" placeholder="请输入<%= field.description %>"></textarea><% } else { %>
        <input nz-input formControlName="<%= getCamelCase(field.name) %>" placeholder="请输入<%= field.description %>"><% } %>
      </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>
