<nz-layout class="app-layout">
  <nz-sider class="menu-sidebar left_nav" nzCollapsible [(nzCollapsed)]="isCollapsed" [nzTrigger]="null">
    <div class="logo">
      <img nzTooltipTitle="{{userInfo.secRole.roleName}}" nzTooltipPlacement="topCenter" nz-tooltip src="../../../assets/admin/navigation/icon.png" alt="">
      <span *ngIf="!isCollapsed">{{userInfo.secRole.roleName}}</span>
    </div>
    <ul  nz-menu nzTheme="dark" nzMode="inline" [nzInlineCollapsed]="isCollapsed">
      <li nz-menu-item nz-tooltip nzPlacement="right" (click)="activeLi('index')" [nzSelected]="routeName == 'index' ? true : false" routerLink="/admin/index" [nzTitle]="isCollapsed ? '首页' : ''" >
        <i nz-icon nzType="home" nzTheme="outline"></i>
        <span>首页</span>
      </li>
      <li nz-submenu *ngFor="let item of menuList;" (click)="activeLi(item.menuUrl)" [nzOpen]="routeName == item.menuUrl ? true : false"   [nzTitle]="titleTpl">
        <ng-template #titleTpl><i nz-icon [nzIconfont]="item.menuUrlImg"></i><span>{{item.menuName}}</span></ng-template>
        <ul *ngFor="let child of item.children">
          <li nz-menu-item nzMatchRouter>
            <a routerLink="/admin/{{item.menuUrl}}/{{child.menuUrl}}" (click)="getRouteName(item.menuName , child.menuName)">{{child.menuName}}</a>
          </li>
        </ul>
      </li>
    </ul>
  </nz-sider>
  <nz-layout>
    <nz-header>
      <div class="app-header">
        <span class="header-trigger" (click)="isCollapsed = !isCollapsed">
            <i class="trigger"
               nz-icon
               [nzType]="isCollapsed ? 'menu-unfold' : 'menu-fold'"
            ></i>
        </span>
        <span *ngIf="userInfo['secUser'].id == 3">系统开关： <nz-switch [ngModel]="switchValue" (click)="clickSwitch()" nzCheckedChildren="开" nzUnCheckedChildren="关"></nz-switch></span>
        <a  style="float: right; margin-right:30px;" nz-dropdown [nzDropdownMenu]="menu">
          {{userInfo.secUser.userName}}
          <i nz-icon nzType="down"></i>
        </a>
        <nz-dropdown-menu #menu="nzDropdownMenu">
          <ul nz-menu nzSelectable>
            <li nz-menu-item>
              <a (click)="loginOut()">退出</a>
            </li>
          </ul>
        </nz-dropdown-menu>
      </div>
    </nz-header>
    <nz-content style="margin: 24px;">
      <router-outlet></router-outlet>
    </nz-content>
  </nz-layout>
</nz-layout>
