<template >
  <div class="main-header">
    <div class="title">
      重庆市消防远程监控
    </div>
    <div class="nav-content">
      <div class="nav-list">
        <NavPanel :items="navLeftItems" default-active="dataV" @active="onActiveHandler" />
      </div>
      <div class="nav-list">
        <NavPanel :items="navRightItems" default-active="dataV" dir="right" @active="onActiveHandler" />
      </div>
    </div>
  </div>
</template>

<script>
import NavPanel from './NavPanel'

export default {
  name: 'Main.Header',
  components: {
    NavPanel
  },
  data() {
    return {
      navLeftItems: [
        {
          key: 'dataV',
          title: '可视化中心'
        },
        {
          key: 'onlineDevice',
          title: '联网设备监测'
        },
        {
          key: 'callCenter',
          title: '报警中心'
        }
      ],
      navRightItems: [
        {
          key: 'firePower',
          title: '消防警力'
        },
        {
          key: 'unit',
          title: '联网单位管理'
        },
        {
          key: 'project',
          title: '项目管理'
        },
        {
          key: 'system',
          title: '系统管理'
        }
      ]
    }
  },
  methods: {
    onActiveHandler: (data) => {
      // TODO: 切换逻辑
      console.log(data)
    }
  }
}
</script>

<style scoped lang='less'>
.main-header {
  width: 1919px;
  height: 91px;
  background: url('@/assets/images/main-header.png') no-repeat;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  .title {  
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 60px;
    font-family: DataFont;
    background-image:-webkit-linear-gradient(bottom,#46b4d6,#f0ffff);
    -webkit-background-clip:text; 
    -webkit-text-fill-color:transparent;
  }
  .nav-content {
    position: absolute;
    top: 0px;
    left: 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
  }
}
</style>
