数据可视化大屏
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
4.1KB

  1. <h3>注册</h3>
  2. <form nz-form [formGroup]="form" (ngSubmit)="submit()" role="form">
  3. @if (error) {
  4. <nz-alert [nzType]="'error'" [nzMessage]="error" [nzShowIcon]="true" class="mb-lg" />
  5. }
  6. <nz-form-item>
  7. <nz-form-control [nzErrorTip]="mailErrorTip">
  8. <nz-input-group nzSize="large" nzAddonBeforeIcon="user">
  9. <input nz-input formControlName="mail" placeholder="Email" />
  10. </nz-input-group>
  11. <ng-template #mailErrorTip let-i>
  12. @if (i.errors?.required) {
  13. 请输入邮箱地址!
  14. }
  15. @if (i.errors?.email) {
  16. 邮箱地址格式错误!
  17. }
  18. </ng-template>
  19. </nz-form-control>
  20. </nz-form-item>
  21. <nz-form-item>
  22. <nz-form-control [nzErrorTip]="'请输入密码!'">
  23. <nz-input-group
  24. nzSize="large"
  25. nzAddonBeforeIcon="lock"
  26. nz-popover
  27. nzPopoverPlacement="right"
  28. nzPopoverTrigger="focus"
  29. [(nzPopoverVisible)]="visible"
  30. nzPopoverOverlayClassName="register-password-cdk"
  31. [nzPopoverOverlayStyle]="{ 'width.px': 240 }"
  32. [nzPopoverContent]="pwdCdkTpl"
  33. >
  34. <input nz-input type="password" formControlName="password" placeholder="Password" />
  35. </nz-input-group>
  36. <ng-template #pwdCdkTpl>
  37. <div style="padding: 4px 0">
  38. @switch (status) {
  39. @case ('ok') {
  40. <div class="success">强度:强</div>
  41. }
  42. @case ('pass') {
  43. <div class="warning">强度:中</div>
  44. }
  45. @default {
  46. <div class="error">强度:太短</div>
  47. }
  48. }
  49. <div class="progress-{{ status }}">
  50. <nz-progress [nzPercent]="progress" [nzStatus]="passwordProgressMap[status]" [nzStrokeWidth]="6" [nzShowInfo]="false" />
  51. </div>
  52. <p class="mt-sm">请至少输入 6 个字符。请不要使用容易被猜到的密码。</p>
  53. </div>
  54. </ng-template>
  55. </nz-form-control>
  56. </nz-form-item>
  57. <nz-form-item>
  58. <nz-form-control [nzErrorTip]="confirmErrorTip">
  59. <nz-input-group nzSize="large" nzAddonBeforeIcon="lock">
  60. <input nz-input type="password" formControlName="confirm" placeholder="Confirm Password" />
  61. </nz-input-group>
  62. <ng-template #confirmErrorTip let-i>
  63. @if (i.errors?.required) {
  64. 请确认密码!
  65. }
  66. @if (i.errors?.matchControl) {
  67. 两次输入的密码不匹配!
  68. }
  69. </ng-template>
  70. </nz-form-control>
  71. </nz-form-item>
  72. <nz-form-item>
  73. <nz-form-control [nzErrorTip]="mobileErrorTip">
  74. <nz-input-group nzSize="large" [nzAddOnBefore]="addOnBeforeTemplate">
  75. <ng-template #addOnBeforeTemplate>
  76. <nz-select formControlName="mobilePrefix" style="width: 100px">
  77. <nz-option [nzLabel]="'+86'" [nzValue]="'+86'" />
  78. <nz-option [nzLabel]="'+87'" [nzValue]="'+87'" />
  79. </nz-select>
  80. </ng-template>
  81. <input formControlName="mobile" nz-input placeholder="Phone number" />
  82. </nz-input-group>
  83. <ng-template #mobileErrorTip let-i>
  84. @if (i.errors?.required) {
  85. 请输入手机号!
  86. }
  87. @if (i.errors?.pattern) {
  88. 手机号格式错误!
  89. }
  90. </ng-template>
  91. </nz-form-control>
  92. </nz-form-item>
  93. <nz-form-item>
  94. <nz-form-control [nzErrorTip]="'请输入验证码!'">
  95. <div nz-row [nzGutter]="8">
  96. <div nz-col [nzSpan]="16">
  97. <nz-input-group nzSize="large" nzAddonBeforeIcon="mail">
  98. <input nz-input formControlName="captcha" placeholder="Captcha" />
  99. </nz-input-group>
  100. </div>
  101. <div nz-col [nzSpan]="8">
  102. <button type="button" nz-button nzSize="large" (click)="getCaptcha()" [disabled]="count > 0" nzBlock [nzLoading]="loading">
  103. {{ count ? count + 's' : ('获取验证码') }}
  104. </button>
  105. </div>
  106. </div>
  107. </nz-form-control>
  108. </nz-form-item>
  109. <nz-form-item>
  110. <button nz-button nzType="primary" nzSize="large" type="submit" [nzLoading]="loading" class="submit">
  111. 注册
  112. </button>
  113. <a class="login" routerLink="/passport/login">使用已有账户登录</a>
  114. </nz-form-item>
  115. </form>