<form nz-form [formGroup]="form" (ngSubmit)="submit()" role="form">
    <nz-alert *ngIf="type === 0 && error && code != '651'" [nzType]="'error'" [nzMessage]="error" [nzShowIcon]="true" class="mb-lg">
    </nz-alert>
    <nz-alert
      *ngIf="error && code == '651'"
      [nzType]="'error'"
      [nzMessage]="error"
      [nzCloseText]="'申请license'"
      (nzOnClose)="getComputerInfo()"
    ></nz-alert>
    <nz-form-item>
      <nz-form-control [nzErrorTip]="'Please enter user name!' | i18n">
        <nz-input-group nzSize="large" nzPrefixIcon="user">
          <input nz-input formControlName="userName" placeholder="请输入用户名" />
        </nz-input-group>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-control nzErrorTip="'Please enter password!' | i18n">
        <nz-input-group nzSize="large" nzPrefixIcon="lock">
          <input nz-input type="password" formControlName="password" placeholder="请输入密码" />
        </nz-input-group>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-control>
        <nz-input-group nzSize="large" nzPrefixIcon="phone">
          <input nz-input type="text" formControlName="phone" placeholder="手机号" [disabled]="true"/>
        </nz-input-group>
      </nz-form-control>
      <button nz-button nzType="primary" type="button" nzSize="large">获取验证码</button>
    </nz-form-item>
    <nz-form-item>
      <nz-form-control nzErrorTip="'Please enter code!' | i18n">
        <nz-input-group nzSize="large" nzPrefixIcon="code">
          <input nz-input type="text" formControlName="code" placeholder="请输入验证码" />
        </nz-input-group>
      </nz-form-control>
    </nz-form-item>


  <nz-form-item nz-row nzJustify="end">
    <nz-col
      *ngIf="showForgetPasswordButton"
      [nzSpan]="12"
      [ngClass]="{ 'text-right': !showRegisterButton }"
      class="login-forget-button-wrapper"
    >
      <ng-container>
        <label nz-checkbox>{{ '记住密码' | i18n }}</label>
      </ng-container>
    </nz-col>
    <nz-col *ngIf="showRegisterButton" [nzSpan]="12" class="text-right login-register-button-wrapper">
      <ng-container>
<!--        <a class="forgot login-register-button" (click)="goToRegister()">{{ registerButtonName | i18n }}</a>-->
        <a class="forgot login-forget-button" (click)="forgetPassword()">{{ '忘记密码？' | i18n }}</a>
      </ng-container>
    </nz-col>
  </nz-form-item>
  <nz-form-item>
    <button class="ic-login-button" nz-button type="submit" nzType="primary" nzSize="large" [nzLoading]="http.loading" nzBlock>
      {{ 'app.login.login' | i18n }}
    </button>
  </nz-form-item>
</form>

<nz-modal
  [(nzVisible)]="isPwVisible"
  [nzTitle]="modalTitle"
  [nzContent]="modalContent"
  [nzFooter]="modalFooter"
  (nzOnCancel)="handleCancel()"
>
  <ng-template #modalTitle><span>密码已过期，请修改密码！</span></ng-template>

  <ng-template #modalContent>
    <sf #baseSf [formData]="formData" [schema]="schema" [button]="'none'" [cleanValue]="true"></sf>
  </ng-template>

  <ng-template #modalFooter>
    <button nz-button nzType="primary" (click)="destroyTplModal($event)" [nzLoading]="tplModalButtonLoading"> 提交 </button>
  </ng-template>
</nz-modal>

<nz-upload nzAction="inControlServer/sys/license/install?_allow_anonymous=true" *ngIf="code == '651'">
  <button nz-button><i nz-icon nzType="upload"></i><span>证书安装</span></button>
</nz-upload>

<nz-modal [(nzVisible)]="computerModel" nzTitle="本机信息" (nzOnCancel)="computerModel = false" nzFooter=" ">
  <nz-alert [nzType]="'error'" [nzMessage]="promptInfo" class="mb-lg"></nz-alert>
  <label>ip</label><input nz-input [(ngModel)]="computerIp" /> <label>mac</label><input nz-input [(ngModel)]="computerMac" />
  <label>cpu序列号</label><input nz-input [(ngModel)]="computerSerial" /> <label>主板序列号</label
  ><input nz-input [(ngModel)]="mainBoardSerial" />
</nz-modal>
