<nz-layout class="app-layout display_flex flex_auto ant-layout-has-sider">
  <overlay-scrollbars #osComponentRef1 class="menu-sidebar">
    <div class="sidebar-logo display_flex align-items_center justify-content_flex-center">
      <div class="display_flex align-items_center justify-content_flex-center logoTitle">
        <div class="title ellipsis-multiline" nz-tooltip nzTooltipTitle="{{tool.logoTitle}}">{{tool.logoTitle}}</div>
      </div>
    </div>
    <!-- 导航重写，兼容chrome39 -->
    <ul id="ds-menu">
      <li class="mainMenuOne" (click)="totoMenu('首页')" [ngClass]="{mainMenuSelected:indexFlag}">
        <i nz-icon nzType="home"></i>
        <span nzTooltipPlacement="right" nz-tooltip nzTooltipTitle="首页">首页</span>
      </li>
      <li *ngFor="let data of menus" class="mainMenuWrap">
        <div class="mainMenuOne" (click)="clickMenuOne(data)" [ngClass]="{mainMenuSelected:data.flagBg}">
          <i class="icon_transport" [ngClass]="data.icon" *ngIf="isTransportIcon(data.icon)"></i>
          <i nz-icon [nzType]="data.icon" *ngIf="!isTransportIcon(data.icon)"></i>
          <span nzTooltipPlacement="right" nz-tooltip nzTooltipTitle="{{data.title}}">{{data.title}}</span>
          <span class="icon_transport transport-xialajiantou" [ngStyle]="{transform:data.flag?'rotate(180deg)':'rotate(0deg)',color:data.flag?'#fff':'#999'}"></span>
        </div>
        <ul>
          <li *ngFor="let item of data.childrens" class="mainMenu" (click)="totoMenu(item.title,item,data)" [ngStyle]="{height:data.flag?'44px':0}" [ngClass]="{menuTwoSelected:item.flag}">
            <span nzTooltipPlacement="right" nz-tooltip nzTooltipTitle="{{item.title}}">{{item.title}}</span>
          </li>
        </ul>
      </li>
    </ul>
  </overlay-scrollbars>
  <nz-layout style="background:#fff;display: flex;flex-direction: column;position: relative;">
    <nz-header>
      <div class="app-header display_flex justify-content_space-between align-items_center">
        <div class="left">
          <i class="icon_transport transport-tiaodu-fill green" *ngIf='deskRole' (click)="toFuwutai()" nz-tooltip nzTooltipTitle="调度台"></i>
          <i class="icon_transport transport-hushizhihanghuligongzuo green" *ngIf="nurseRole" (click)="toHuShi()" nz-tooltip nzTooltipTitle="护士端"></i>
          <i class="icon_transport transport-peizhi1 green" *ngIf="incidentConfigRole || otherConfigRole || pageConfigRole || nurseConfigRole" (click)="toConfigurationCenter()" nz-tooltip nzTooltipTitle="配置中心"></i>
          <i class="icon_transport transport-tongji-2 green" *ngIf="newStatisticsRole" (click)="toNewStatistics()" nz-tooltip nzTooltipTitle="统计"></i>
          <i class="icon_transport transport-shangban green" *ngIf='PCCommutesToWork && userInfo.user && !userInfo.user.online' (click)="GoWork()" nz-tooltip nzTooltipTitle="我要上班"></i>
          <i class="icon_transport transport-shangban green" *ngIf='PCCommutesToWork && userInfo.user && userInfo.user.online' (click)="GoWork()" nz-tooltip nzTooltipTitle="我要下班"></i>
          <div class="dropdown" *ngIf="pharmacyRole || largeScreenRole || largeScreenRole2 || specimenViewRole || specimenViewRole2 || specimenRoomView || pathology || disinfectionSupplyRole || sampling">
            <i class="icon_transport transport-gengduoda-copy" (mouseenter)="showDropdown1 = true" (mouseleave)="showDropdown1 = false"></i>
            <div class="dropdown-content ct" [hidden]="!showDropdown1" (mouseenter)="showDropdown1 = true" (mouseleave)="showDropdown1 = false">
              <div class="dropdownItem" *ngIf="pharmacyRole" (click)="toPharmacy()">药房端</div>
              <div class="dropdownItem" *ngIf="pharmacyRole" (click)="toPharmacy2()">药房端2</div>
              <div class="dropdownItem" *ngIf="largeScreenRole" (click)="toBigScreen('largeScreen')">大屏端</div>
              <div class="dropdownItem" *ngIf="largeScreenRole2" (click)="toBigScreen('largeScreen2')">大屏端2</div>
              <div class="dropdownItem" *ngIf="specimenViewRole" (click)="toBigScreen('specimenView')">业务视图</div>
              <div class="dropdownItem" *ngIf="specimenViewRole2" (click)="toSpecimenView2()">标本视图</div>
              <div class="dropdownItem" *ngIf="specimenRoomView" (click)="toSpecimenRoomView()">标本间端</div>
              <div class="dropdownItem" *ngIf="pathology" (click)="toPathology()">病理科端</div>
							<div class="dropdownItem" *ngIf="sampling" (click)="toSampling()">门诊病理采样端</div>
							<div class="dropdownItem" *ngIf="communicationBook" (click)="toCommunicationBook()">病理交接本</div>
							<div class="dropdownItem" *ngIf="disinfectionSupplyRole" (click)="toDisinfectionSupply()">全局业务查看</div>
							<div class="dropdownItem" *ngIf="realtimeBroadcastRole" (click)="toRealtimeBroadcast()">故障实时播报</div>
            </div>
          </div>
        </div>
        <div class="right">
          <div class="userInfo dropdown">
            <div class="user" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
              <img src="../../assets/images/icon_keshi.png" alt="">
              <span><ng-container *ngIf="currentHospital.hosName">{{currentHospital.hosName}}-</ng-container>{{(userInfo&&userInfo.user)?userInfo.user.name:''}}</span>
              <i class="icon_transport transport-xiala1 ml8"></i>
            </div>
            <div class="dropdown-content r8" [hidden]="!showDropdown" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
              <div class="dropdownItem" (click)="selectHospital()">选择院区</div>
              <div class="dropdownItem" (click)="showUpPwd()">修改密码</div>
              <div class="dropdownItem" (click)="logOut()">退出</div>
            </div>
          </div>
        </div>
      </div>
    </nz-header>
    <nz-content style="position: relative;">
      <div class="inner-content">
        <router-outlet></router-outlet>
      </div>
    </nz-content>
  </nz-layout>
</nz-layout>

<!-- 上下班模态框 -->
<app-dialog-delete [delModal]="workModal" (hideDelModalEvent)="hideWorkModal()" [btnLoading]="loading3"
(confirmDelEvent)="confirmWork()" [content]="types"></app-dialog-delete>

<!-- 消息弹框模板 -->
<ng-template #msgTemplate1 let-msg="data">
  <div class="msgTemBox ant-notification-notice-content">
    <div class="borderLeft"></div>
    <div class="ant-notification-notice-with-icon">
      <span class="ant-notification-notice-icon">
        <i class="icon icon_transport transport-shouye9"></i>
      </span>
      <div class="ant-notification-notice-message">{{msg.type==1?'通知':'消息'}}</div>
      <div class="ant-notification-notice-description">{{msg.content}}</div>
    </div>
  </div>
</ng-template>
<!-- 修改密码 -->
<nz-modal [(nzVisible)]="isPwdVisible" nzTitle="修改密码" (nzOnCancel)="pwdHandleCancel()" (nzOnOk)="pwdHandleOk()" [nzOkLoading]="pwdIsOkLoading" (nzAfterOpen)="pwdAfterOpen()">
  <div>
    <label>
      原始密码:
      <nz-input-group [nzSuffix]="suffixTemplate">
        <input minlength="9" [type]="passwordVisible ? 'text' : 'password'" nz-input placeholder="原始密码" [(ngModel)]="upModalData.pwdOld" />
      </nz-input-group>
      <ng-template #suffixTemplate>
        <i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
      </ng-template>
    </label>
    <label>新密码:
      <div style="display: flex;">
        <nz-input-group [nzSuffix]="suffixTemplate">
          <input minlength="9" [type]="passwordVisible ? 'text' : 'password'" nz-input placeholder="新密码" [(ngModel)]="upModalData.newPwd" (ngModelChange)="blurNewPwd()" />
        </nz-input-group>
        <ng-template #suffixTemplate>
          <i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
        </ng-template>
        <div class="red" style="display: flex;justify-content: center;align-items: center;padding-left: 5px;" *ngIf="enoughRegFlag">弱</div>
        <div style="display: flex;justify-content: center;align-items: center;padding-left: 5px;" *ngIf="mediumRegFlag">中</div>
        <div class="green" style="display: flex;justify-content: center;align-items: center;padding-left: 5px;" *ngIf="strongRegFlag">强</div>
      </div>
    </label>
    <div class="red">强密码需包含大小写字母、数字、特殊字符，长度至少9个字符</div>
    <label>确认新密码:
      <nz-input-group [nzSuffix]="suffixTemplate">
        <input minlength="9" [type]="passwordVisible ? 'text' : 'password'" nz-input placeholder="确认新密码" [(ngModel)]="upModalData.newPwd2" />
      </nz-input-group>
      <ng-template #suffixTemplate>
        <i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
      </ng-template>
    </label>
  </div>
</nz-modal>
<!-- 大屏或视图选择院区模态框 -->
<app-select-hospital (hosFlagHand)="hosFlagHand($event)" (submitFormHand)="submitFormHand($event)" [hosFlag]="hosFlag"></app-select-hospital>
<!-- 切换院区 -->
<app-select-hospital (hosFlagHand)="hosFlagHand1($event)" (submitFormHand)="submitFormHand1($event)" [hosFlag]="hosFlag1"></app-select-hospital>
<!-- 模态框 -->
<div class="save display_flex justify-content_flex-center align-items_center" *ngIf="delModal">
  <div class="modalBody">
    <div class="title">提示<i class="icon_transport transport-guanbi" (click)="hideDelModal()"></i></div>
    <div class="content">
      <div class="icon"><i class="icon_transport transport-wenhao"></i></div>
      <div class="defeat">{{tipsMsg1}}</div>
    </div>
    <div class="display_flex justify-content_flex-center">
      <button nz-button nzType="primary" (click)="confirmDel()">确认</button>
      <button class="btn cancel " nz-button nzType="default" (click)="hideDelModal()">关闭</button>
    </div>
  </div>
</div>
<!-- 菜单选择 -->
<app-select-menu (cancelMenuModal)="cancelMenuModal($event)" [iShowMenuModal]="iShowMenuModal"></app-select-menu>
<!-- 遮罩 -->
<app-mask *ngIf="maskFlag"></app-mask>
