<page-header-wrapper [title]="'协议配置'"></page-header-wrapper>

<nz-card>
  <div nz-row [nzGutter]="8">
    <div nz-col nzSpan="4">
      <ul nz-menu nzMode="inline" class="card-height">
        <li nz-menu-item [nzSelected]="idx === 0" (click)="changeType(idx)" *ngFor="let item of tabs; let idx = index">
          {{ item.name }}
        </li>
      </ul>
    </div>
    <div nz-col nzSpan="20" style="overflow: scroll">
      <nz-card class="card-height" *ngIf="!isUpdate">
        <div class="mb-md">
          <strong>{{ tabItem.typeName }}</strong>
          <!-- <button class="btn-right" nz-button nzSize="large" nzType="default" (click)="update()">修改</button> -->
        </div>
        <div class="mb-lg">
          更新时间： {{ tabItem.modifyTime }}
          <a style="margin-left: 8px" target="_blank" [queryParams]="{ type: idx }" [routerLink]="['/agreement']">预览</a>
          <button nz-button nzType="link" (click)="update()">修改</button>
        </div>
        <div [innerHTML]="tabItem.content"></div>
      </nz-card>

      <nz-card class="card-height" *ngIf="isUpdate">
        <div nz-row nzGutter="8">
          <div nz-col nzSpan="24">
            <sf #sf1 mode="edit" [schema]="schema1" [ui]="ui1" button="none"> </sf>
          </div>
        </div>
        <div class="mb-md save-btn">
          <button nz-button nzSize="large" nzType="default" (click)="cancel()">取消</button>
          <button class="ml-lg" nz-button nzSize="large" nzType="primary" (click)="save()">保存</button>
        </div>
      </nz-card>
    </div>
  </div>
</nz-card>