<div class="preview" [ngStyle]="{margin:isM?0:'',minHeight:isM?'100vh':''}">
  <ng-container *ngIf="!success && !pastStatus">
    <ng-container *ngIf="!failure">
      <div *ngIf="!loading">
        <h1>{{qm.title}}</h1>
        <p>{{qm.surveyDescribe}}</p>
        <form nz-form [formGroup]="validateForm" >
          <ng-container *ngFor="let item of listOfData;let i=index;">
            <!-- 单选 -->
            <nz-form-item *ngIf="item.answerMode && item.answerMode.value == 1">
              <nz-form-label [nzSpan]="24" nzRequired>Q{{i+1}}.{{item.describe}}</nz-form-label>
              <nz-form-control [nzSpan]="24" nzErrorTip="请选择！">
                <nz-radio-group [formControlName]="item.propName">
                  <label nz-radio [nzValue]="radioItem" *ngFor="let radioItem of item.radioItems" class="radioItem">{{radioItem}}</label>
                </nz-radio-group>
              </nz-form-control>
            </nz-form-item>
            <!-- 单行填空 -->
            <nz-form-item *ngIf="item.answerMode && item.answerMode.value == 2">
              <nz-form-label [nzSpan]="24" nzRequired>Q{{i+1}}.{{item.describe}}</nz-form-label>
              <nz-form-control [nzSpan]="24" nzErrorTip="请填写！">
                <input nz-input [formControlName]="item.propName" placeholder="请填写！" maxlength="200" />
              </nz-form-control>
            </nz-form-item>
            <!-- 多行填空 -->
            <nz-form-item *ngIf="item.answerMode && item.answerMode.value == 3">
              <nz-form-label [nzSpan]="24" nzRequired>Q{{i+1}}.{{item.describe}}</nz-form-label>
              <nz-form-control [nzSpan]="24" nzErrorTip="请填写！">
                <textarea nz-input rows="4" [formControlName]="item.propName" placeholder="请填写！" maxlength="200"></textarea>
              </nz-form-control>
            </nz-form-item>
          </ng-container>
          <nz-form-item nz-row class="submit" *ngIf="listOfData.length && qm.state.value == 2">
            <nz-form-control>
              <button nz-button nzType="primary" [nzLoading]="loading" (click)="submitForm()">提交</button>
            </nz-form-control>
          </nz-form-item>
        </form>
      </div>
      <div class="loading" *ngIf="loading">
        <nz-spin nzSimple></nz-spin>
      </div>
    </ng-container>
    <div class="failure" *ngIf="failure">
      该链接不存在！
    </div>
  </ng-container>
  <div class="success" *ngIf="success">
    感谢您的参与！
  </div>
	<div class="failure" *ngIf="pastStatus">
	  调研码已过期，请知悉！<br>	
		请退出重新扫码
	</div>
	
</div>
