<div class="list-template">
  <div class="list-template__content">
    <div class="list-template__top" nz-row>
      <div nz-col nzXl='15' class="list-template__searchBox"></div>
      <div nz-col nzXl="9" class="list-template__btns"></div>
    </div>
    <div class="list-template__bottom">
      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="loading1">
        <thead>
          <tr class="thead">
            <th nzWidth="5%">序号</th>
            <th nzWidth="25%">发送内容</th>
            <th nzWidth="25%">发送规则</th>
            <th nzWidth="5%">发送类型</th>
            <th nzWidth="20%">适用班次</th>
            <th nzWidth="5%">是否开启</th>
            <th nzWidth="15%">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let i = index">
            <td>{{ i+1 }}</td>
            <td>{{ data.sendContent }}</td>
            <td>{{ data.sendRules }}</td>
            <td>{{ data.sendType == 1?'微信':'' }}</td>
            <td>{{ data.applicableShiftName }}</td>
            <td>{{ data.status==1?'开启':'关闭' }}</td>
            <td>
              <div class="coop">
                <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
                <span *ngIf="coopBtns.isStartUp"
                  (click)="showDelModal(data,data.status==1?'您确认要停用吗？':'您确认要启用吗？',data.status==1?'停用':'启用','switch',data.status==1)">{{data.status==1?'停用':'启用'}}</span>
              </div>
            </td>
          </tr>
        </tbody>
      </nz-table>
      <div class="list-template__pagination">
        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
        </nz-pagination>
      </div>
    </div>
  </div>

  <!-- 编辑模态框 -->
  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
    <div class="modalBody">
      <div class="title">编辑<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i>
      </div>
      <overlay-scrollbars #osComponentRef1 class="content">
        <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
          <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="applicableShift">班次</nz-form-label>
            <nz-form-control nzErrorTip="请选择班次!">
              <nz-select [nzMode]="'multiple'" [nzDropdownMatchSelectWidth]="false" formControlName="applicableShift"
                nzShowSearch nzAllowClear nzPlaceHolder="请选择班次">
                <ng-container *ngFor="let data of scheduleClasses">
                  <nz-option *ngIf="!isLoading" nzLabel="{{data.name}}" nzValue="{{data.id}}"></nz-option>
                </ng-container>
                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
                </nz-option>
              </nz-select>
            </nz-form-control>
          </nz-form-item>
        </form>
      </overlay-scrollbars>
      <div class=" display_flex justify-content_flex-center">
        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">保存</button>
        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
      </div>
    </div>
  </div>


  <!-- 启用/停用模态框 -->
  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
</div>
<!-- 操作成功/失败提示框 -->
<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  [info]="promptInfo">
</app-prompt-modal>
