<div class="holidays">
  <div class="set display_flex justify-content_space-between align-items_center">
    <span>工作日：周一、周二、周三、周四、周五；节假日：周六、周日；</span>
    <div>
      <label nz-checkbox [(ngModel)]="syncWorkDay" (ngModelChange)="setSyncWorkDay($event)"
        [nzDisabled]="!coopBtns.edit">自动同步国家法定节假日</label>
      <button class="btn default" [disabled]="!coopBtns.edit" (click)='showModal()'>设置</button>
    </div>
  </div>
  <div class="day" *ngIf="!loading1">
    <nz-calendar (nzSelectChange)="onValueChange($event)" [(ngModel)]="selected">
      <ul *nzDateCell="let date" class="events">
        <ng-container>
          <ng-container [ngSwitch]="date.getTime()">
            <div *ngFor="let d of dates">
              <ng-container *ngSwitchCase="d">
                <div class="label display_flex justify-content_flex-end justify-content_flex-center">
                  <div class="label display_flex justify-content_flex-end justify-content_flex-center">
                    <label class="display_flex align-items_flex-end justify-content_flex-center" for="" nz-checkbox
                      [nzDisabled]='date.getFullYear()<getYear(d)||!coopBtns.edit' (ngModelChange)="onDateClick(d)"
                      [(ngModel)]="dateChecked[''+date.getTime()]">{{dateChecked[''+date.getTime()]?'工作日':'节假日'}}</label>
                  </div>
                </div>
              </ng-container>
            </div>
          </ng-container>
        </ng-container>
      </ul>
    </nz-calendar>
  </div>
  <div class="day" *ngIf="loading1" style="height: 805px;">
    <div class="loadingFull display_flex justify-content_flex-center align-items_center">
      <div class="loadingFullInner">
        <img src="../../../assets/images/loading.gif" alt="">
        <div>加载中...</div>
      </div>
    </div>
  </div>

  <!-- 工作日设置模态框 -->
  <div class="save display_flex justify-content_flex-center align-items_center" *ngIf="setDay">
    <div class="modalBody" *ngIf="!loading2">
      <div class="title">工作日设置<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
      <div class="content">
        <p>按周设置工作日<span>（选中完成后点击保存，自动根据选中设置每周工作）：</span></p>
        <div class="week">
          <nz-checkbox-wrapper style="width: 100%;" (nzOnChange)="changeWeeks($event)">
            <div nz-row nzType="flex" nzJustify="space-between">
              <div nz-col *ngFor="let item of weeks">
                <label nz-checkbox [nzValue]="item.value" [(ngModel)]="weeksChecked[item.value]">{{item.label}}</label>
              </div>

            </div>
          </nz-checkbox-wrapper>
        </div>
      </div>
      <div class="display_flex justify-content_flex-center">
        <button nz-button nzType="primary" (click)="save()" [nzLoading]="btnLoading">保存</button>
        <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
      </div>
    </div>
    <div class="modalBody" *ngIf="loading2" style="height: 241px;">
      <div class="loadingFull display_flex justify-content_flex-center align-items_center">
        <div class="loadingFullInner">
          <img src="../../../assets/images/loading.gif" alt="">
          <div>加载中...</div>
        </div>
      </div>
    </div>
  </div>


</div>
<!-- 操作成功/失败提示框 -->
<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  [info]="promptInfo"></app-prompt-modal>
<!-- 遮罩 -->
<app-mask *ngIf="maskFlag"></app-mask>
