<template>
  <div class="header">
    <div @click="jumpTo('overview')" class="logo link" id="header-to-overview">
      <img height="34" :src="logo?logo:'../../assets/img/logo1-2.png'"/>
      <span class="header-system-name">{{systemName&&systemName != 'undefined'&&systemName != null?systemName: $t('dashboard.overview.contentTitle')}}</span>
    </div>
    <el-menu
      class="nz-menu float-right"
      mode="horizontal"
      active="1"
      unique-opened
    >
      <template v-for="(menu, index) in getMenuList" v-if="menu.code == 'header' && menu.children && menu.children.length > 0">
        <template v-for="(subMenu, subIndex) in menu.children">
          <el-submenu v-if="subMenu.code == 'header_link'" :key="subIndex" :disabled="!linkData||linkData.length <1" :index="`${index}-${subIndex}`" class="icon-menu-item" popper-class="nz-submenu">
            <template slot="title">
              <i class="nz-icon-navmore nz-icon" style="font-size: 17px;"></i>
            </template>
            <template v-for="(item, index) in linkData">
              <el-menu-item :key="index" :index="'0-' + index">
                <span class="linkTitle"><a :href='item.url' :title="item.name" class="nz-a" rel="noopener noreferrer" target="_blank">{{item.name}}</a></span>
              </el-menu-item>
            </template>
          </el-submenu>
          <el-submenu v-if="subMenu.code == 'header_terminal'" :key="subIndex" :index="`${index}-${subIndex}`" class="icon-menu-item" popper-class="display-none">
            <div @click="cli" class="el-submenu__title" slot="title" id="header-open-cli">
              <i class="nz-icon nz-icon-cli" style="font-size: 18px;"></i>
              <div class="right-tip" v-show="$store.state.consoleCount>0">{{$store.state.consoleCount<=10?$store.state.consoleCount:'10+'}}</div>
            </div>
          </el-submenu>
          <el-submenu v-if="subMenu.code == 'header_add'" :key="subIndex" :index="`${index}-${subIndex}`" class="icon-menu-item" popper-class="nz-submenu">
            <template slot="title">
              <i class="nz-icon-create-square nz-icon" style="font-size: 18px;"></i>
            </template>
            <template v-for="(item, createIndex) in createMenu">
              <el-menu-item :key="createIndex" v-has="item.permission" :index="`${index}-${subIndex}-${createIndex}`">
                <div @click="createBox(item)" :id="'create-box-'+createIndex">
                  <span>{{item.label}}</span>
                </div>
              </el-menu-item>
            </template>
          </el-submenu>
        </template>
      </template>

      <el-menu-item index="103" >
        <div class="vertical-line" ></div>
      </el-menu-item>

      <el-submenu :index="`${index}`" :key="index" popper-class="nz-submenu" v-for="(menu, index) in getMenuList" v-if="menu.code != 'header' && menu.code != 'menu'">
        <template v-if="menu.code == 'asset'">
          <template slot="title">
            <div @click="jumpToAsset()" v-if="assetData.length == 0" id="header-to-asset">{{$t(menu.i18n)}}</div>
            <div :class="{'menu-active' : route == '/asset'}" @click="jumpToAsset()" v-else id="header-to-asset2">{{$t(menu.i18n)}}</div>
          </template>
          <template>
            <el-menu-item index="3-0" v-if="assetData.length == 0"><div @click="createBox({type: 6})" v-has="'asset_toAdd'" id="header-to-addasset"><i class="nz-icon nz-icon-create-square header-dropdown-add"></i>&nbsp;&nbsp;{{$t("overall.createDatacenter")}}</div></el-menu-item>
            <template v-else>
              <div style='height: 360px; overflow: auto;' v-has="'asset_view'" v-if="assetData.length>10" id="header-to-subAsset">
                <el-menu-item :index="'3-' + index" :key="index" v-for="(item, index) in assetData">
                  <div :class="{'menu-item-active': route == '/asset' && activeItemIndex == item.id}" @click="jumpToAsset(item)" @mouseenter="hoverItemIndex = '3-' + index" @mouseleave="hoverItemIndex = ''">
                    <span class="too-long-split" style="width: 130px;">{{item.name}}</span>
                  </div>
                </el-menu-item>
              </div>
              <div  v-else id="header-to-subAsset2">
                <el-menu-item :index="'3-' + index" :key="index" v-for="(item, index) in assetData" v-has="'asset_view'">
                  <div :class="{'menu-item-active': route == '/asset' && activeItemIndex == item.id}" @click="jumpToAsset(item)" @mouseenter="hoverItemIndex = '3-' + index" @mouseleave="hoverItemIndex = ''">
                    <span class="too-long-split" style="width: 130px;">{{item.name}}</span>
                  </div>
                </el-menu-item>
              </div>
            </template>
          </template>
        </template>
        <template v-else-if="menu.code == 'project'">
          <template slot="title">
            <div v-if="projectData.length == 0">{{$t(menu.i18n)}}</div>
            <div :class ="route == '/project' ? 'menu-active' :''" @click="jumpToProject(projectData[0])" v-else id="header-to-project">{{$t(menu.i18n)}}</div>
          </template>
          <template>
            <el-menu-item index="2-0" v-if="projectData.length == 0"><div @click="createBox({type: 1})" v-has="'project_toAdd'" id="header-create-project"><i class="nz-icon nz-icon-create-square header-dropdown-add"></i>&nbsp;&nbsp;{{$t("overall.createProject")}}</div></el-menu-item>
            <template v-else>
              <div style="height: 360px; overflow: auto;" v-has="'project_view'" v-if="projectData.length>10" id="header-sub-project">
                <el-menu-item :index="'2-' + index" :key="index" v-for="(item, index) in projectData">
                  <div :class="{'menu-item-active': route == '/project' && activeItemIndex == item.id}" @click="jumpToProject(item)" @mouseenter="hoverItemIndex = '2-' + index" @mouseleave="hoverItemIndex = ''">
                    <span class="too-long-split" style="width: 135px;">{{item.name}}</span>
                    <div @click.stop="toEditProject(item)" class="menu-edit" v-has="'project_toEdit'" v-show="hoverItemIndex == '2-' + index && item.buildIn != 1"><i class="nz-icon nz-icon-edit"></i></div>
                  </div>
                </el-menu-item>
              </div>
              <div v-else id="header-sub-project2">
                <el-menu-item :index="'2-' + index" :key="index" v-for="(item, index) in projectData" v-has="'project_view'">
                  <div :class="{'menu-item-active': route == '/project' && activeItemIndex == item.id}" @click="jumpToProject(item)" @mouseenter="hoverItemIndex = '2-' + index" @mouseleave="hoverItemIndex = ''">
                    <span class="too-long-split" style="width: 135px;">{{item.name}}</span>
                    <div @click.stop="toEditProject(item)" class="menu-edit" v-has="'project_toEdit'" v-show="hoverItemIndex == '2-' + index && item.buildIn != 1"><i class="nz-icon nz-icon-edit"></i></div>
                  </div>
                </el-menu-item>
              </div>
            </template>
          </template>
        </template>
        <template v-else>
          <template slot="title">
            <div :class="menuIsActive(menu, 'parent')" @click="jumpTo(menu.route)" :id="'header-to-'+menu.name">
              {{$t(menu.i18n)}}
            </div>
          </template>
          <el-menu-item :index="`${index}-${subIndex}`" :key="`${index}-${subIndex}`" v-for="(subMenu, subIndex) in menu.children">
            <div :class="menuIsActive(subMenu)" @click="jumpTo(subMenu.route)" :id="'header-to-submenu-'+subMenu.name">{{$t(subMenu.i18n)}}</div>
          </el-menu-item>
        </template>
      </el-submenu>

      <el-submenu index="101" popper-class="nz-submenu">
        <template slot="title">
          <div class='nz-user'>{{username}}<i class="nz-icon nz-icon-arrow-down"></i></div>
        </template>
        <el-menu-item index="101-0">
          <div :style="language=='en'?'color:#f90':''" @click="changeLocal('en')" id="header-to-english">English</div>
        </el-menu-item>
        <el-menu-item index="101-1">
          <div :style="language=='cn'?'color:#f90':''" @click="changeLocal('cn')" id="header-to-chinese">中文</div>
        </el-menu-item>
        <template v-if="username">
          <el-menu-item class="nz-menu-line" @click.stop index="6-2" >
            <div style="height: 1px; width: 100%; background-color: #cccccc;"></div>
          </el-menu-item>
          <el-menu-item index="101-3">
            <div @click="showPinDialog" id="header-to-changepin">{{$t('overall.changePin')}}</div>
          </el-menu-item>
          <el-menu-item index="101-4">
            <div @click="logout" id="header-to-logout">{{$t('overall.signOut')}}</div>
          </el-menu-item>
        </template>
      </el-submenu>
    </el-menu>

    <transition name="right-box">
      <project-box v-if="rightBox.project.show" :project="editProject" ref="projectBox" @close="closeProjectRightBox"></project-box>
    </transition>
    <transition name="right-box">
      <module-box v-if="rightBox.module.show" :currentProject="currentProject" :module="editModule" @close="closeModuleRightBox" ref="moduleBox"></module-box>
    </transition>
    <transition name="right-box">
      <add-endpoint-box v-if="rightBox.endpoint.show" :currentProject="currentProject" :currentModule="currentModule" @close="closeEndpointRightBox" ref="addEndpointBox"></add-endpoint-box>
    </transition>
    <transition name="right-box">
      <asset-box v-if="rightBox.asset.show" :asset="editAsset" @close="closeAssetRightBox" ref="assetAddUnit"></asset-box>
    </transition>
    <transition name="right-box">
      <alert-config-box v-if="rightBox.alertRule.show" :alert-rule="editAlertRule" @close="closeAlertRuleRightBox" ref="alertConfigBox"></alert-config-box>
    </transition>
    <transition name="right-box">
      <dc-box @close="closeDcBox" :dc="dc" :user-data="userData" @reload="getAssetData" v-if="rightBox.dc.show"></dc-box>
    </transition>
    <change-password :cur-user="username" :show-dialog="showChangePin" @click="showPinDialog" @dialogClosed="dialogClosed"></change-password>
  </div>
</template>

<script>
import bus from '../../libs/bus'
import dcBox from './rightBox/dcBox' // dc弹框
import { mapActions } from 'vuex'
import changePin from '../page/config/changePin'
export default {
  name: 'Header',
  components: {
    'change-password': changePin,
    'dc-box': dcBox
  },
  data () {
    return {
      username: sessionStorage.getItem('nz-username'),
      language: localStorage.getItem('nz-language') ? localStorage.getItem('nz-language') : 'en',
      systemLogo: '',
      // 顶部菜单相关
      /* activeIndex: '', */
      activeItemIndex: '',
      activeItemIndexes: [],
      hoverItemIndex: '',
      systemName: localStorage.getItem('nz-sys-name'),
      dc: {
        id: '',
        name: '',
        location: '',
        tel: '',
        principal: '',
        area: {
          id: 0,
          name: ''
        }
      },
      userData: [],
      assetData: [], // 顶部菜单asset的下拉内容

      // add侧滑相关
      rightBox: {
        project: { show: false },
        module: { show: false },
        endpoint: { show: false },
        asset: { show: false },
        alertRule: { show: false },
        dc: { show: false }
      },
      projectData: [], // 顶部菜单project列表中的数据
      editProject: { id: '', name: '', remark: '' }, // 新增/编辑的project
      currentProject: { id: '', name: '', remark: '' }, // module/endpoint弹框用来回显project
      editModule: { type: 'http', name: '', project: {}, port: 9100, path: '', param: '', paramObj: [], labelModule: [], labels: '' }, // 新增/编辑的module
      currentModule: { id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: [], labels: '', labelModule: [] }, // endpoint弹框用来回显module，此处固定为空对象
      editEndpoint: { // 新增/编辑的endpoint
        id: '',
        host: '',
        port: '',
        param: '',
        path: '',
        asset: { id: '', name: '', host: '' },
        project: { id: '', name: '' },
        module: { id: '', name: '', param: '', paramObj: {}, projectId: '', labelModule: [], labels: '' },
        moduleId: '',
        assetId: '',
        labelModule: []
      },
      editAsset: {
        id: '',
        sn: '',
        host: '',
        state: 1,
        purchaseDate: '',
        idcId: '',
        cabinetId: '',
        modelId: '',
        model: { type: { code: '' } },
        assetType: '',
        impi: {
          host: '',
          port: ''
        },
        tags: [],
        accounts: []
      },
      editAlertRule: {
        id: '',
        alertName: '',
        linkObject: { id: '', name: '' },
        expr: '',
        unit: 2,
        operator: '>',
        last: 60,
        severity: 'P2',
        summary: '',
        description: ''
      },
      createMenu: [ // 新增按钮内容
        {
          label: this.$t('project.project.projectName'),
          url: 'project',
          type: 1,
          permission: 'header_add_project'
        },
        {
          label: this.$t('project.module.module'),
          url: 'project',
          type: 2,
          permission: 'header_add_module'
        },
        {
          label: this.$t('project.endpoint.endpoint'),
          url: 'project',
          type: 3,
          permission: 'header_add_endpoint'
        },
        {
          label: this.$t('asset.asset'),
          url: 'asset',
          type: 4,
          permission: 'header_add_asset'
        },
        {
          label: this.$t('alert.config.alertConfig'),
          url: 'alertConfig',
          type: 5,
          permission: 'header_add_rule'
        }
      ],
      showChangePin: false
    }
  },
  methods: {
    ...mapActions(['logoutSuccess']),
    cli () {
      this.$store.commit('openConsole')
    },

    /**
       * @param route 路由地址
       * @param parentMenu 菜单大类
       * */
    jumpTo (route) {
      if (route != 'asset') {
        this.activeItemIndexes = []
      }
      this.$router.push({
        path: route,
        query: {
          t: +new Date()
        }
      })
    },
    getLinkData () {
      this.$get('link').then(response => {
        this.$store.commit('setLinkData', response.data)
      })
    },
    createBox (item) {
      if (item.type == 1) {
        this.rightBox.project.show = true
        this.editProject = { id: '', name: '', remark: '' }
      } else if (item.type == 2) {
        this.rightBox.module.show = true
        this.editModule = {
          name: '',
          project: {},
          port: 9100,
          path: '',
          param: '',
          labels: '',
          type: 'http',
          paramObj: [],
          snmpParam: '',
          labelModule: [],
          // snmp setting 下划线命名是因为业务需求
          walk: [],
          version: 2, // 2/3
          max_repetitions: 25,
          retries: 3,
          timeout: 10, // s
          community: 'public',
          username: '',
          security_level: 'noAuthNoPriv', // noAuthNoPriv/authNoPriv/authPriv
          pinrd: '',
          auth_protocol: 'MD5', // MD5/SHA
          priv_protocol: 'DES', // DES/AES
          priv_pin: '',
          context_name: ''
        }
      } else if (item.type == 3) {
        this.rightBox.endpoint.show = true
      } else if (item.type == 4) {
        this.rightBox.asset.show = true
      } else if (item.type == 5) {
        this.rightBox.alertRule.show = true
      } else if (item.type == 6) {
        this.rightBox.dc.show = true
      }
    },
    jumpToAsset (dc) {
      if (dc) {
        this.activeItemIndex = dc.id
        this.$store.commit('setCurrentDc', dc.id)
        bus.$emit('header-dc-change', dc.id) // 发送给leftMenu，顶部dc条件改变了
      } else {
        this.activeItemIndex = ''
        this.$store.commit('setCurrentDc', '')
        bus.$emit('clear-asset-filter') // 清除leftMenu左侧菜单过滤条件
      }
      this.jumpTo('/asset')
    },
    jumpToProject (p) {
      if (!this.hasButton('project_view')) {
        return
      }
      this.currentProject = p
      if (p.id !== this.$store.state.currentProject.id) {
        bus.$emit('project-page-type', 'project')
      }
      this.$store.commit('currentProjectChange', p)
      this.activeItemIndex = p.id
      this.jumpTo('/project')
    },
    getAssetData () {
      this.$get('idc', { pageSize: -1 }).then(response => {
        if (response.code == 200) {
          this.assetData = response.data.list
          this.assetData.forEach(item => {
            this.$set(item, item.name, false)
          })
          this.$store.commit('setIdcArr', this.assetData)
        }
      })
    },
    changeLocal (lang) {
      if (lang != localStorage.getItem('nz-language')) {
        localStorage.setItem('nz-language', lang)
        this.$i18n.locale = lang
        window.location.reload()
      }
    },
    getProjectList () {
      this.$get('project', { pageSize: -1 }).then(response => {
        if (response.code == 200) {
          this.projectData = response.data.list
          let flag = false
          // 如果currentProject不在新取到的数据里，说明它被删了
          for (let i = 0; i < this.projectData.length; i++) {
            if (this.projectData[i].id == this.currentProject.id) {
              flag = true
              break
            }
          }
          if (!flag && this.projectData.length > 0) {
            this.currentProject = this.projectData[0]
            this.activeItemIndex = this.currentProject.id
            this.$store.commit('currentProjectChange', this.currentProject)
          }
        }
      })
    },
    getUserData () {
      return new Promise(resolve => {
        this.$get('sys/user', { pageSize: -1, pageNo: 1 }).then(response => {
          if (response.code === 200) {
            this.userData = response.data.list
          }
          resolve()
        })
      })
    },
    closeProjectRightBox (refresh) {
      this.rightBox.project.show = false
      if (refresh) {
        this.getProjectList()
        bus.$emit('project-list-change')
      }
    },
    closeModuleRightBox (refresh) {
      this.rightBox.module.show = false
      if (refresh) {
        bus.$emit('module-list-change')
      }
    },
    closeEndpointRightBox (refresh) {
      this.rightBox.endpoint.show = false
      if (refresh) {
        bus.$emit('endpoint-list-change')
      }
    },
    closeAssetRightBox (refresh) {
      this.rightBox.asset.show = false
      if (refresh) {
        bus.$emit('asset-list-change')
      }
    },
    closeAlertRuleRightBox (refresh) {
      this.rightBox.alertRule.show = false
      if (refresh) {
        bus.$emit('alert-rule-list-change')
      }
    },
    closeDcBox (refresh) {
      this.rightBox.dc.show = false
      if (refresh) {
        this.getAssetData()
        bus.$emit('dc-list-change')
      }
    },
    toEditProject (p) {
      this.editProject = Object.assign({}, p)
      this.rightBox.project.show = true
    },
    logout () {
      this.$get('logout').then(() => {
        this.logoutSuccess()
        document.location.href = '/'
      })

      // this.jumpTo('/login');
    },
    refreshLang () {
      this.language = localStorage.getItem('nz-language')
      this.$i18n.locale = this.language
      this.$nextTick(() => {
        window.location.reload()
      })
    },
    showPinDialog () {
      this.showChangePin = true
    },
    dialogClosed () {
      this.showChangePin = false
    },
    cancel () {
      this.jumpTo(this.$route.path.slice(1, this.$route.path.length))
    },

    initEvent () {
      bus.$on('login', () => {
        this.username = sessionStorage.getItem('nz-username')
        this.refreshLang()
      })
      bus.$on('dc-list-change', () => { // dc.vue增删改dc时刷新顶部菜单dc列表
        this.getAssetData()
      })
      bus.$on('current-project-change', project => {
        this.currentProject = project
        this.activeItemIndex = project.id
      })
      if (window.history && window.history.pushState) {
        history.pushState(null, null, document.URL)
        window.addEventListener('popstate', this.cancel, false)
      }
    }
  },
  mounted () {
    this.$i18n.locale = this.language
    if (sessionStorage.getItem('nz-token')) {
      this.initEvent()
      this.getAssetData()
      this.getUserData()
      this.getProjectList()
      this.getLinkData()
    }
    // 刷新后有高亮
    /* let activePath = this.$route.path.slice(1);
      this.activeIndex = activePath; */
  },
  computed: {
    linkData () {
      return this.$store.getters.getLinkData
    },
    route () {
      return this.$route.path
    },
    overViewProject () {
      return this.$store.getters.getOverViewProject
    },
    menuIsActive () {
      return function (menu, isParent) {
        if (isParent) {
          const isCurrent = menu.children.some(sub => {
            return sub.route == this.route
          })
          if (isCurrent) {
            return 'menu-active'
          } else {
            return ''
          }
        } else {
          if (menu.route == this.route) {
            return 'menu-item-active'
          } else {
            return ''
          }
        }
      }
    }
  },
  watch: {
    overViewProject (n) {
      if (n) {
        this.jumpToProject(n)
      }
    }
  },
  beforeDestroy () {
    bus.$off('login')
    bus.$off('dc-list-change')
    bus.$off('current-project-change')
  },
  destroyed () {
    window.removeEventListener('popstate', this.cancel, false)
  }
}
</script>

<style lang="scss">
  .logo {
    position: absolute;
    top: 8px;
    left: 18px;
  }
  .header {
    box-shadow: 0 2px 4px 0 rgba(0,0,0,0.30);
  }
  .header .el-menu {
    background-color: transparent;
  }
  .header .el-menu--horizontal>.el-submenu .el-submenu__title .menu-active{
    border-bottom: $global-text-color-active solid 2px;
    border-radius: 2px;
    height: 26px;
    line-height: 16px;
    display: inline-block;
    font-size: 16px;
    margin: 0 auto -8px;
    font-weight: 500;
    color: $header-text-color-active;
  }
  .header .el-menu--horizontal>.el-submenu .el-submenu__title i {
    color: inherit;
  }
  .el-submenu__title:hover {
    background-color: $header-background-color-hover !important;
  }
  .el-submenu__title{
    font-size: 16px;
  }
  .el-submenu__title .nz-icon-arrow-down ,.el-submenu__title>.nz-user{
    font-size: 14px;
  }
  .nz-submenu .el-menu--popup {
    border-radius: 4px;
  }
  .header .el-menu--horizontal>.el-submenu .el-submenu__title {
    min-width: 120px;
    text-align: center;
    color:$header-text-color;
    padding: 0;
    height: 50px;
    line-height: 50px;
  }
  .header .el-menu--horizontal>.icon-menu-item .el-submenu__title {
    min-width: 50px !important;
    line-height: 50px;
    /*margin-right:20px;*/
  }
  .header .vertical-line{
    display:inline-block;
    border-left:solid 1px white;
    line-height:30px !important;
    height:30px !important;
    min-width:0px !important;
    color:white;
    margin-right: 8px;
    margin-left: 8px;
    margin-top: -8px;
  }
  .header .vertical-line:hover{
    cursor:default !important;
  }
  /* top el-menu-item sytle------start*/
  .header .el-menu--horizontal>.el-menu-item  {
    height: 50px;
  }
  .header .el-menu--horizontal>.el-menu-item >div {
    min-width: 50px;
    text-align: center;
    /*color:$header-text-color;*/
    padding: 0;
    height: 50px;
    line-height: 51px;
  }
  .header .el-menu--horizontal>.el-menu-item i {
    color: $header-text-color;
  }
  .header .el-menu--horizontal>.el-menu-item>div {
    padding-left: 0px !important;
  }
  .header .el-menu--horizontal>.el-menu-item>div:hover {
    background-color: $header-background-color-hover !important;
  }
  .header .el-menu--horizontal>.el-menu-item:not(.is-disabled):focus, .header .el-menu--horizontal>.el-menu-item:not(.is-disabled):hover {
    background-color:transparent !important;
  }
  .header .right-tip{
    vertical-align:middle;
    line-height: 15px;
    font-size:6px;
    background-color:#ba3939;
    opacity:0.9;
    border-radius:7px;
    min-width:25px;
    height:15px;
    position:absolute;
    left: 25px;
    bottom: 27px;
    color:white;
  }
  /* top el-menu-item sytle------end*/
  .el-menu.el-menu--horizontal {
    border-bottom: 0px;
  }

  .el-submenu__title .el-submenu__icon-arrow {
    display: none;
  }

  .el-menu--horizontal > .el-menu-item.is-active {
    border-bottom: 0px;
  }

/*  .el-menu--horizontal > .el-submenu.is-active .el-submenu__title,
  .el-menu--horizontal > .el-menu-item.is-active,
  .el-menu--horizontal .el-menu-item:not(.is-disabled):focus, .el-menu--horizontal .el-menu-item:not(.is-disabled):hover {
    border-bottom: 0px;
    color: white;
  }*/
  .el-submenu.is-active .el-submenu__title{
    border-bottom-color: transparent !important;
  }
  .menu-create .menu-icon-create .nz-icon:before{
    height: 20px;
    line-height: 20px;
    display: inline-block;
    font-size: 20px;
    margin-top:-4px;
    margin-bottom:6px;
  }
  .el-submenu__icon-arrow .nz-icon-arrow-down{
    display: none;
  }
  .el-menu--horizontal.nz-submenu {
    border-top: none;
    top: 52px !important;

  }

  .nz-submenu .el-menu--popup {
    background-color: white !important;
  }

  .nz-submenu .el-menu--popup .el-menu-item {
    background-color: white !important;
  }
  .nz-submenu .el-menu--popup-bottom-start {
    margin-top: 0;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,.2);
  }

  .nz-submenu.el-menu--horizontal .el-menu .el-menu-item {
    color: #444444 !important;
    transition: none;
  }
  .header-dropdown-add {
    position: absolute;
    left: 14px;
    top: 1px;
  }
  .nz-submenu.el-menu--horizontal   {
    color: $global-text-color-active !important;
  }

  .el-menu-item > div, .el-menu-item > div > div {
    font-size: 15px;
  }
  .nz-menu-line {
    cursor: default;
    display: flex;
    align-items: center;
    height: 18px !important;
  }
  .nz-icon-navmore{
    font-size: 18px;
    line-height: 51.5px;
  }
</style>

<style scoped>
  .menu-create-title {
    font-size: 14px;
  }
  a.nz-a{
    color: inherit;
    text-decoration:none;
  }
  .header {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 50px;
    background-color: #232f3e;

  }

  .menu-create {
    line-height: 11px;
    text-align: center;
    padding-top: 12px;
  }

  .menu-create .nz-icon-plus {
    font-size: 12px;
    line-height: 12px;
  }

  .pop-window-assetType-content {
    padding: 1px 15px 15px 20px;
  }

  .pop-window {
    height: 370px;
    width: 400px;
  }

  .sidebar-pop-input {
    position: absolute;
    right: 50px;
    width: 200px;
    height: 26px;
    border-radius: 4px;
    border: 1px solid #DCDFE6;
    color: #606266;
    display: inline-block;
    padding: 0px 15px;
  }

  .sidebar-pop-input-select {
    position: absolute;
    right: 83px;
    width: 200px;
    height: 26px;
    border-radius: 4px;
    border: 1px solid #DCDFE6;
    color: #606266;
    display: inline-block;
    padding: 0px 15px;
  }

  .right-box-top-btn {
    border-radius: 0 0 9px 9px;
    float: right;
    color: #656565;
    height: 30px;
    font-size: 12px;
    padding: 3px 8px 1px 8px;
    border: 1px solid #aaaaaa;
    border-top: none;
    cursor: pointer;
    margin-left: 20px;
  }

  .right-box-bottom-btns {
    position: absolute;
    bottom: 0px;
    width: 100%;
    text-align: center;
  }

  .right-box-bottom-btn-cancel {
    background-color: #DADADA;
    color: #656565;
    width: 50%;
    border-bottom-left-radius: 8px;
  }

  .right-box-top-btn-full {
    background-color: #656565;
    border: 1px solid #656565;
    border-top: none;
    color: white;
  }

  .right-box-bottom-btn-50 {
    width: 50%;
    float: right;
    border-bottom-right-radius: 8px;
  }
  .linkTitle{
    display: inline-block;
    width: 200px;
    font-size: 15px;
    color: #444444;
  }
  .linkTitle:hover{
    background-color: #eee;
  }
  .linkTitle>a{
    display: inline-block;
    width: 150px;
    padding-left: 35px;
    padding-right: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .header-system-name{
    font-weight: 400;
    vertical-align: text-top;
    display: inline-block;
    font-family: Verdana;
    font-size: 12px;
    color: #c8c8c8;
    letter-spacing: -0.54px;
  }
</style>
<style>
  .nz-submenu .menu-edit {
    line-height: 36px;
    position: absolute;
    right: 15px;
    top: 0;
  }
  .nz-submenu .menu-edit i {
    font-size: 12px;
  }
  .el-menu-item {
    padding: 0;
  }
  .el-menu-item>div {
    padding-left: 30px;
  }
  .el-menu-item>div:hover {
    background-color: #eee;
  }
  .el-menu--horizontal .el-menu .el-menu-item, .el-menu--horizontal .el-menu .el-submenu__title {
    padding: 0;
  }
</style>
